Tenants - Gateways
- 22 Dec 2023
- 7 Minutes to read
- Print
- DarkLight
Tenants - Gateways
- Updated on 22 Dec 2023
- 7 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
The Tenant's Gateways endpoint allows users to search gateways available to the authorized tenant, sorted alphabetically based on the name of the Gateway.
Argument | Description |
---|---|
tenant_id | (required) The unique identifier of the Tenant object to be retrieved |
reverse | (optional) Results order can be reversed by adding the ?reverse=true parameter |
GET /1/tenants/{tenant_id}/gateways
Host: https://api.cogniac.io
Example: List Tenant's Gateways
curl -X GET https://api.cogniac.io/1/tenants/current/gateways \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz"
import requests
import json
from pprint import pprint
url_prefix = 'https://api.cogniac.io'
api_version = "1"
token = '' # add your token here
headers = {'Authorization': f'Bearer {token}'}
url = f'{url_prefix}/{api_version}/tenants/current/gateways'
res = requests.get(url, headers=headers)
if res.status_code == 200:
response_data = json.loads(res.content)
pprint(response_data)
else:
print(f"Error: {res.status_code}, {res.text},{res.headers}")
{
"data": [
{
"gateway_id": "Ajr2t45p",
"location": "cogniac-hq",
"poll_interval": 20,
"name": "test gateway ",
"description": "test gateway at cogniac",
"created_at": 1463179215.124683,
"modified_at": 1463179215.124683,
"tenant_id": "rt06diepwc3i",
"created_by": "test@cogniac.co",
"ip_address": "127.0.0.1",
"mac_address": "7993a639543a",
"serial_number": "ZX0C9EE0-E021-82D3-BB0A-3437F681E41E",
"current_status" : {"platform": {"gpu": {"mem_used": 20,
"temperature": "78",
"utilization" : "3"},
"sys_mem":{"available": 11773067264,
"total": 16735567872,
"percent_used": 29.7,
"free": 10092732416},
"disk": {"total": 100933414912,
"percent": 21.9,
"free": 74787176448,
"used": 20995424256},
"cpu": {"idle": 46.9,
"user": 45.8,
"system": 7.1},
"network":{"bytes_tx": 20400476948,
"bytes_rx": 560034409582,
"errors": 0, "drops": 0}},
"timestamp" : 1490979881.0626523,
"cameras":{"X8RGSUBm": {"rxframes": 885,
"url": "rtsp://localhost:554",
"queue_full": 0, "nospace": 0,
"last_rxframe": 1488505554,
"badframes": 4}},
"cloud_connectivity": True,
"local_disk_cache": {"free": 84823769088,
"percent": 11.4,
"total": 100933414912,
"used": 10958831616},
"image_cache": {"total": 100933414912,
"percent": 21.9,
"free": 74776092672,
"used": 21006508032}},
"previous_status" : {"platform": {"gpu": {"mem_used": 20,
"temperature": "75",
"utilization" : "3"},
"sys_mem": {"available": 11773067264,
"total": 16735567872,
"percent_used": 22.7,
"free": 10092732416},
"disk": {"total": 100933414912,
"percent": 21.9,
"free": 74787176418,
"used": 20995424256},
"cpu": {"idle": 46.9,
"user": 45.8,
"system": 7.1},
"network":{"bytes_tx": 20400476908,
"bytes_rx": 560034409182,
"errors": 0, "drops": 0}},
"timestamp" : 1490979871.0626523,
"cameras":{"X8RGSUBm": {"rxframes": 705,
"url": "rtsp://localhost:554",
"queue_full": 0, "nospace": 0,
"last_rxframe": 1488505554,
"badframes": 4}},
"cloud_connectivity": True,
"local_disk_cache": {"free": 84823769088,
"percent": 11.4,
"total": 100933414912,
"used": 10958831616},
"image_cache": {"total": 100933414912,
"percent": 21.9,
"free": 74776092672,
"used": 21006508032}}
},
{
//Next Gateway object Object ...
}
]
}
Was this article helpful?