Skip to main content
Skip table of contents

Статистика. VMS Admin API

Статистика

GET api/admin/v1/cameras/statistic

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

int per_page, количество элементов в одной странице пагинации. По умолчанию 25 штук


string reached_limit, все сервера, у которых превышен хотя бы один из лимитов


string search, поиск по домену сервера и по имени кластера


string sort, поле, по которому происходит сортировка (по умолчанию total_bitrate)


string dir, направление сортировки (по умолчанию desc)

200 OK

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

JSON
{
    "data": [
        {
            "id": 12,
            "domain": "host-name-1.vms.local",
            "streams_limit": 3000,
            "bitrate_limit": 4700000,
            "streams_count": 3000,
            "traffic_in": "4116443",
            "traffic_out": 75048,
            "is_limit_reached": true,
            "cluster": {
                "id": 14,
                "name": "Cluster 1",
                "type": "main_secondary",
                "internal": 444,
                "external": 443,
                "rtsp": 4554,
                "streams_limit": 3200,
                "bitrate_limit": 4700000,
                "created_at": "2022-11-28 18:36:09",
                "updated_at": "2023-02-22 13:59:18"
            }
        },
        {
            "id": 9,
            "domain": "host-name-2.vms.local",
            "streams_limit": 3250,
            "bitrate_limit": 4700000,
            "streams_count": 3250,
            "traffic_in": "4032173",
            "traffic_out": 82962,
            "is_limit_reached": true,
            "cluster": {
                "id": 10,
                "name": "Cluster 3",
                "type": "main_secondary",
                "internal": 444,
                "external": 443,
                "rtsp": 4554,
                "streams_limit": 3050,
                "bitrate_limit": 3900000,
                "created_at": "2022-11-03 16:04:52",
                "updated_at": "2023-02-16 02:11:30"
            }
        },
        {
            "id": 7,
            "domain": "host-name-3.vms.local",
            "streams_limit": 3250,
            "bitrate_limit": 4700000,
            "streams_count": 3242,
            "traffic_in": "3996781",
            "traffic_out": 60981,
            "is_limit_reached": false,
            "cluster": {
                "id": 10,
                "name": "Cluster 3",
                "type": "main_secondary",
                "internal": 444,
                "external": 443,
                "rtsp": 4554,
                "streams_limit": 3050,
                "bitrate_limit": 3900000,
                "created_at": "2022-11-03 16:04:52",
                "updated_at": "2023-02-16 02:11:30"
            }
        },
        {
            "id": 5,
            "domain": "host-name-4.vms.local",
            "streams_limit": 3600,
            "bitrate_limit": 4110000,
            "streams_count": 3600,
            "traffic_in": "3946951",
            "traffic_out": 114060,
            "is_limit_reached": true,
            "cluster": {
                "id": 93,
                "name": "Cluster 4",
                "type": "main_secondary",
                "internal": 444,
                "external": 443,
                "rtsp": 4554,
                "streams_limit": 2100,
                "bitrate_limit": 3200000,
                "created_at": "2021-09-14 15:14:58",
                "updated_at": "2023-02-16 02:11:30"
            }
        }
    ],
    "links": {
        "first": "https://vms.local/api/admin/v1/cameras/statistic?per_page=50&page=1",
        "last": "https://vms.local/api/admin/v1/cameras/statistic?per_page=50&page=4",
        "prev": null,
        "next": "https://vms.local/api/admin/v1/cameras/statistic?per_page=50&page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 4,
        "links": [
            {
                "url": null,
                "label": "pagination.previous",
                "active": false
            },
            {
                "url": "https://vms.local/api/admin/v1/cameras/statistic?per_page=50&page=1",
                "label": "1",
                "active": true
            },
            {
                "url": "https://vms.local/api/admin/v1/cameras/statistic?per_page=50&page=2",
                "label": "2",
                "active": false
            },
            {
                "url": "https://vms.local/api/admin/v1/cameras/statistic?per_page=50&page=3",
                "label": "3",
                "active": false
            },
            {
                "url": "https://vms.local/api/admin/v1/cameras/statistic?per_page=50&page=4",
                "label": "4",
                "active": false
            },
            {
                "url": "https://vms.local/api/admin/v1/cameras/statistic?per_page=50&page=2",
                "label": "pagination.next",
                "active": false
            }
        ],
        "path": "https://vms.local/api/admin/v1/cameras/statistic",
        "per_page": 50,
        "to": 50,
        "total": 161
    }
}

401 Unauthorized

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

cURL
BASH
curl -k --request POST \
	--url 'https://your-domainapi/admin/v1/cameras/statistic' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "per_page": 0,
    "reached_limit": "string",
    "search": "string",
    "sort": "string",
    "dir": "string"
}'
PHP
PHP
$data = array (
  'per_page' => 0,
  'reached_limit' => 'string',
  'search' => 'string',
  'sort' => 'string',
  'dir' => 'string',
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'GET',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domainapi/admin/v1/cameras/statistic', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.