GWAPI: Gateways
From Yombo
- Authentication
- Provided resources
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;">
{
"code": 200,
"message": "OK",
"comments": {},
"payload": [
{
"gateway_id": "m8v0E31ebmM7lRxk",
"fqdn": "node1.example.com",
"is_master": 1,
"master_gateway": "m8v0E31ebmM7lRxk",
"machine_label": "node1",
"label": "henry",
"description": "",
"status": 1,
"com_status": "online",
"created_at": 1489816839,
"updated_at": 1511757267
},
{
"gateway_id": "m2R0vMdZP9Axjm4G",
"fqdn": "zazu.example.com",
"is_master": 0,
"master_gateway": "m8v0E31ebmM7lRxk",
"machine_label": "zazu",
"label": "Zazu",
"description": "zazu server",
"status": 0,
"com_status": "None",
"created_at": 1501048673,
"updated_at": 1501260243
},
{
"gateway_id": "WemZ3Epng1KW6rVz",
"fqdn": "zerostatus.example.com",
"is_master": 0,
"master_gateway": "m8v0E31ebmM7lRxk",
"machine_label": "garage_rpi_zero_w",
"label": "Garage Raspberry PI Zero",
"description": "",
"status": 1,
"com_status": "online",
"created_at": 1502153449,
"updated_at": 1507561179
}
]
}