Hc_ss_license_packages - Команды управления пакетами лицензий
Hc_ss_licence_package_allocate
Команда аллокации лицензии ДВО на абоненте
Аналог команды в CoCon:
domain/<DOMAIN>/ss/licence/allocate
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/ss_licence_package_allocate
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:include schemaLocation="error.xsd"/> <!-- okType --> <xs:complexType name="okType"> <xs:attribute name="address" type="xs:string" use="required"/> <xs:attribute name="package" type="xs:string" use="required"/> </xs:complexType> <!-- warningType --> <xs:complexType name="warningType"> <xs:attribute name="address" type="xs:string" use="required"/> <xs:attribute name="reason" type="xs:string" use="required"/> </xs:complexType> <!-- requestType --> <xs:complexType name="requestType"> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="package" type="xs:string" use="required"/> <xs:attribute name="addresses" type="xs:string" use="required"/> <xs:attribute name="priority" type="xs:boolean"/> </xs:complexType> <!-- in --> <xs:element name="in"> <xs:complexType> <xs:sequence> <xs:element name="request" type="requestType" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <!-- out --> <xs:element name="out"> <xs:complexType> <xs:choice> <xs:element name="result" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="ok" type="okType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="warning" type="warningType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="error" type="errorType" minOccurs="1" maxOccurs="1" /> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример
Запрос: http://192.168.1.21:9999/commands/ss_licence_package_allocate
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_ss_licence_package_allocate.xsd"> <request domain="biysk.local" addresses="{240101, 240003, 240462}" package="ECSS-ADV"/> </in>
Ответ: 200
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ss_licence_package_allocate.xsd"> <result> <ok address="240462" package="ECSS-ADV"/> <ok address="240003" package="ECSS-ADV"/> <ok address="240101" package="ECSS-ADV"/> <ok address="240003" package="ECSS-ADV"/> <ok address="240101" package="ECSS-ADV"/> </result> </out>
Hc_ss_licence_package_free
Команда освобождения лицензии ДВО на абоненте
Аналог команды в CoCon:
domain/<DOMAIN>/ss/licence/free
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/ss_licence_package_free
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:include schemaLocation="error.xsd"/> <!-- okType --> <xs:complexType name="okType"> <xs:attribute name="address" type="xs:string" use="required"/> <xs:attribute name="package" type="xs:string" use="required"/> </xs:complexType> <!-- warningType --> <xs:complexType name="warningType"> <xs:attribute name="address" type="xs:string" use="required"/> <xs:attribute name="reason" type="xs:string" use="required"/> </xs:complexType> <!-- requestType --> <xs:complexType name="requestType"> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="package" type="xs:string" use="required"/> <xs:attribute name="addresses" type="xs:string" use="required"/> </xs:complexType> <!-- in --> <xs:element name="in"> <xs:complexType> <xs:sequence> <xs:element name="request" type="requestType" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <!-- out --> <xs:element name="out"> <xs:complexType> <xs:choice> <xs:element name="result" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="ok" type="okType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="warning" type="warningType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="error" type="errorType" minOccurs="1" maxOccurs="1" /> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример
Запрос: http://192.168.1.21:9999/commands/ss_licence_package_free
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_ss_licence_package_free.xsd"> <request domain="biysk.local" addresses="{240003, 240462, 240500, 240505}" package="ECSS-ADV"/> </in>
Ответ: 200
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ss_licence_package_free.xsd"> <result> <ok address="240500" package="ECSS-ADV"/> <ok address="240462" package="ECSS-ADV"/> <ok address="240003" package="ECSS-ADV"/> <warning address="240505" reason="package_not_allocated"/> </result> </out>
Hc_ss_licence_package_subscribers_list
Команда просмотра текущего распределения лицензий ДВО по доменам
Аналог команды в CoCon:
cluster/storage/<CLUSTER>/ss/limit
domain/<DOMAIN>/ss/limi
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/ss_licence_package_subscribers_list
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:include schemaLocation="error.xsd"/> <xs:complexType name="nameType"> <xs:attribute name="name" type="xs:string"/> </xs:complexType> <xs:complexType name="packageIdType"> <xs:attribute name="domain" type="xs:string"/> <xs:attribute name="name" type="xs:string"/> <xs:attribute name="address" type="xs:string"/> </xs:complexType> <xs:complexType name="resultType"> <xs:sequence> <xs:element name="package_id" type="packageIdType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="cursor" type="xs:string"/> </xs:complexType> <!-- requestType --> <xs:complexType name="requestType"> <xs:choice> <xs:element name="domain" type="nameType"/> <xs:element name="cluster" type="nameType"/> </xs:choice> <xs:attribute name="package" type="xs:string"/> <xs:attribute name="limit" type="xs:string"/> <xs:attribute name="cursor" type="xs:string"/> </xs:complexType> <!-- in --> <xs:element name="in"> <xs:complexType> <xs:sequence> <xs:element name="request" type="requestType" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> <!-- out --> <xs:element name="out"> <xs:complexType> <xs:choice> <xs:element name="result" type="resultType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример
Запрос: http://192.168.1.21:9999/commands/ss_licence_package_subscibers_list
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_ss_licence_package_subscribers_list.xsd"> <request package="ECSS-ADV" limit="5"> <cluster name="ds1"/> </request> </in>
Ответ: 200
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ss_licence_package_subscribers_list.xsd"> <result cursor="g2gKZAANbW5lc2lhX3NlbGVjdGQAKnJ0b3AtY29uZmlndXJhdGlvbi1scG0tc3MtcHJvZmlsZXMtYWxpYXNlc2gCZAALYXN5bmNfZGlydHlnZAAJZHMxQGVjc3MxAAApPAAAAAEBZAAJZHMxQGVjc3MxZAALZGlzY19jb3BpZXNoBnIAA2QACWRzMUBlY3NzMQEAA4FfTW4AAlY256NheGEFcgADZAAJZHMxQGVjc3MxAQADCS1NfgACVjbno2phAGpkAAl1bmRlZmluZWRkAAl1bmRlZmluZWRsAAAAAWgDaAhkAB1ydG9wLWxwbS1zcy1wcm9maWxlLWFsaWFzLXJvd2QAAV9kAAFfZAABX2QACEVDU1MtQURWZAAEdHJ1ZWQAAV9kAAFfamwAAAABZAACJF9qag=="> <package_id domain="biysk.local" address="240503" name="ECSS-ADV"/> <package_id domain="biysk.local" address="240465" name="ECSS-ADV"/> <package_id domain="biysk.local" address="240501" name="ECSS-ADV"/> <package_id domain="biysk.local" address="240101" name="ECSS-ADV"/> <package_id domain="biysk.local" address="240502" name="ECSS-ADV"/> </result> </out>