Skip to content

RESTful API For Pillar

Echo edited this page May 4, 2018 · 2 revisions
获取对应minion的所有pillar信息
Request
POST /saltshaker/api/v1.0/pillar?product_id=p-4bc4a5b83bd011e8aa0e000c298454d8

POST Body
{
	"minion_id":["10.10.10.22","10.10.10.23"]
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "result": {
            "10.10.10.23": {
                "ip": "10.10.10.23",
                "age": 12,
                "bind": {
                    "listen-on": "any",
                    "prot": 53
                },
                "add": "gggggg",
                "name": "jyp"
            },
            "10.10.10.22": {
                "ip": "10.10.10.23",
                "age": 12,
                "bind": {
                    "listen-on": "any",
                    "prot": 53
                },
                "add": "gggggg",
                "name": "jyp"
            }
        },
        "command": "pillar.items",
        "total": "2",
        "succeed": "2",
        "failure": "0",
        "failure_minion": ""
    },
    "status": true,
    "message": ""
}
获取对应minion指定的pillar信息
Request
POST /saltshaker/api/v1.0/pillar?product_id=p-4bc4a5b83bd011e8aa0e000c298454d8

POST Body
{
	"minion_id":["10.10.10.22","10.10.10.23"],
        "item":["age"]
}
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "data": {
        "result": {
            "10.10.10.23": {
                "age": 12
            },
            "10.10.10.22": {
                "age": 12
            }
        },
        "command": "pillar.item age",
        "total": "2",
        "succeed": "2",
        "failure": "0",
        "failure_minion": ""
    },
    "status": true,
    "message": ""
}