Skip to main content
Skip table of contents

Регистрация воркера

Регистрация воркера

Метод для регистрации воркера.

JSON
{
    "worker_name": "worker-nsm4kiea",
    "host_ip": "192.168.17.78",
    "available_cases": [
        "licplate-recognition",
        "face-recognition",
        "camera-obstacle",
        "smoke-fire",
        "loud-sounds",
        "motion-detect",
        "person-counting",
        "visitors-counting",
        "line-intersection"
    ],
    "regions": [
        "minsk"
    ]
}

POST /api/worker_registration/?format=json

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

array available_cases REQUIRED, массив идентификаторов кейсов аналитики.


array regions REQUIRED, массив зон(regions).


string host_ip REQUIRED, IP хоста воркера.


string worker_name REQUIRED, наименование воркера.

200 OK

Возвращает JSON объект с идентификатором созданного задания

cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/worker_registration/?format=json' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "available_cases": [],
    "regions": [],
    "host_ip": "string",
    "worker_name": "string"
}'
PHP
PHP
$data = array (
  'available_cases' => 
  array (
  ),
  'regions' => 
  array (
  ),
  'host_ip' => 'string',
  'worker_name' => 'string',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/worker_registration/?format=json', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.