Skip to content

RESTful API For Groups

Echo edited this page Apr 16, 2018 · 5 revisions
获取指定组信息
Request
GET /saltshaker/api/v1.0/groups/g-5a461050290a11e8a7e3000c298454d8

Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "id": "g-5a461050290a11e8a7e3000c298454d8",
        "name": "test",
        "product_id": "p-bbfc8b5221d611e894b0000c298454d8",
        "description": ""
    },
    "status": true,
    "message": ""
}
获取指定产品的组列表
Request
GET /saltshaker/api/v1.0/groups?product_id=p-bbfc8b5221d611e894b0000c298454d8

Response
HTTP/1.1 200 OK
Content-Type: application/json

{
   "data": [
        {
            "id": "g-60e2f3f22b1b11e886cb000c298454d8",
            "name": "test01",
            "product_id": "p-bbfc8b5221d611e894b0000c298454d8",
            "description": ""
        }
    ],
    "status": true,
    "message": ""
}
添加组
Request
POST /saltshaker/api/v1.0/groups

POST Body
{
	"name": "test01",
	"product_id": "p-bbfc8b5221d611e894b0000c298454d8"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status": true,
    "message": ""
}
删除组
Request
DELETE /saltshaker/api/v1.0/groups/g-42fcb22e28fa11e8a7e3000c298454d8

Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status": true,
    "message": ""
}
修改组
Request
PUT /saltshaker/api/v1.0/groups/g-42fcb22e28fa11e8a7e3000c298454d8
PUT Body
{
	"name": "test01",
	"product_id": "p-bbfc8b5221d611e894b0000c298454d8"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status": true,
    "message": ""
}