Skip to content

RESTful API For Event

Echo edited this page Apr 12, 2018 · 1 revision
获取指定产品的event
Request
GET /saltshaker/api/v1.0/event?product_id=p-4bc4a5b83bd011e8aa0e000c298454d8

Response
HTTP/1.1 200 OK
Content-Type: application/json
{
    "events": {
        "event": [
            {
                "tag": "20180412120842056003",
                "data": {
                    "_stamp": "2018-04-12T04:08:42.056253",
                    "minions": [
                        "10.10.10.10",
                        "10.10.10.11"
                    ],
                    "product_id": "p-4bc4a5b83bd011e8aa0e000c298454d8"
                }
            },
            {
                "tag": "salt/job/20180412194626563004/ret/10.55.30.23",
                "data": {
                    "id": "10.10.10.10",
                    "cmd": "_return",
                    "fun": "pillar.items",
                    "jid": "20180412194626563004",
                    "_stamp": "2018-04-12T11:46:26.764676",
                    "return": {
                        "ip": "10.10.10.10",
                        "age": 12,
                        "bind": {
                            "prot": 53,
                            "listen-on": "any"
                        },
                        "name": "jyp"
                    },
                    "retcode": 0,
                    "success": "true",
                    "fun_args": [],
                    "product_id": "p-4bc4a5b83bd011e8aa0e000c298454d8"
                }
            }
        ]
    },
    "status": true,
    "message": ""
}
获取指定产品的event中指定的jid
Request
GET /saltshaker/api/v1.0/event/20180412191425587784?product_id=p-4bc4a5b83bd011e8aa0e000c298454d8

Response
HTTP/1.1 200 OK
Content-Type: application/json
{
    "event": {
        "tag": "salt/job/20180412191425587784/new",
        "data": {
            "arg": [],
            "fun": "saltutil.refresh_state",
            "jid": "20180412191425587784",
            "tgt": "*",
            "user": "root",
            "_stamp": "2018-04-12T11:14:25.588600",
            "minions": [
                "10.10.10.10",
                "10.10.10.11"
            ],
            "tgt_type": "glob",
            "product_id": "p-4bc4a5b83bd011e8aa0e000c298454d8"
        }
    },
    "status": true,
    "message": ""
}