Skip to main content
Skip table of contents

Типы вебсокет пушей

Типы вебсокет пушей

Список всех пушей, которые есть в api клиента администратора.

Пуш об изменении пермишенов администратора. Канал user.ID. Event - App\Events\UserPush

CODE
{
    "data":{
        "type": "permissions_updated",
        "status": "ok",
        "data": {
            "detached": [1,2],
            "attached": [4,6]
        }
    },
    "subject": null,
    "message": null
}

Пуш об изменении доступных рутовых элементов дерева камера. Канал user.ID. Event - App\Events\UserPush
{
    "data":{
        "type": "admin_camera_groups_updated",
        "status": "ok",
        "data": {
            "detached": [1,2],
            "attached": [4,6]
        }
    },
    "subject": null,
    "message": null
}
    
Пуш об изменении доступных рутовых элементов дерева домофонов. Канал user.ID. Event - App\Events\UserPush
{
    "data":{
        "type": "admin_intercom_groups_updated",
        "status": "ok",
        "data": {
            "detached": [1,2],
            "attached": [4,6]
        }
    },
    "subject": null,
    "message": null
}

Пуш об изменении доступных dhcp групп. Канал user.ID. Event - App\Events\UserPush
{
    "data":{
        "type": "dhcp_subnet_groups_updated",
        "status": "ok",
        "data": {
            "detached": [1,2],
            "attached": [4,6]
        }
    },
    "subject": null,
    "message": null
}

При генерации архива. Если статус будет error, то url будет null. Канал token.ID. Event - App\Events\TokenPush
{
    "data":{
        "type": "archive_generated",
        "status": "ok|error",
        "data": {
            "download": {
                "id": 186,
                "name": "г. Город, ул. Улица 1, file.mp4",
                "type": "mp4",
                "url": "http://127.0.0.1:8080/storage/",
                "from": "2019-09-24 13:08:03",
                "to": "2019-09-24 13:08:47",
                "created_at": "2019-09-24T14:34:37.000000Z",
                "updated_at": "2023-02-10T15:09:25.000000Z",
                "is_file_exists": true,
                "user_id": 1
            }
        }
    },
    "subject": null,
    "subject": null
}

При генерации выгрузки по конфигурациям шаблонов камер. Если статус будет error, то data будет пустой. Канал user.ID. Event - App\Events\UserPush
{
    "data":{
        "type": "export_config",
        "status": "ok",
        "data": {
            "url": "https://localhost/file.mp4"
        }
    },
    "subject": null,
    "subject": null
}

После загрузки шаблонов камер из файла, придёт результат о выполнении асинхронной задачи. Event - App\Events\UserPush
{
    "data":{
        "type": "import_config",
        "message": "Тут будет какое-то сообщение",
        "status": "ok|error",
        "data": []
    },
    "subject": null,
    "subject": null
}

При генерации отчёта. Если статус будет error, то data будет пустой. Канал user.ID. Event - App\Events\UserPush
{
    "data":{
        "type": "generate_report",
        "status": "ok",
        "data": {
            "report": {
                "name" : "г. Город, ул. Улица 1, file.mp4",
                "type" : "mp4",
                "url" : "http://127.0.0.1:8080/storage/",
                "created_at" : "2019-09-24T13:54:44.000000Z"
            }
        }
    },
    "subject": null,
    "subject": null
}

Пуши о применении конфигурации на камеру. Канал user.ID. Event - App\Events\UserPush
{
    "data":{
        "type": "camera_config_apply",
        "status": "ok|error",
        "data": {
            "camera": {
                "id": 429,
                "group_id": 556,
                "status": "active",
                "type": "media_server_v2",
                "start_at": "2022-12-31 18:42:54",
                "created_at": "2022-02-22 22:37:16",
                "billing_id": null,
                "pretty_name": "Адрес",
                "pretty_text": "Адрес",
                "short_address": "Адрес",
                "full_address": "Адрес",
                "lat": null,
                "lng": null,
                "azimuth": null,
                "is_archive_recording": true,
                "archive_recording_type": "fulltime",
                "can_change_archive_timetable": true,
                "is_bridge": false,
                "is_favorite": false,
                "user_status": "active",
                "name": "Камера"
            },
            "config_template": 12,
            "reason": "Some text, but can be null"
        }
    },
    "subject": null,
    "subject": null
}

При изменении статуса домофона. Канал admin.intercom-index. Event - App\Events\UserPush
{
    "data":{
        "type": "intercom_status_changed",
        "status": "ok",
        "data": {
            "id": 18,
            "status": "active",
            "status_pretty": "Активный"
        }
    },
    "subject": null,
    "subject": null
}

