Skip to main content
Skip table of contents

Удалить отрезок DVR: Stream.Dvr.Delete

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

Метод позволяет удалить отрезок DVR.

string Stream.Dvr.Delete( CamerasObject cameras )

StreamsObject cameras REQUIRED – задает параметры потока для камеры.

object StreamsObject

number cameras.camerasUid.streamUid.from = 10 – время, с которого нужно удалить DVR, в формате Unixtime. 0 – значит с самого начала.


number cameras.camerasUid.streamUid.to = 10 – время по которое нужно удалить DVR, в формате Unixtime. 0 – значит до самого конца.


CamerasObject camerasUid REQUIRED – уникальный идентификатор камеры в рамках всей инсталляции.


StreamsObject streamUid REQUIRED – уникальный идентификатор потока в рамках камеры.


POST /api/

JSON-RPC
JSON
{
    "jsonrpc": "2.0",
    "method": "Stream.Dvr.Delete",
    "params": {
        "cameras": {
            "camerasUid": {
                "streamUid": {
                    "from": 10,
                    "to": 10
                }
            }
        }
    },
    "id": 1
}
cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/' \
	--header 'Content-Length: 278' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--header 'Authorization: Bearer <api-authorization-token>' \
	--header 'Content-Length: <Длина данных>' \
	--data '{
    "jsonrpc": "2.0",
    "method": "Stream.Dvr.Delete",
    "params": {
        "cameras": {
            "camerasUid": {
                "streamUid": {
                    "from": 10,
                    "to": 10
                }
            }
        }
    },
    "id": 1
}'
PHP
PHP
$data = array (
  'jsonrpc' => '2.0',
  'method' => 'Stream.Dvr.Delete',
  'params' => 
  array (
    'cameras' => 
    array (
      'camerasUid' => 
      array (
        'streamUid' => 
        array (
          'from' => 10,
          'to' => 10,
        ),
      ),
    ),
  ),
  'id' => 1,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json\r
Authorization: Bearer <api-authorization-token>\r
Content-Length: <Длина данных>",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/', false, $context);

400 Bad Request

Ошибка json-rpc

JSON
{
    "error": {
        "code": -32601,
        "message": "Method not found"
    }
}

500 Internal Server Error

Ошибка сервера

JavaScript errors detected

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

If this problem persists, please contact our support.