-
Notifications
You must be signed in to change notification settings - Fork 88
RESTful API For Job
Echo edited this page Mar 22, 2018
·
4 revisions
Request
GET /saltshaker/api/v1.0/job?product_id=p-c5008b0421d611e894b0000c298454d8
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"20180321161745133131": {
"Function": "grains.item",
"Target": "echo",
"Target-type": "glob",
"Arguments": [
"echo"
],
"StartTime": "2018, Mar 21 16:17:45.133131",
"User": "saltapi"
},
"20180321162652460314": {
"Function": "grains.items",
"Target": "echo",
"Target-type": "glob",
"Arguments": [],
"StartTime": "2018, Mar 21 16:26:52.460314",
"User": "saltapi"
},
"20180321161549727190": {
"Function": "grains.items",
"Target": "echo",
"Target-type": "glob",
"Arguments": [],
"StartTime": "2018, Mar 21 16:15:49.727190",
"User": "saltapi"
}
}
Request
GET /saltshaker/api/v1.0/job/20180322162445601279?product_id=p-c5008b0421d611e894b0000c298454d8
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"echo": "docker0 Link encap:Ethernet HWaddr 02:42:13:41:92:7c \n inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0\n inet6 addr: fe80::42:13ff:fe41:927c/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:5111 errors:0 dropped:0 overruns:0 frame:0\n TX packets:6419 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:2965753 (2.9 MB) TX bytes:2988554 (2.9 MB)\n\ndocker_gwbridge Link encap:Ethernet HWaddr 02:42:50:ef:f5:48 \n inet addr:172.18.0.1 Bcast:0.0.0.0 Mask:255.255.0.0\n inet6 addr: fe80::42:50ff:feef:f548/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:0 errors:0 dropped:0 overruns:0 frame:0\n TX packets:63 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:0 (0.0 B) TX bytes:6870 (6.8 KB)\n\nens33 Link encap:Ethernet HWaddr 00:0c:29:84:54:d8 \n inet addr:192.168.44.128 Bcast:192.168.44.255 Mask:255.255.255.0\n inet6 addr: fe80::dd47:53fb:935:8717/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:12257 errors:0 dropped:0 overruns:0 frame:0\n TX packets:7676 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:5230544 (5.2 MB) TX bytes:4593788 (4.5 MB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:4680 errors:0 dropped:0 overruns:0 frame:0\n TX packets:4680 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:448658 (448.6 KB) TX bytes:448658 (448.6 KB)\n\nveth44715f5 Link encap:Ethernet HWaddr 52:37:f9:79:73:88 \n inet6 addr: fe80::5037:f9ff:fe79:7388/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:0 errors:0 dropped:0 overruns:0 frame:0\n TX packets:106 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:0 (0.0 B) TX bytes:11432 (11.4 KB)\n\nveth6ce9bc7 Link encap:Ethernet HWaddr 8a:13:a4:cd:ce:7f \n inet6 addr: fe80::8813:a4ff:fecd:ce7f/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:5111 errors:0 dropped:0 overruns:0 frame:0\n TX packets:6456 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:3037307 (3.0 MB) TX bytes:2992585 (2.9 MB)"
}
Request
GET /saltshaker/api/v1.0/job/manager?product_id=p-c5008b0421d611e894b0000c298454d8
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"20180322175136197252": {
"Function": "cmd.run",
"Returned": [],
"Target-type": "glob",
"Running": [
{
"echo": 68610
}
],
"User": "root",
"StartTime": "2018, Mar 22 17:51:36.197252",
"Arguments": [
"ping www.baidu.com"
],
"Target": "echo"
}
}
Request
DELETE /saltshaker/api/v1.0/job/manager?action=kill&jid=20180322183450546428&product_id=p-c5008b0421d611e894b0000c298454d8
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": true,
"message": "echo:\n Signal 9 sent to job 20180322183450546428 at pid 83218\n"
}