Пуши, которые могут прийти при загрузке dhcp подсетей через файл. Канал user.ID. Event - App\Events\UserPush
{
    "Пуш об успешной загрузке" : {
        "data":{
            "type": "upload_dhcp_subnets",
            "status": "ok",
            "data": []
        },
        "subject": null,
        "subject": null
    },
    "Пуш об неуспешной загрузке" : {
        "data":{
            "type": "upload_dhcp_subnets",
            "status": "error",
            "data": {
                "message": "Тут будет сообщение"
            }
        },
        "subject": null,
        "subject": null
    },
    "В процессе загрузки может прийти информация о промежуточном результате" : {
        "data":{
            "type": "upload_dhcp_subnets",
            "status": "message",
            "data": {
                "message": "Тут будет сообщение"
            }
        },
        "subject": null,
        "subject": null
    }
}

Пуши о статистике по серверам аналитики. В этом канале могут быть два разных по формату пуша. Канал admin.analytic-servers-index. Event - App\Events\AdminStatPush
{
    "type 1" : {
            "data": {
            "binaryUid": "1d8602f4-82bc-11ed-baa7-53140b40c341",
            "coresUsed": 47,
            "cpuUsageAvg": 28,
            "memUsageRssBytes": 3832954880,
            "memUsageTotalBytes": 14565945344,
            "netBytesInPerSec": 70639264,
            "netBytesOutPerSec": 3217367,
            "streams": {
                "1d71ec24-82bc-11ed-baa7-53140b40c341": {
                    "frameProcessRate": 16.129032,
                    "starttime": 1672376602,
                    "status": "WORKING",
                    "streamUid": "287eb097-69fd-4582-ae4a-3428f1928742",
                    "uptime": 1054636,
                    "camera_id": 109993,
                    "is_can_restart": false
                },
                "streamsCount": 1
            }
        },
        "subject": "binary_stats",
        "message": null
    },
    "type 2": {
        "data": {
            "cpu": {
                "cpu_count": 64,
                "cpu_loadavg_percent_15min": 2.828125,
                "cpu_loadavg_percent_1min": 2.9375,
                "cpu_loadavg_percent_5min": 2.78125
            },
            "ipaddress": "10.0.160.4",
            "memory": {
                "available_memory": 70942662656,
                "total_memory": 99785158656,
                "used_memory": 27567333376,
                "used_percent_memory": 28.9
                }
        },
        "subject": "server_stats",
        "message": null
    }
}

Пуши об изменении статуса камеры. Приходит только для камер Flussonic, outdated функционал. Канал admin.admin. Event - App\Events\AdminPush
{
    "data": {
        "type": "camera_status_updated",
        "status": "ok",
        "data": {
            "camera": {
                "id": 429,
                "group_id": 556,
                "status": "active",
                "type": "media_server_v2",
                "start_at": "2022-12-31 18:42:54",
                "created_at": "2022-02-22 22:37:16",
                "billing_id": null,
                "lat": null,
                "lng": null,
                "azimuth": null,
                "is_archive_recording": true,
                "archive_recording_type": "fulltime",
                "can_change_archive_timetable": true,
                "is_bridge": false,
                "is_favorite": false,
                "user_status": "active",
                "name": "Камера"
            }
        }
    },
    "subject": null,
    "message": null
}

Пуши об изменении переводов. Канал admin.dictionary-update. Event - App\Events\AdminPush
{
    "data": {
        "type": "dictionary_update",
        "status": "ok",
        "data": {
            "diff": {
                "new_key_changes": "new_values_changes"
            }
        }
    },
    "subject": null,
    "message": null
}

Пуш об успешной выгрузке файла ключей домофона. Канал token.ID. Event - App\Events\TokenPush
{
    "data": {
        "type": "export_intercom_keys",
        "status": "ok",
        "data": {
            "path": "https://vms.local/reports/intercoms/intercom_Test_keys_(1970-11-11)_M2qTz6ubQcHA1w6K.xlsx"
        }
    },
    "subject": null,
    "message": null,
    "socket": null
}

Пуш об успешной выгрузке сводного файла ключ|квартира|пользователь домофона. Канал token.ID. Event - App\Events\TokenPush
{
    "data": {
        "type": "export_intercom_keys",
        "status": "ok|error",
        "data": {
            "path": "http://127.0.0.1:8000/storage/reports/intercoms/exports/intercom_1_keys_(1970-1-1)_7OifPT0RuEfUgeel.xlsx"
        }
    },
    "subject": null,
    "message": null,
    "socket": null
}

Пуш об неуспешной выгрузке сводного файла ключ|квартира|пользователь домофона. Канал token.ID. Event - App\Events\TokenPush
{
    "data": {
        "type": "import_intercom_flats_users_keys_failed",
        "status": "ok|error",
        "data": {
            "path": "http://127.0.0.1:8000/storage/reports/intercoms/exports/failures/2023-5-17_Kj6k3TTmxG2uPVla.xlsx"
        }
    },
    "subject": null,
    "message": null,
    "socket": null
}

Пуш об успешной выгрузке сводного файла ключ|квартира|пользователь домофона. Канал token.ID. Event - App\Events\TokenPush
{
    "data": {
        "type": "import_intercom_flats_users_keys",
        "status": "ok|error",
        "data": []
    },
    "subject": null,
    "message": null,
    "socket": null
}

/ 

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

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

If this problem persists, please contact our support.