Skip to main content
Skip table of contents

Обновление камеры

Обновление камеры

Актуальный метод по обновлению камеры Частичное обновление камеры

PATCH /api/admin/v1/camera/{camera}

Параметры метода

int camera, уникальный идентификатор камеры


string name, имя камеры


boolean is_sensitive, ограничение доступа к камере


boolean is_sound_enabled, включение звука на камере


boolean is_public, будет ли камера доступна извне


array subnets, подсети, из которых будет доступ к камере (доступно только при is_public:true)

object array

array subnets. REQUIRED, .mask маска подсети


array subnets. REQUIRED, .mask маска подсети


boolean is_increased_reconnect, увеличенное время переподключения. В случае, если включено, то увеличится время переопроса камеры медиасервером


integer pack, группа медиасерверов, которая будет использоваться при заведении потоков Список групп медиасерверов


array attached_services, сервисы, которые будут использоваться на камере


array tags, список тегов


array csas, массив кодов csa, состоящий из 1 элемента (необходимо присылать при использовании дерева csa Формат дерева

object array

integer csas. REQUIRED, код дома csa Дома


integer group_id, группа, в которой создается камера (необходимо присылать при использовании дерева custom Формат дерева


integer archive_storage_days, время хранения архива


string archive_recording_type, тип записи архива


array archive_recording_timetable, время работы записи архива (обязательно только в случае типа записи archive_recording_type:fulltime)

object array

array archive_recording_timetable.days, расписание работы записи архива


string archive_recording_timetable.days. REQUIRED, .to окончание работы записи архива


string archive_recording_timetable.days. REQUIRED, .to окончание работы записи архива


string archive_recording_timetable.days. REQUIRED, .to окончание работы записи архива


numeric lat, долгота (используется для расположения камеры на карте)


numeric lng, широта (используется для расположения камеры на карте)


numeric azimuth, азимут (используется для расположения камеры на карте)

200 OK

Возвращает объект камеры

JSON
{
    "id": 1031,
    "group_id": 207,
    "status": "active",
    "type": "media_server_v2",
    "pretty_text": ", , г. Город, ул. Улица 1",
    "short_pretty": "г. Город, ул. Улица 1",
    "start_at": "2022-07-25 12:49:47",
    "created_at": "2022-07-25 11:49:39",
    "name": "BILLING_TEST22",
    "streams": [
        {
            "id": 1061,
            "type": "high",
            "camera_id": 1031,
            "status": "active",
            "url": "rtsp://admin:456redko@192.168.204.241/Streaming/Channels/101?transportmode=unicast&profile=Profile_1",
            "bitrate": 1333,
            "resolution": "2560x1440",
            "output_rate": 0,
            "ip": "192.168.204.241",
            "uuid": "68110ede-1e2b-4c1d-86b3-c24e2418e1d0",
            "sound": "tracks-v1",
            "streams_count": 0,
            "is_can_transfer": true,
            "server": {
                "id": 5,
                "type": "media_server_v2",
                "schema": "https",
                "domain": "labMS7.vms.local",
                "internal": "8080",
                "external": "8443",
                "m4f": "8443",
                "rtsp": "5554",
                "publish": "555",
                "traffic_in": 22206,
                "traffic_out": 1043,
                "status": 1,
                "is_enabled": 1,
                "is_main": 0,
                "has_cache": 0,
                "proxy": ".vms.local",
                "created_at": "2021-05-27 16:16:26",
                "updated_at": "2022-08-01 10:45:02",
                "group_type": "all",
                "can_delete": false,
                "streams_limit": 6000,
                "bitrate_limit": 600000,
                "extra": {
                    "io": {
                        "read_rate": 0,
                        "read_bytes": 0,
                        "write_rate": 0,
                        "write_bytes": 0
                    },
                    "cpu": {
                        "total": 14,
                        "usage": 16,
                        "stime_sec": 133883,
                        "utime_sec": 133883
                    },
                    "mem": {
                        "rss": 1045831680,
                        "share": 7942144,
                        "usage": 4347138048
                    },
                    "net": {
                        "in_bitrate": 22739096,
                        "out_bitrate": 1067632
                    },
                    "drives": {
                        "/": {
                            "fs": "ext4",
                            "mount": "/",
                            "inode_free": 1438731,
                            "inode_total": 1605632,
                            "capacity_free": 1658454016,
                            "capacity_total": 25759584256
                        },
                        "/boot": {
                            "fs": "ext4",
                            "mount": "/boot",
                            "inode_free": 65216,
                            "inode_total": 65536,
                            "capacity_free": 703193088,
                            "capacity_total": 1023303680
                        },
                        "/storage": {
                            "fs": "ext4",
                            "mount": "/storage",
                            "inode_free": 32750347,
                            "inode_total": 32768000,
                            "capacity_free": 65519431680,
                            "capacity_total": 527371075584
                        }
                    },
                    "server": {
                        "ip4": "192.168.200.19",
                        "name": "MS-21.03-lts",
                        "build": "44ce34f",
                        "uptime": 3964557,
                        "startat": 1655375345,
                        "version": "21.03",
                        "hostname": "labMS7.vms.local",
                        "revision": "lts",
                        "timestamp": "20220616091725"
                    },
                    "cluster": {
                        "id": "3",
                        "node": "7",
                        "enable": "true",
                        "hostname": "labMS7.vms.local"
                    },
                    "license": {
                        "own": "Vms",
                        "type": "enterprise",
                        "issued": 1690875902
                    },
                    "streams": {
                        "total": 42,
                        "active": 15,
                        "clients": 1
                    },
                    "storages": {
                        "/storage": {
                            "fs": "",
                            "err": 0,
                            "name": "default",
                            "mount": "/storage",
                            "inode_free": 32750347,
                            "inode_total": 32768000,
                            "capacity_free": 65519431680,
                            "capacity_total": 527371075584
                        }
                    }
                }
            },
            "sub_servers": [
                {
                    "id": 6,
                    "type": "media_server_v2",
                    "schema": "https",
                    "domain": "labMS8.vms.local",
                    "internal": "8080",
                    "external": "8443",
                    "m4f": "8443",
                    "rtsp": "5554",
                    "publish": "555",
                    "traffic_in": 21374,
                    "traffic_out": 0,
                    "status": 1,
                    "is_enabled": 1,
                    "is_main": 0,
                    "has_cache": 0,
                    "proxy": ".vms.local",
                    "created_at": "2021-05-27 16:17:06",
                    "updated_at": "2022-08-01 10:45:02",
                    "group_type": "all",
                    "can_delete": false,
                    "streams_limit": 6000,
                    "bitrate_limit": 600000,
                    "extra": {
                        "io": {
                            "read_rate": 0,
                            "read_bytes": 0,
                            "write_rate": 0,
                            "write_bytes": 0
                        },
                        "cpu": {
                            "total": 12,
                            "usage": 14,
                            "stime_sec": 139710,
                            "utime_sec": 139710
                        },
                        "mem": {
                            "rss": 952643584,
                            "share": 10690560,
                            "usage": 3000676352
                        },
                        "net": {
                            "in_bitrate": 21886792,
                            "out_bitrate": 0
                        },
                        "drives": {
                            "/": {
                                "fs": "ext4",
                                "mount": "/",
                                "inode_free": 1436324,
                                "inode_total": 1605632,
                                "capacity_free": 17834098688,
                                "capacity_total": 25759584256
                            },
                            "/boot": {
                                "fs": "ext4",
                                "mount": "/boot",
                                "inode_free": 65216,
                                "inode_total": 65536,
                                "capacity_free": 703197184,
                                "capacity_total": 1023303680
                            },
                            "/storage": {
                                "fs": "ext4",
                                "mount": "/storage",
                                "inode_free": 32734809,
                                "inode_total": 32768000,
                                "capacity_free": 34241556480,
                                "capacity_total": 527371075584
                            }
                        },
                        "server": {
                            "ip4": "192.168.200.20",
                            "name": "MS-21.03-lts",
                            "build": "44ce34f",
                            "uptime": 3718144,
                            "startat": 1655621758,
                            "version": "21.03",
                            "hostname": "labMS8.vms.local",
                            "revision": "lts",
                            "timestamp": "20220616091725"
                        },
                        "cluster": {
                            "id": "3",
                            "node": "8",
                            "enable": "true",
                            "hostname": "labMS8.vms.local"
                        },
                        "license": {
                            "own": "Vms",
                            "type": "enterprise",
                            "issued": 1690875902
                        },
                        "streams": {
                            "total": 43,
                            "active": 11,
                            "clients": 0
                        },
                        "storages": {
                            "/storage": {
                                "fs": "",
                                "err": 0,
                                "name": "default",
                                "mount": "/storage",
                                "inode_free": 32734809,
                                "inode_total": 32768000,
                                "capacity_free": 34241556480,
                                "capacity_total": 527371075584
                            }
                        }
                    }
                }
            ],
            "transfer_servers": [],
            "transfer_sub_servers": [],
            "created_at": "2022-07-25 12:49:12",
            "updated_at": "2022-08-01 10:45:07",
            "is_preview_from_server": true,
            "is_archive_from_server": null,
            "is_enabled": true,
            "source": "auto",
            "is_sound_enabled": false,
            "reconnect_attempt": 0,
            "reconnect_total": 2,
            "reconnect_time": null,
            "disconnections_count": 0,
            "is_actual": false
        },
        {
            "id": 1062,
            "type": "low",
            "camera_id": 1031,
            "status": "active",
            "url": "rtsp://admin:456redko@192.168.204.241/Streaming/Channels/102?transportmode=unicast&profile=Profile_2",
            "bitrate": 42,
            "resolution": "640x360",
            "output_rate": 0,
            "ip": "192.168.204.241",
            "uuid": "0a0694a9-c669-4675-952f-9270b970b5cb",
            "sound": "tracks-v1",
            "streams_count": 0,
            "is_can_transfer": true,
            "server": {
                "id": 5,
                "type": "media_server_v2",
                "schema": "https",
                "domain": "labMS7.vms.local",
                "internal": "8080",
                "external": "8443",
                "m4f": "8443",
                "rtsp": "5554",
                "publish": "555",
                "traffic_in": 22206,
                "traffic_out": 1043,
                "status": 1,
                "is_enabled": 1,
                "is_main": 0,
                "has_cache": 0,
                "proxy": ".vms.local",
                "created_at": "2021-05-27 16:16:26",
                "updated_at": "2022-08-01 10:45:02",
                "group_type": "all",
                "can_delete": false,
                "streams_limit": 6000,
                "bitrate_limit": 600000,
                "extra": {
                    "io": {
                        "read_rate": 0,
                        "read_bytes": 0,
                        "write_rate": 0,
                        "write_bytes": 0
                    },
                    "cpu": {
                        "total": 14,
                        "usage": 16,
                        "stime_sec": 133883,
                        "utime_sec": 133883
                    },
                    "mem": {
                        "rss": 1045831680,
                        "share": 7942144,
                        "usage": 4347138048
                    },
                    "net": {
                        "in_bitrate": 22739096,
                        "out_bitrate": 1067632
                    },
                    "drives": {
                        "/": {
                            "fs": "ext4",
                            "mount": "/",
                            "inode_free": 1438731,
                            "inode_total": 1605632,
                            "capacity_free": 1658454016,
                            "capacity_total": 25759584256
                        },
                        "/boot": {
                            "fs": "ext4",
                            "mount": "/boot",
                            "inode_free": 65216,
                            "inode_total": 65536,
                            "capacity_free": 703193088,
                            "capacity_total": 1023303680
                        },
                        "/storage": {
                            "fs": "ext4",
                            "mount": "/storage",
                            "inode_free": 32750347,
                            "inode_total": 32768000,
                            "capacity_free": 65519431680,
                            "capacity_total": 527371075584
                        }
                    },
                    "server": {
                        "ip4": "192.168.200.19",
                        "name": "MS-21.03-lts",
                        "build": "44ce34f",
                        "uptime": 3964557,
                        "startat": 1655375345,
                        "version": "21.03",
                        "hostname": "labMS7.vms.local",
                        "revision": "lts",
                        "timestamp": "20220616091725"
                    },
                    "cluster": {
                        "id": "3",
                        "node": "7",
                        "enable": "true",
                        "hostname": "labMS7.vms.local"
                    },
                    "license": {
                        "own": "Vms",
                        "type": "enterprise",
                        "issued": 1690875902
                    },
                    "streams": {
                        "total": 42,
                        "active": 15,
                        "clients": 1
                    },
                    "storages": {
                        "/storage": {
                            "fs": "",
                            "err": 0,
                            "name": "default",
                            "mount": "/storage",
                            "inode_free": 32750347,
                            "inode_total": 32768000,
                            "capacity_free": 65519431680,
                            "capacity_total": 527371075584
                        }
                    }
                }
            },
            "sub_servers": [
                {
                    "id": 6,
                    "type": "media_server_v2",
                    "schema": "https",
                    "domain": "labMS8.vms.local",
                    "internal": "8080",
                    "external": "8443",
                    "m4f": "8443",
                    "rtsp": "5554",
                    "publish": "555",
                    "traffic_in": 21374,
                    "traffic_out": 0,
                    "status": 1,
                    "is_enabled": 1,
                    "is_main": 0,
                    "has_cache": 0,
                    "proxy": ".vms.local",
                    "created_at": "2021-05-27 16:17:06",
                    "updated_at": "2022-08-01 10:45:02",
                    "group_type": "all",
                    "can_delete": false,
                    "streams_limit": 6000,
                    "bitrate_limit": 600000,
                    "extra": {
                        "io": {
                            "read_rate": 0,
                            "read_bytes": 0,
                            "write_rate": 0,
                            "write_bytes": 0
                        },
                        "cpu": {
                            "total": 12,
                            "usage": 14,
                            "stime_sec": 139710,
                            "utime_sec": 139710
                        },
                        "mem": {
                            "rss": 952643584,
                            "share": 10690560,
                            "usage": 3000676352
                        },
                        "net": {
                            "in_bitrate": 21886792,
                            "out_bitrate": 0
                        },
                        "drives": {
                            "/": {
                                "fs": "ext4",
                                "mount": "/",
                                "inode_free": 1436324,
                                "inode_total": 1605632,
                                "capacity_free": 17834098688,
                                "capacity_total": 25759584256
                            },
                            "/boot": {
                                "fs": "ext4",
                                "mount": "/boot",
                                "inode_free": 65216,
                                "inode_total": 65536,
                                "capacity_free": 703197184,
                                "capacity_total": 1023303680
                            },
                            "/storage": {
                                "fs": "ext4",
                                "mount": "/storage",
                                "inode_free": 32734809,
                                "inode_total": 32768000,
                                "capacity_free": 34241556480,
                                "capacity_total": 527371075584
                            }
                        },
                        "server": {
                            "ip4": "192.168.200.20",
                            "name": "MS-21.03-lts",
                            "build": "44ce34f",
                            "uptime": 3718144,
                            "startat": 1655621758,
                            "version": "21.03",
                            "hostname": "labMS8.vms.local",
                            "revision": "lts",
                            "timestamp": "20220616091725"
                        },
                        "cluster": {
                            "id": "3",
                            "node": "8",
                            "enable": "true",
                            "hostname": "labMS8.vms.local"
                        },
                        "license": {
                            "own": "Vms",
                            "type": "enterprise",
                            "issued": 1690875902
                        },
                        "streams": {
                            "total": 43,
                            "active": 11,
                            "clients": 0
                        },
                        "storages": {
                            "/storage": {
                                "fs": "",
                                "err": 0,
                                "name": "default",
                                "mount": "/storage",
                                "inode_free": 32734809,
                                "inode_total": 32768000,
                                "capacity_free": 34241556480,
                                "capacity_total": 527371075584
                            }
                        }
                    }
                }
            ],
            "transfer_servers": [],
            "transfer_sub_servers": [],
            "created_at": "2022-07-25 12:49:13",
            "updated_at": "2022-08-01 10:45:08",
            "is_preview_from_server": true,
            "is_archive_from_server": null,
            "is_enabled": true,
            "source": "auto",
            "is_sound_enabled": false,
            "reconnect_attempt": 0,
            "reconnect_total": 2,
            "reconnect_time": null,
            "disconnections_count": 0,
            "is_actual": false
        }
    ],
    "attached_services": [],
    "services": {
        "ptz": false,
        "motion_detect": false
    },
    "csas": [
        {
            "id": 24,
            "csa": 1746706,
            "pretty_text": ", , г. Город, ул. Улица 1",
            "short_pretty": "г. Город, ул. Улица 1",
            "created_at": "2022-04-21 13:01:47",
            "updated_at": "2022-04-21 13:01:47"
        }
    ],
    "can_edit": true,
    "origin": null,
    "group_type": "public",
    "shared_from": null,
    "ip": "192.168.204.241",
    "lat": null,
    "lng": null,
    "azimuth": null,
    "is_sensitive": 0,
    "is_public": 0,
    "issues": [],
    "archive_ranges": [
        {
            "end": 1658742597,
            "from": 1658742587,
            "duration": 10
        },
        {
            "end": 1658743079,
            "from": 1658742614,
            "duration": 465
        },
        {
            "end": 1659066173,
            "from": 1658743159,
            "duration": 323014
        },
        {
            "end": 1659312321,
            "from": 1659066253,
            "duration": 246068
        },
        {
            "end": 1659339609,
            "from": 1659312365,
            "duration": 27244
        }
    ],
    "archive_recording_timetable": null,
    "motion_detaction_timetable": [],
    "onvif_configuration": {
        "credentials": {
            "login": "admin",
            "password": "456redko"
        }
    },
    "streams_rtsp": {
        "high": "rtsp://admin:456redko@192.168.204.241/Streaming/Channels/101?transportmode=unicast&profile=Profile_1"
    },
    "is_ip_reserved": true,
    "count_issues": 0,
    "pack": {
        "id": 3,
        "name": "Группа 3",
        "parent_id": null,
        "created_at": "2021-05-27 17:15:36",
        "updated_at": "2022-05-30 13:55:43"
    },
    "source": "auto",
    "archive_storage_days": 30,
    "is_archive_recording": true,
    "archive_recording_type": "fulltime",
    "is_increased_reconnect": 0,
    "is_sound_enabled": false,
    "subnets": [],
    "model": {
        "id": 292,
        "title": "DS-2CD1043G0-I",
        "vendor": {
            "id": 1,
            "title": "HIKVISION"
        }
    },
    "network_device": {
        "uuid": "0c88affa-ca77-4e55-ba17-266b0d9743fa",
        "ip": "192.168.204.241",
        "serial_number": "DS-2CD1043G0-I",
        "mac": "AC:CB:51:54:99:10",
        "created_at": "2022-07-25 11:49:39"
    },
    "profile": {
        "id": 171,
        "service": "1.3MP",
        "data": {
            "an_key": "any value from billing"
        },
        "created_at": "2022-07-25 11:49:39"
    },
    "is_bridge": false,
    "tags": [
        {
            "id": 2,
            "name": "individual",
            "created_at": "2021-07-15 20:30:25",
            "updated_at": "2021-07-15 20:30:25"
        },
        {
            "id": 7,
            "name": "labMS8.vms.local",
            "created_at": "2021-07-15 20:30:26",
            "updated_at": "2021-07-15 20:30:26"
        },
        {
            "id": 8,
            "name": "labMS7.vms.local",
            "created_at": "2021-07-15 20:30:26",
            "updated_at": "2021-07-15 20:30:26"
        }
    ],
    "is_auto_create_streams": true,
    "is_provisioning_enable": true,
    "is_can_manage_streams": false,
    "streams_source": "auto",
    "can_change_archive_timetable": true,
    "owner": null
}

401 Unauthorized

Токен авторизации не передан или не валидный Получение токена

402 Payment Required

Ошибка лицензии

422 Unprocessable Entity

Возвращает JSON объект с ошибкой. Валидация

JSON
{
    "message": "Тут не будет информативного сообщения",
    "errors": {
        "any_key": [
            "Тут будет описана причина ошибки"
        ]
    }
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/admin/v1/camera/{camera}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "camera": 0,
    "name": "string",
    "is_sensitive": "boolean",
    "is_sound_enabled": "boolean",
    "is_public": "boolean",
    "subnets": {
        "": []
    },
    "subnets.": "void",
    "is_increased_reconnect": "boolean",
    "pack": "integer",
    "attached_services": [],
    "tags": [],
    "csas": {
        "": "integer"
    },
    "csas.": "void",
    "group_id": "integer",
    "archive_storage_days": "integer",
    "archive_recording_type": "string",
    "archive_recording_timetable": {
        "days": {
            "": "string"
        }
    },
    "archive_recording_timetable.days": "void",
    "archive_recording_timetable.days.": "void",
    "lat": "numeric",
    "lng": "numeric",
    "azimuth": "numeric"
}'
PHP
PHP
$data = array (
  'camera' => 0,
  'name' => 'string',
  'is_sensitive' => 'boolean',
  'is_sound_enabled' => 'boolean',
  'is_public' => 'boolean',
  'subnets' => 
  array (
    '' => 
    array (
    ),
  ),
  'subnets.' => 'void',
  'is_increased_reconnect' => 'boolean',
  'pack' => 'integer',
  'attached_services' => 
  array (
  ),
  'tags' => 
  array (
  ),
  'csas' => 
  array (
    '' => 'integer',
  ),
  'csas.' => 'void',
  'group_id' => 'integer',
  'archive_storage_days' => 'integer',
  'archive_recording_type' => 'string',
  'archive_recording_timetable' => 
  array (
    'days' => 
    array (
      '' => 'string',
    ),
  ),
  'archive_recording_timetable.days' => 'void',
  'archive_recording_timetable.days.' => 'void',
  'lat' => 'numeric',
  'lng' => 'numeric',
  'azimuth' => 'numeric',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'PATCH',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/admin/v1/camera/{camera}', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.