-
Notifications
You must be signed in to change notification settings - Fork 88
RESTful API For Product
Echo edited this page Mar 19, 2018
·
7 revisions
Request
GET /saltshaker/api/v1.0/product/p-ac5c74c821d611e894b0000c298454d8
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"product": {
"id": "p-ac5c74c821d611e894b0000c298454d8",
"name": "test",
"description": "test",
"salt_master_url": "http://10.10.10.10:8000",
"salt_master_user": "salt",
"salt_master_password": "salt"
}
}
Request
GET /saltshaker/api/v1.0/product
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"products": {
"product": [
{
"id": "p-bbfc8b5221d611e894b0000c298454d8",
"name": "test",
"description": "ad",
"salt_master_url": "http://127.0.0.1:8000",
"salt_master_user": "salt",
"salt_master_password": "salt"
},
{
"id": "p-c5008b0421d611e894b0000c298454d8",
"name": "test_ok",
"description": "ad",
"salt_master_url": "http://127.0.0.1:8000",
"salt_master_user": "saltapi",
"salt_master_password": "saltapi"
}
]
}
}
Request
POST /saltshaker/api/v1.0/product
POST Body
{
"name":"test01",
"description": "test",
"salt_master_url": "http://127.0.0.1:8000",
"salt_master_user": "saltapi",
"salt_master_password": "saltapi"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": true,
"message": ""
}
Request
DELETE /saltshaker/api/v1.0/product/p-72f9c9c82b2311e886cb000c298454d8
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": true,
"message": ""
}
Request
PUT /saltshaker/api/v1.0/product/p-72f9c9c82b2311e886cb000c298454d8
PUT Body
{
"name":"test01",
"description": "test",
"salt_master_url": "http://127.0.0.1:8000",
"salt_master_user": "saltapi",
"salt_master_password": "saltapi"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": true,
"message": ""
}