Breadcrumbs

Delete DVR: Server.Vacuum

The method and parameters

Метод Server.Vacuum запускает принудительное удаление записей архивов необслуживаемых потоков.

The Server.Vacuum method initiates forced deletion of archive records for unmanaged streams.

string Server.Vacuum(array uids)

array uids required – the list of UIDs of DVR streams to be deleted.

POST  /api/

JSON-RPC
JSON
{
    "jsonrpc": "2.0",
    "method": "Server.Vacuum",
    "params": [
        "uids"
    ],
    "id": 1
}
cURL
Bash
curl -k --request POST \
	--url 'https://your-domain/api/' \
	--header 'Content-Length: 106' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--header 'Authorization: Bearer <api-authorization-token>' \
	--header 'Content-Length: <data length>' \
	--data '{
    "jsonrpc": "2.0",
    "method": "Server.Vacuum",
    "params": [
        "uids"
    ],
    "id": 1
}'
PHP
PHP
$data = array (
  'jsonrpc' => '2.0',
  'method' => 'Server.Vacuum',
  'params' => 
  array (
    0 => 'uids',
  ),
  '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: <data length>",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/', false, $context);

200  OK

bool – the operation execution result.

JSON
true

400  Bad Request

The JSON-RPC error

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

500  Internal Server Error

The server error