На странице:

Получение информации об устройстве

{
    "method": "axxonsoft.bl.config.ConfigurationService.ListUnits",
    "data": {
        "unit_uids": [
            "hosts/Server1/DeviceIpint.10"
        ]
    }
}

Примет ответа:

{
    "units": [
        {
            "uid": "hosts/Server1/DeviceIpint.10",
            "display_id": "10",
            "type": "DeviceIpint",
            "display_name": "",
            "access_point": "",
            "properties": [
                {
                    "id": "display_name",
                    "name": "Display name",
                    "type": "string",
                    "readonly": false,
                    "value_string": "axis"
                },
                {
                    "id": "driverName",
                    "name": "Driver Name",
                    "type": "string",
                    "readonly": true,
                    "value_string": "Axis"
                },
                {
                    "id": "driverVersion",
                    "name": "Driver Version",
                    "type": "string",
                    "readonly": true,
                    "value_string": "3.0.0"
                },
                {
                    "id": "vendor",
                    "name": "Device Vendor",
                    "type": "string",
                    "readonly": false,
                    "enum_constraint": {},
                    "value_string": "Axis"
                },
                {
                    "id": "model",
                    "name": "Device Model",
                    "type": "string",
                    "readonly": false,
                    "value_string": "P1343"
                },
                {
                    "id": "firmware",
                    "name": "Firmware version",
                    "type": "string",
                    "readonly": false,
                    "value_string": "5.06"
                },
                {
                    "id": "address",
                    "name": "IP Address of device",
                    "type": "string",
                    "readonly": false,
                    "value_string": "192.168.0.181"
                },
                {
                    "id": "port",
                    "name": "Port number",
                    "type": "int32",
                    "readonly": false,
                    "value_int32": 80
                },
                {
                    "id": "useDefaultAuthentication",
                    "name": "Use default device credentials",
                    "type": "bool",
                    "readonly": false,
                    "value_bool": false
                },
                {
                    "id": "user",
                    "name": "Login",
                    "type": "string",
                    "readonly": false,
                    "value_string": "root"
                },
                {
                    "id": "password",
                    "name": "Password",
                    "type": "string",
                    "readonly": false,
                    "value_string": "pass"
                },
                {
                    "id": "blockingConfiguration",
                    "name": "Preserve device settings",
                    "type": "bool",
                    "readonly": false,
                    "value_bool": false
                },
                {
                    "id": "geoLocationLatitude",
                    "name": "Geolocation Latitude",
                    "type": "double",
                    "readonly": false,
                    "value_double": 35
                },
                {
                    "id": "geoLocationLongitude",
                    "name": "Geolocation Longitude",
                    "type": "double",
                    "readonly": false,
                    "value_double": 45
                },
                {
                    "id": "geoLocationAzimuth",
                    "name": "Geolocation Azimuth",
                    "type": "double",
                    "readonly": false,
                    "value_double": 0
                }
            ],
            "units": [
                {
                    "uid": "hosts/Server1/DeviceIpint.10/VideoChannel.0",
                    "display_id": "0",
                    "type": "VideoChannel",
                    "display_name": "",
                    "access_point": "",
                    "properties": [],
                    "units": [],
                    "factory": [],
                    "destruction_args": [],
                    "discoverable": false,
                    "status": "UNIT_STATUS_ACTIVE",
                    "stripped": false,
                    "opaque_params": [],
                    "assigned_templates": []
                },
                {
                    "uid": "hosts/Server1/DeviceIpint.10/Microphone.0",
                    "display_id": "0",
                    "type": "Microphone",
                    "display_name": "",
                    "access_point": "",
                    "properties": [],
                    "units": [],
                    "factory": [],
                    "destruction_args": [],
                    "discoverable": false,
                    "status": "UNIT_STATUS_INACTIVE",
                    "stripped": false,
                    "opaque_params": [],
                    "assigned_templates": []
                },
                {
                    "uid": "hosts/Server1/DeviceIpint.10/Telemetry.0",
                    "display_id": "0",
                    "type": "Telemetry",
                    "display_name": "",
                    "access_point": "",
                    "properties": [],
                    "units": [],
                    "factory": [],
                    "destruction_args": [],
                    "discoverable": false,
                    "status": "UNIT_STATUS_ACTIVE",
                    "stripped": false,
                    "opaque_params": [],
                    "assigned_templates": []
                },
                {
                    "uid": "hosts/Server1/DeviceIpint.10/IO.0",
                    "display_id": "0",
                    "type": "IO",
                    "display_name": "",
                    "access_point": "",
                    "properties": [],
                    "units": [],
                    "factory": [],
                    "destruction_args": [],
                    "discoverable": false,
                    "status": "UNIT_STATUS_INACTIVE",
                    "stripped": false,
                    "opaque_params": [],
                    "assigned_templates": []
                },
                {
                    "uid": "hosts/Server1/DeviceIpint.10/Speaker.0",
                    "display_id": "0",
                    "type": "Speaker",
                    "display_name": "",
                    "access_point": "",
                    "properties": [],
                    "units": [],
                    "factory": [],
                    "destruction_args": [],
                    "discoverable": false,
                    "status": "UNIT_STATUS_INACTIVE",
                    "stripped": false,
                    "opaque_params": [],
                    "assigned_templates": []
                }
            ],
            "factory": [],
            "destruction_args": [],
            "discoverable": false,
            "status": "UNIT_STATUS_ACTIVE",
            "stripped": false,
            "opaque_params": [],
            "assigned_templates": [
                "502f5739-0b18-4852-891a-35aefbd85d7c"
            ]
        }
    ],
    "unreachable_objects": [],
    "not_found_objects": []
}

