Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section


Column
width35%


Panel
borderColor#CCCCCC
bgColor#FFFFFF
titleBGColor#F0F0F0
borderStylesolid
titleOn this page:
Table of Contents



Column


Templates allow you to apply the same preset parameters to camerasSzablony pozwalają na zastosowanie predefiniowanych ustawień dla innych kamer.

Info
titleNote

If a template has been assigned to the camera but has not yet been applied, then the response to the ListUnits method (see Jeśli szablon został wyznaczony dla kamery, lecz nie został on zastosowany, odpowiedź dla metody ListUnits (zobacz: Zarządzaj urządzeniami za pomocą metod gRPC API (ConfigurationService)) will contain the parameter będzie zawierać parametr "has_unapplied_templates": true.

...

Pozyskaj listę utworzonych szablonów

Code Block
{
    "method": "axxonsoft.bl.config.ConfigurationService.ListTemplates",
    "data": {
        "view": "VIEW_MODE_FULL"
    }
}

Create a template

...

Utwórz szablon

Przykład szablonu z określonym producentem urządzenia, modelem, nazwą użytkownika oraz hasłem

Code Block
{
    "method": "axxonsoft.bl.config.ConfigurationService.ChangeTemplates",
    "data": {
        "created": [
            {
                "id": "8a7a73d7-ca8c-4a09-b7f0-7b45ef9cfe8d",
                "name": "Hikvision DS-2CD2135FWD-I",
                "unit": {
                    "uid": "hosts/Server1/DeviceIpint.13",
                    "type": "DeviceIpint",
                    "properties": [
                        {
                            "id": "vendor",
                            "readonly": false,
                            "value_string": "Hikvision"
                        },
                        {
                            "id": "model",
                            "readonly": false,
                            "value_string": "DS-2CD2135FWD-I"
                        },
                        {
                            "id": "user",
                            "readonly": false,
                            "value_string": "admin"
                        },
                        {
                            "id": "password",
                            "readonly": false,
                            "value_string": "Pe28age33tv"
                        }
                    ],
                    "units": [],
                    "opaque_params": [
                        {
                            "id": "color",
                            "readonly": false,
                            "properties": [],
                            "value_string": "#e91e63"
                        }
                    ]
                }
            }
        ]
    }
}


Note
titleAttention!

The Grupa parametrów opaque_params parameter group is required in order to display the template in the Web Client.

...

 jest wymagana w celu wyświetlania szablonów w Kliencie Web.

Przykład szablonu z określonymi geodanymi urządzenia

Code Block
{
    "method": "axxonsoft.bl.config.ConfigurationService.ChangeTemplates",
    "data": {
        "created": [
            {
                "id": "1322d30b-bdd4-4734-8a17-7e8bff92b41c",
                "name": "Geolocation 35-45",
                "unit": {
                    "uid": "hosts/Server1/DeviceIpint.14",
                    "type": "DeviceIpint",
                    "properties": [
                        {
                            "id": "geoLocationLatitude",
                            "readonly": false,
                            "value_double": 35
                        },
                        {
                            "id": "geoLocationLongitude",
                            "readonly": false,
                            "value_double": 45
                        }
                    ],
                    "units": [],
                    "opaque_params": [
                        {
                            "id": "color",
                            "readonly": false,
                            "properties": [],
                            "value_string": "#00bcd4"
                        }
                    ]
                }
            }
        ]
    }
}

...

Edytuj szablon

Code Block
{
    "method": "axxonsoft.bl.config.ConfigurationService.ChangeTemplates",
    "data": {
        "modified": [
            {
                "body": {
                    "id": "1652b728-3292-32b3-bb7f-e0adb8c9048c",
                    "name": "Geolocation",
                    "unit": {
                        "uid": "hosts/Server1/DeviceIpint.22",
                        "type": "DeviceIpint",
                        "properties": [
                            {
                                "id": "geoLocationLatitude",
                                "readonly": false,
                                "value_double": 38.83424
                            },
                            {
                                "id": "geoLocationLongitude",
                                "readonly": false,
                                "value_double": -111.0824
                            }
                        ],
                        "units": [
                            {
                                "uid": "hosts/Server1/DeviceIpint.22/VideoChannel.0",
                                "type": "VideoChannel",
                                "properties": [
                                    {
                                        "id": "display_name",
                                        "readonly": false,
                                        "properties": [],
                                        "value_string": "camera1"
                                    },
                                    {
                                        "id": "comment",
                                        "readonly": false,
                                        "properties": [],
                                        "value_string": ""
                                    },
                                    {
                         				"id": "enabled",
                                        "readonly": false,
                                        "properties": [],
                                        "value_bool": true
                                    }
                                ],
                                "units": [],
                                "opaque_params": []
                            }
                        ],
                        "opaque_params": [
                            {
                                "id": "color",
                                "readonly": false,
                                "properties": [],
                                "value_string": "#00bcd4"
                            }
                        ]
                    }
                },
                "etag": "1AC1B6FA562B290E0D1080A7D1DA2D3B3596EC95"
            }
        ]
    }
}

where etag is the template label that will change after each template edit.

...

gdzie etag jest etykietą szablonu zmieniającą się po każdej edycji szablonu.

Przypisz szablon do urządzenia

Code Block
{
    "method": "axxonsoft.bl.config.ConfigurationService.SetTemplateAssignments",
    "data": {
        "items": [
            {
                "unit_id": "hosts/Server1/DeviceIpint.10",
                "template_ids": [
                    "834794f0-1085-4604-a985-7715d88165bc"
                ]
            }
        ]
    }
}

...

Pozyskaj informacje o wybranych szablonach

Code Block
{
    "method": "axxonsoft.bl.config.ConfigurationService.BatchGetTemplates",
    "data": {
        "items": [
            {
                "id": "e35f6a3f-ab44-4e20-a48c-e7e36f511cc1",
                "etag": "0501160E0A8513E1E95689A5E6E7CD488C0EE54D"
            }
        ]
    }
}

where etag parameter is optional:

  • if it is not specified, then the request will return all information about template;
  • if it is specified, then the request will return information about template updates.

...

gdzie parametr etag jest opcjonalny:

  • jeśli nie jest określony, zapytanie zwraca wszystkie informacje o szablonie;
  • jeśli jest określony, zapytanie zwraca wszystkie informacje o aktualizacjach szablonu.

Usuń szablony

Code Block
{
    "method": "axxonsoft.bl.config.ConfigurationService.ChangeTemplates",
    "data": {
        "removed": [
            "cd97d7cc-3573-3864-bb6f-2814b6831341",
            "834794f0-1085-4604-a985-7715d88165bc"
        ]
    }
}

...