Skip to content

RESTful API For ACL

Echo edited this page Mar 19, 2018 · 4 revisions
获取指定ACL信息
Request
GET /saltshaker/api/v1.0/acl/a-977a2b3a2b2d11e886cb000c298454d8

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

{
    "acl": {
        "id": "a-977a2b3a2b2d11e886cb000c298454d8",
        "deny": "rm -rf *;rm -rf /",
        "name": "safe",
        "allow": "",
        "description": "不允许使用rm相关命令"
    }
}
获取ACL列表
Request
GET /saltshaker/api/v1.0/role

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

{
    "acls": {
        "acl": [
            {
                "id": "a-977a2b3a2b2d11e886cb000c298454d8",
                "deny": "rm -rf *;'rm -rf /",
                "name": "safjjjjjjje",
                "allow": "",
                "description": "不允许使用rm相关命令"
            },
            {
                "id": "a-f710926a2b3611e886cb000c298454d8",
                "deny": "",
                "name": "danger",
                "allow": "*",
                "description": "任何命名"
            }
        ]
    }
}
添加ACL
Request
POST /saltshaker/api/v1.0/acl

POST Body
{
	"name":"denger",
	"allow": "*",
	"deny":"",
	"description":"任何命名"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "status": true,
    "message": ""
}
删除ACL
Request
DELETE /saltshaker/api/v1.0/acl/a-4d1e3d2c2b2a11e886cb000c298454d8

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

{
    "status": true,
    "message": ""
}
修改ACL
Request
PUT /saltshaker/api/v1.0/acl/a-977a2b3a2b2d11e886cb000c298454d8

PUT Body
{
        "id": "a-977a2b3a2b2d11e886cb000c298454d8",
        "deny": "rm -rf *;'rm -rf /",
        "name": "safe",
        "description": "不允许使用rm相关命令"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

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

Clone this wiki locally