Skip to main content
Skip table of contents

Обновление камеры c установленным Agent

Метод и параметры

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

Необходимый уровень разрешения (Permission) camera-agents.

PATCH /api/admin/v1/camera-agents/{cameraAgent}

Параметры:

int cameraAgent – уникальный идентификатор устройства.

string name – название устройства.

bool is_local_archive_enabled – включение/выключение локального архива.

bool is_cloud_archive_enabled – включение/выключение облачного архива.

int cloud_archive_storage_days –  количество дней хранения облачного архива.

Пример:

JSON
{
    "name": "name-updated",
    "is_local_archive_enabled": false,
    "is_cloud_archive_enabled": false,
    "cloud_archive_storage_days": 80
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/admin/v1/camera-agents/{cameraAgent}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "cameraAgent": 0,
    "name": "string",
    "is_local_archive_enabled": true,
    "is_cloud_archive_enabled": true,
    "cloud_archive_storage_days": 0
}'
PHP
PHP
$data = array (
  'cameraAgent' => 0,
  'name' => 'string',
  'is_local_archive_enabled' => true,
  'is_cloud_archive_enabled' => true,
  'cloud_archive_storage_days' => 0,
);
$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-agents/{cameraAgent}', false, $context);

Ответы на запрос

Детальный перечень кодов возможных ответов смотрите в разделе «Общее описание API».

  • Успешный ответ:

Успешный ответ

200 OK

Возвращает объект устройства

JSON
{
    "id": 1,
    "name": "name-updated",
    "uuid": "bfa7581e-8111-4602-b40b-6e690a999580",
    "mac": "mac1",
    "serial_number": "serial1",
    "status": "activated",
    "is_online": false,
    "version": "3.4",
    "created_at": "2024-06-04T12:36:42.000000Z",
    "updated_at": "2024-06-04T12:40:43.000000Z",
    "last_updated_at": null,
    "storages": [
        {
            "id": 1,
            "path": "/storage",
            "usage": 33.333,
            "capacity": 0.03
        }
    ],
    "camera": {
        "id": 1,
        "group_id": 1,
        "status": "active",
        "type": "mediaagent",
        "start_at": null,
        "created_at": "2024-06-04T12:36:42.000000Z",
        "name": "name-1-updated",
        "streams": [
            {
                "id": 1,
                "type": "high",
                "camera_id": 1,
                "status": null,
                "url": "rtsp://admin:pass@server.local:554/Streaming/Channels/101",
                "bitrate": null,
                "resolution": null,
                "output_rate": null,
                "ip": "192.168.7.20",
                "uuid": "98fdc101-a1e7-4751-b439-d482ac083b4b",
                "streams_count": null,
                "created_at": "2024-06-04T12:36:42.000000Z",
                "updated_at": "2024-06-04T12:36:42.000000Z",
                "is_preview_from_server": true,
                "is_archive_from_server": null,
                "is_enabled": true,
                "is_can_transfer": true,
                "source": "manual",
                "is_sound_enabled": null,
                "reconnect_attempt": null,
                "reconnect_total": null,
                "reconnect_time": null,
                "disconnections_count": 0,
                "is_actual": true,
                "condition": "active",
                "stopped_at": "",
                "video_codec": null,
                "audio_codec": null
            },
            {
                "id": 2,
                "type": "low",
                "camera_id": 1,
                "status": null,
                "url": "rtsp://admin:pass@server.local:554/Streaming/Channels/102",
                "bitrate": null,
                "resolution": null,
                "output_rate": null,
                "ip": "192.168.7.20",
                "uuid": "632b4b95-1641-4061-8bf6-32311b7f263d",
                "streams_count": null,
                "created_at": "2024-06-04T12:36:42.000000Z",
                "updated_at": "2024-06-04T12:36:42.000000Z",
                "is_preview_from_server": true,
                "is_archive_from_server": null,
                "is_enabled": true,
                "is_can_transfer": true,
                "source": "manual",
                "is_sound_enabled": null,
                "reconnect_attempt": null,
                "reconnect_total": null,
                "reconnect_time": null,
                "disconnections_count": 0,
                "is_actual": true,
                "condition": "active",
                "stopped_at": "",
                "video_codec": null,
                "audio_codec": null
            }
        ],
        "can_edit": true,
        "origin": null,
        "group_type": "public",
        "ip": "127.0.0.1",
        "lat": null,
        "lng": null,
        "azimuth": null,
        "is_sensitive": false,
        "is_buffer_enabled": false,
        "is_public": 0,
        "is_ip_reserved": false,
        "count_issues": 0,
        "source": "manual",
        "archive_storage_days": 80,
        "is_archive_recording": false,
        "archive_recording_type": "fulltime",
        "is_local_archive_enabled": false,
        "local_archive_storage_days": 30,
        "is_increased_reconnect": 0,
        "is_sound_enabled": true,
        "is_bridge": false,
        "is_agent": true,
        "is_auto_create_streams": false,
        "is_provisioning_enable": false,
        "is_can_manage_streams": true,
        "streams_source": "manual",
        "is_editable": true,
        "status_changed_at": null,
        "is_intercom": false,
        "deleted_at": null,
        "is_need_replace": false
    }
}
  • Ответы с ошибкой:

401 Unauthorized

Токен авторизации не передан или недействителен.

422 Unprocessable Entity

Возвращает JSON объект с ошибкой. Детально о валидации VMS Client/Общая информация/Валидация клиента.

JSON
{
    "message": "Тут не будет информативного сообщения",
    "errors": {
        "any_key": [
            "Тут будет описана причина ошибки"
        ]
    }
}
JavaScript errors detected

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

If this problem persists, please contact our support.