GWAPI: Gateways

From Yombo
Jump to: navigation, search

Gateway API Home

Items relating to gateways.

Get all gateways

Get a listing of all gateways within the current cluster.

  <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/gateway
  <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/gateway'
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         {
 7             "gateway_id": "m8v0E31ebmM7lRxk",
 8             "fqdn": "node1.example.com",
 9             "is_master": 1,
10             "master_gateway": "m8v0E31ebmM7lRxk",
11             "machine_label": "node1",
12             "label": "henry",
13             "description": "",
14             "status": 1,
15             "com_status": "online",
16             "created_at": 1489816839,
17             "updated_at": 1511757267
18         },
19         {
20             "gateway_id": "m2R0vMdZP9Axjm4G",
21             "fqdn": "zazu.example.com",
22             "is_master": 0,
23             "master_gateway": "m8v0E31ebmM7lRxk",
24             "machine_label": "zazu",
25             "label": "Zazu",
26             "description": "zazu server",
27             "status": 0,
28             "com_status": "None",
29             "created_at": 1501048673,
30             "updated_at": 1501260243
31         },
32         {
33             "gateway_id": "WemZ3Epng1KW6rVz",
34             "fqdn": "zerostatus.example.com",
35             "is_master": 0,
36             "master_gateway": "m8v0E31ebmM7lRxk",
37             "machine_label": "garage_rpi_zero_w",
38             "label": "Garage Raspberry PI Zero",
39             "description": "",
40             "status": 1,
41             "com_status": "online",
42             "created_at": 1502153449,
43             "updated_at": 1507561179
44         }
45     ]
46 }
This page was last edited on 12 June 2018.