GWAPI: Device commands

From Yombo
Jump to: navigation, search

Gateway API Home

Get details on device commands.

Get device command details

Get a listing of all device commands in memory on the local gateway.

  <div id="curl<random_number></random_number>" class="tab-pane fade in active" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
curl \
-H "x-api-auth: kip8EaWvR7Y6eLN2c0t0L2z3oELs3hR0jeEDrAr6Ozm7EB" \
http://localhost:8080/api/v1/device_command/<7eD!>uo0D-p!WK
  <div id="python<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
import requests

url = http://localhost:8080/api/v1/device_command/<7eD!>uo0D-p!WK'
headers = {
    'x-api-key': 'kip8EaWvR7Y6eLN2c0t0L2z3oELs3hR0jeEDrAr6Ozm7EB',
    }

response = requests.get(url, headers=headers)
  <div id="output<random_number></random_number>" class="tab-pane fade" style="border: 1px solid #ccc; border-radius: 5px; padding: 0.7em;">
 1 {
 2     "code": 200,
 3     "message": "OK",
 4     "comments": {},
 5     "payload": {
 6         "request_id": "dnmZbNNWoa1iJDoZQw",
 7         "persistent_request_id": null,
 8         "source_gateway_id": "E31ebmxkm8M7lRv0",
 9         "device_id": "x4RE0o7nvP7KN8Q3",
10         "command_id": "6qBJKkN6kw3nW",
11         "inputs": {},
12         "created_at": 1513302218.2532196,
13         "broadcast_at": 1513302218.3197937,
14         "accepted_at": null,
15         "sent_at": 1513302218.270456,
16         "received_at": 1513302218.2844048,
17         "pending_at": null,
18         "finished_at": 1513302218.2984602,
19         "not_before_at": null,
20         "not_after_at": null,
21         "started": true,
22         "command_status_received": false,
23         "history": [
24             [
25                 1513302218.2532196,
26                 "unknown",
27                 "Created.",
28                 "E31ebmxkm8M7lRv0"
29             ],
30             [
31                 1513302218.270456,
32                 "unknown",
33                 "Command sent to device or processing sub-system.",
34                 "E31ebmxkm8M7lRv0"
35             ],
36             [
37                 1513302218.2844048,
38                 "unknown",
39                 "Command received by the device or processing sub-system.",
40                 "E31ebmxkm8M7lRv0"
41             ],
42             [
43                 1513302218.2984602,
44                 "unknown",
45                 "PLM interface not ready.",
46                 "E31ebmxkm8M7lRv0"
47             ],
48             [
49                 1513302218.3197937,
50                 "unknown",
51                 "Command broadcasted to hooks and gateway coms.",
52                 "E31ebmxkm8M7lRv0"
53             ]
54         ],
55         "status": "unknown",
56         "requested_by": {
57             "user_id": "apiauth:N",
58             "component": "yombo.gateway.lib.WebInterface.api_v1.devices_get",
59             "gateway": "E31ebmxkm8M7lRv0"
60         }
61     }
62 }
This page was last edited on 15 December 2017.