Network Cameras - Retrieve
  • 04 Jan 2024
  • 4 Minutes to read
  • Dark
    Light

Network Cameras - Retrieve

  • Dark
    Light

Article summary

Retrieve Network Cameras

An existing Network Camera object can be retrieved, updated, and deleted through the Network Cameras endpoint.

network_camera_id
string

The unique identifier of the Network Camera object to be retrieved.

url
string

Camera's media URL.

camera_name
string

User-specified camera name included as a tag with all detections from this camera.

description
string

Additional user-provided description of the network camera.

active
boolean

True = Camera is active - frames will be processed by the camera. There is no direct control of the camera.
 
 False = Camera is inactive - frames are not being processed from the camera.

tenant_id
string

The tenant ID for the network camera

hae
int

Height above ellipsoid expressed in meters.
 Reserved for UAV use.

lon
float

longitudinal location of camera

lat
float

latitudinal location of camera

create_at
float

Unix timestamp at time of camera creation

modified_at
float

Unix timestamp of last modification

created_by
string

User who created camera

GET /1/networkCameras/{network_camera_id}
Host: https://api.cogniac.io
curl -X GET https://api.cogniac.io/1/networkCameras/CNNMFHH \
-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"
camera_id = 'CNNMFHH'
token = ''  # add your token here
headers = {'Authorization': f'Bearer {token}',
           'Content-Type': 'application/json'}

url = f'{url_prefix}/{api_version}/networkCameras/{camera_id}'
res = requests.post(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}")

{'IP_config_current': None,
 'IP_config_options': None,
 'active': True,
 'alt_subject_uid': ['cracked_glass_subject_2de'],
 'camera_name': 'Basler Camera 1',
 'ch_px': None,
 'created_at': 1670604509.201616,
 'created_by': 'test@cogniac.co',
 'current_IP': '10.5.2.101',
 'current_subnet_mask': None,
 'custom_configuration': {'livestream': 1},
 'cv_px': None,
 'default_gateway': None,
 'description': 'test basler cam',
 'device_mode': None,
 'device_version': None,
 'discovered_by': None,
 'focal_length_h_mm': None,
 'focal_length_v_mm': None,
 'gateway_id': None,
 'genicam_features': None,
 'genicam_xml': None,
 'gige_features': None,
 'hae': None,
 'last_model_change_timestamp': None,
 'last_pose_change_timestamp': None,
 'lat': None,
 'lon': None,
 'mac_address': None,
 'manufacturer_info': None,
 'manufacturer_name': None,
 'model_name': None,
 'modified_at': 1700862423.433624,
 'network_camera_id': 'CNNMFHH',
 'orientation': None,
 'origin_x': None,
 'origin_y': None,
 'pitch': None,
 'pixel_h_um': None,
 'pixel_v_um': None,
 'radial_distortion_coefficients': None,
 'resolution_h_px': None,
 'resolution_v_px': None,
 'roll': None,
 'serial_number': None,
 'skew': None,
 'spec_version_major': None,
 'spec_version_minor': None,
 'subject_uid': 'basler_camera_6mf',
 'tangential_distortion_coefficients': None,
 'tenant_id': 'd16jdqt1h71f',
 'tx_m': None,
 'ty_m': None,
 'tz_m': None,
 'url': 'gigv://10.5.2.101/',
 'user_defined_name': None,
 'x_axis_x': None,
 'x_axis_y': None,
 'y_axis_x': None,
 'y_axis_y': None,
 'yaw': None,
 'z_axis_x': None,
 'z_axis_y': None}

These fields are defined in the "Network Cameras Create" section.

Retrieve Network Cameras associated with a gateway

GET /1/gateways/{gateway_id}/networkCameras
Host: https://api.cogniac.io

This responds with details of network cameras which are associated with given gateway_id

#!/bin/bash
curl -X GET https://api.cogniac.io/1/gateways/bcufgmp7/networkCameras \
-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 = 'bcufgmp7'
token = 'abcdefg.hijklmnop.qrstuvwxyz'  # add your token here
headers = {'Authorization': f'Bearer {token}',
           'Content-Type': 'application/json'}  # Fixed the headers

url = f'{url_prefix}/{api_version}/gateways/{gateway_id}/networkCameras'
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}")

  • Example Response

{'data': [{'IP_config_current': '6',
           'IP_config_options': '7',
           'active': True,
           'alt_subject_uid': None,
           'camera_name': 'Line 1 Camera',
           'ch_px': None,
           'created_at': 1616526220.104424,
           'created_by': 'edgeflow-dlqvuoxv',
           'current_IP': '169.254.189.207',
           'current_subnet_mask': '255.255.0.0',
           'custom_configuration': None,
           'cv_px': None,
           'default_gateway': '0.0.0.0',
           'description': 'manufacturer_name: Basler\n'
                          'model_name: acA4112-8gc\n'
                          'serial_number: 40048962\n'
                          'device_version: 107412-08\n'
                          'mac: 00:30:53:35:cf:bc\n',
           'device_mode': '2147483649',
           'device_version': '107412-08',
           'discovered_by': 'dlqvuoxv',
           'focal_length_h_mm': None,
           'focal_length_v_mm': None,
           'gateway_id': 'dlqvuoxv',
           'genicam_features': None,
           'genicam_xml': None,
           'gige_features': None,
           'hae': None,
           'last_model_change_timestamp': None,
           'last_pose_change_timestamp': None,
           'lat': None,
           'lon': None,
           'mac_address': '00:30:53:35:cf:bc',
           'manufacturer_info': 'none',
           'manufacturer_name': 'Basler',
           'model_name': 'acA4112-8gc',
           'modified_at': 1630337298.615112,
           'network_camera_id': 'FEMCVVQ',
           'orientation': None,
           'origin_x': None,
           'origin_y': None,
           'pitch': None,
           'pixel_h_um': None,
           'pixel_v_um': None,
           'radial_distortion_coefficients': None,
           'resolution_h_px': None,
           'resolution_v_px': None,
           'roll': None,
           'serial_number': '40048962',
           'skew': None,
           'spec_version_major': '2',
           'spec_version_minor': None,
           'subject_uid': 'basler_aca41128gc_40048962_1oy',
           'tangential_distortion_coefficients': None,
           'tenant_id': 'abcdefgh',
           'tx_m': None,
           'ty_m': None,
           'tz_m': None,
           'url': 'gigv://169.254.189.207/',
           'user_defined_name': None,
           'x_axis_x': None,
           'x_axis_y': None,
           'y_axis_x': None,
           'y_axis_y': None,
           'yaw': None,
           'z_axis_x': None,
           'z_axis_y': None}]}

These fields are defined in the "Network Cameras Create" section.


Was this article helpful?