В свойствах поля units содержится следующая информация:

  • имя устройства,
  • производитель,
  • модель,
  • IP-адрес,
  • порт,
  • прошивка,
  • логин и пароль,
  • данные геолокации.

Дочерние объекты устройства (видеоканалы, потоки, микрофоны, динамики, телеметрия, датчики и реле) будут указаны в дочерних units.

Получение информации об устройстве по точке доступа

Получение информации по точке доступа доступно для архивов, детекторов и видеокамер.

Например, запрос для получения информации об архиве по точке доступа:

{
    "method":"axxonsoft.bl.config.ConfigurationService.ListUnitsByAccessPoints",
    "data":{
        "access_points": ["hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0"]
    }
}

Пример ответа:

{
    "units": [
        {
            "uid": "hosts/Server1/DeviceIpint.1/VideoChannel.0",
            "display_id": "0",
            "type": "VideoChannel",
            "display_name": "",
            "access_point": "hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0",
            "properties": []
		}
}

где

  • uid − Сервер, где создано устройство;
  • type тип устройства.

Запрос для получения информации о детекторе по точке доступа:

{
    "method":"axxonsoft.bl.config.ConfigurationService.ListUnitsByAccessPointsStream",
    "data":{
        "access_points": ["hosts/Server1/AVDetector.1/EventSupplier"]
    }
}

Пример ответа:

--ngpboundary
Content-Type: application/json; charset=utf-8
Content-Length: 24703

{
    "units": [
        {
            "uid": "hosts/Server1/AVDetector.1",
            "display_id": "1",
            "type": "AVDetector",
            "display_name": "Object tracker",
            "access_point": "hosts/Server1/AVDetector.1/EventSupplier",
            "properties": []
		}
}

Примечание

  • ListUnitsByAccessPointsStream позволяет отдавать больше данных в нескольких пакетах, в отличие от ListUnitsByAccessPoints, который передает данные в одном пакете.
  • ListUnitsByAccessPointsStream может не подходить для Web-Клиентов, которые не работают с потоковыми сервисами. 

 

Получение информации по дочерним объектам устройств

Пример запроса на получение информации о видеоканале:

{
    "method":"axxonsoft.bl.config.ConfigurationService.ListUnits",
    "data":{
        "unit_uids":["hosts/Server1/DeviceIpint.10/VideoChannel.0"]
            }
}

Ответ:

{
                    "uid": "hosts/Server1/DeviceIpint.10/VideoChannel.0",
                    "display_id": "0",
                    "type": "VideoChannel",
                    "display_name": "",
                    "access_point": "",
                    "properties": [
                        {
                            "id": "channel_id",
                            "name": "",
                            "type": "int32",
                            "readonly": true,
                            "value_int32": 0
                        },
                        {
                            "id": "display_name",
                            "name": "Display name",
                            "type": "string",
                            "readonly": false,
                            "value_string": "axis"
                        },
                        {
                            "id": "comment",
                            "name": "Comment",
                            "type": "string",
                            "readonly": false,
                            "value_string": ""
                        },
                        {
                            "id": "enabled",
                            "name": "Enable VideoChannel",
                            "type": "bool",
                            "readonly": false,
                            "value_bool": true
                        },
                        {
                            "id": "brightness",
                            "name": "",
                            "type": "int32",
                            "readonly": false,
                            "range_constraint": {},
                            "value_int32": 50
                        },
                        {
                            "id": "contrast",
                            "name": "",
                            "type": "int32",
                            "readonly": false,
                            "range_constraint": {},
                            "value_int32": 50
                        },
                        {
                            "id": "digitalPtz",
                            "name": "",
                            "type": "bool",
                            "readonly": false,
                            "value_bool": false
                        },
                        {
                            "id": "flickerfree",
                            "name": "",
                            "type": "string",
                            "readonly": false,
                            "enum_constraint": {},
                            "value_string": "auto"
                        },
                        {
                            "id": "imageFlip",
                            "name": "",
                            "type": "int32",
                            "readonly": false,
                            "enum_constraint": {},
                            "value_int32": 0
                        },
                        {
                            "id": "maxZoom",
                            "name": "",
                            "type": "int32",
                            "readonly": false,
                            "enum_constraint": {},
                            "value_int32": 250
                        },
                        {
                            "id": "saturation",
                            "name": "",
                            "type": "int32",
                            "readonly": false,
                            "range_constraint": {},
                            "value_int32": 50
                        },
                        {
                            "id": "sharpness",
                            "name": "",
                            "type": "int32",
                            "readonly": false,
                            "range_constraint": {},
                            "value_int32": 50
                        }
                    ],
                    "units": [
                        {
                            "uid": "hosts/Server1/DeviceIpint.10/VideoChannel.0/Streaming.0",
                            "display_id": "0",
                            "type": "Streaming",
                            "display_name": "",
                            "access_point": "",
                            "properties": [],
                            "units": [],
                            "factory": [],
                            "destruction_args": [],
                            "discoverable": false,
                            "status": "UNIT_STATUS_ACTIVE",
                            "stripped": false,
                            "opaque_params": [],
                            "assigned_templates": []
                        },
                        {
                            "uid": "hosts/Server1/DeviceIpint.10/VideoChannel.0/Streaming.1",
                            "display_id": "1",
                            "type": "Streaming",
                            "display_name": "",
                            "access_point": "",
                            "properties": [],
                            "units": [],
                            "factory": [],
                            "destruction_args": [],
                            "discoverable": false,
                            "status": "UNIT_STATUS_ACTIVE",
                            "stripped": false,
                            "opaque_params": [],
                            "assigned_templates": []
                        },
                        {
                            "uid": "hosts/Server1/DeviceIpint.10/VideoChannel.0/Detector.motion_detection",
                            "display_id": "motion_detection",
                            "type": "Detector",
                            "display_name": "",
                            "access_point": "",
                            "properties": [],
                            "units": [],
                            "factory": [],
                            "destruction_args": [],
                            "discoverable": false,
                            "status": "UNIT_STATUS_INACTIVE",
                            "stripped": false,
                            "opaque_params": [],
                            "assigned_templates": []
                        },
                        {
                            "uid": "hosts/Server1/DeviceIpint.10/VideoChannel.0/Detector.tampering_detection",
                            "display_id": "tampering_detection",
                            "type": "Detector",
                            "display_name": "",
                            "access_point": "",
                            "properties": [],
                            "units": [],
                            "factory": [],
                            "destruction_args": [],
                            "discoverable": false,
                            "status": "UNIT_STATUS_INACTIVE",
                            "stripped": false,
                            "opaque_params": [],
                            "assigned_templates": []
                        },
                        {
                            "uid": "hosts/Server1/DeviceIpint.10/VideoChannel.0/Detector.audio_detection",
                            "display_id": "audio_detection",
                            "type": "Detector",
                            "display_name": "",
                            "access_point": "",
                            "properties": [],
                            "units": [],
                            "factory": [],
                            "destruction_args": [],
                            "discoverable": false,
                            "status": "UNIT_STATUS_INACTIVE",
                            "stripped": false,
                            "opaque_params": [],
                            "assigned_templates": []
                        }
                    ],
                    "factory": [],
                    "destruction_args": [],
                    "discoverable": false,
                    "status": "UNIT_STATUS_ACTIVE",
                    "stripped": false,
                    "opaque_params": [],
                    "assigned_templates": []
                }

В свойствах properties содержатся параметры видео, в дочерних − потоки и детекторы, если созданы.

Изменение конфигурации

Добавление устройства

Добавление виртуальной видеокамеры без настроек:

{
    "method": "axxonsoft.bl.config.ConfigurationService.ChangeConfig",
    "data": {
        "added": [
            {
                "uid": "hosts/Server1",
                "units": [
                    {
                        "type": "DeviceIpint",
                        "units": [],
                        "properties": [
                            {
                                "id": "vendor",
                                "value_string": "ITV",
                                "properties": [
                                    {
                                        "id": "model",
                                        "value_string": "Virtual",
                                        "properties": []
                                    }
                                ]
                            },
                            {
                                "id": "display_name",
                                "value_string": "newOrder2",
                                "properties": []
                            },
                            {
                                "id": "blockingConfiguration",
                                "value_bool": false,
                                "properties": []
                            },
                            {
                                "id": "display_id",
                                "value_string": "199"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}


где uid − Сервер, где создается устройство.

В результате будет создана камера с дочерними микрофоном, встроенным архивом и датчиком. Все дочерние объекты, кроме видеоканала, будут выключены. 

{    
	"failed": [],    
	"added": ["hosts/Server1/DeviceIpint.199"]
}

где 199 − id созданного устройства.

Примечание

В некоторых случаях id созданного устройства может не совпадать с заданным значением display_id в запросе.

Создание трекера объектов

{
    "method":"axxonsoft.bl.config.ConfigurationService.ChangeConfig",
    "data":{
        "added": {
            "uid": "hosts/Server1",
            "units": {
                "type": "AVDetector",
                "properties": [
                    {
                        "id": "display_name",
                        "value_string": "Object tracker"
                    },
                    {                      
                        "id": "input",
                        "value_string": "Video",
                        "properties": [
                            {      
                                "id": "camera_ref",
                                "value_string": "hosts/Server1/DeviceIpint.200/SourceEndpoint.video:0:0",
                                "properties": [
                                    {
                                        "id": "streaming_id",
                                        "value_string": "hosts/Server1/DeviceIpint.200/SourceEndpoint.video:0:0"
                                    }
                                ]
                            },                     
                            {
                                "id": "detector",
                                "value_string": "SceneDescription"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

Создание детектора движения в области под трекером объектов

{
    "method":"axxonsoft.bl.config.ConfigurationService.ChangeConfig",
    "data":{
        "added": {
            "uid": "hosts/Server1",
            "units": {
                "type": "AppDataDetector",
                "properties": [
                    {
                        "id": "display_name",
                        "value_string": "AppDataDetectorMoveInZone"
                    },
                    {                      
                        "id": "input",
                        "value_string": "TargetList",
                        "properties": [
                            {      
                                "id": "camera_ref",
                                "value_string": "hosts/Server1/DeviceIpint.200/SourceEndpoint.video:0:0",
                                "properties": [
                                    {
                                        "id": "streaming_id",
                                        "value_string": "hosts/Server1/AVDetector.1/SourceEndpoint.vmda"
                                    }
                                ]
                            },                     
                            {
                                "id": "detector",
                                "value_string": "MoveInZone"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

Изменение папки с видео для виртуальной камеры

{
    "method": "axxonsoft.bl.config.ConfigurationService.ChangeConfig",
    "data": {
        "changed": [
            {
                "uid": "hosts/Server1/DeviceIpint.199/VideoChannel.0/Streaming.0",
                "type": "Streaming",
                "properties": [
                    {
                        "id": "folder",
                        "value_string": "D:/Video"
                    }
                ],
                "opaque_params": []
            }
        ]
    }
}

Включение/выключение объекта

Каждый unit содержит свойство enabled.

Включение микрофона:

{
    "method":"axxonsoft.bl.config.ConfigurationService.ChangeConfig",
    "data":{
        "changed":[{
              "uid": "hosts/Server1/DeviceIpint.10/Microphone.0",
              "type": "Microphone",
              "properties": [ {
                  "id": "enabled",
                  "value_bool": true
                } ],
               "units":[]
        }]
    }
}

Удаление устройства

{
    "method": "axxonsoft.bl.config.ConfigurationService.ChangeConfig",
    "data": {
        "removed": [
            {
                "uid": "hosts/Server1/DeviceIpint.199"
            }
        ]
    }
}
  • No labels