Gateways - Retrieve
- 11 Jun 2024
- 7 Minutes to read
- Print
- DarkLight
Gateways - Retrieve
- Updated on 11 Jun 2024
- 7 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Example: Retrieve Gateway
GET /1/gateways/{gateway_id}
Host: https://api.cogniac.io
curl -X GET https://api.cogniac.io/1/gateways/7eakrrvd \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz" \
-H "Content-Type: application/json" \
| json_pp
import requests
import json
from pprint import pprint
url_prefix = 'https://api.cogniac.io'
api_version = "1"
gateway_id = 'gnnbjp24'
token = 'abcdefg.hijklmnop.qrstuvwxyz' # add your token here
headers = {'Authorization': f'Bearer {token}',
'Content-Type': 'application/json'}
url = f'{url_prefix}/{api_version}/gateways/{gateway_id}'
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}")
{
"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",
"model_deployment_policy": "latest",
"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}}
}
Was this article helpful?