Hc_np_declare
Команда позволяет создать новый план нумерации.
Аналог команды в CoCon:
domain/<DOMAIN>/np/declare
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/np_declare
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:include schemaLocation="error.xsd"/> <xs:complexType name="domainType"> <xs:sequence> <xs:element name="numbering_plan" type="npType" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="npType"> <xs:sequence> <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="digitmap" type="xs:string" use="optional"/> <xs:attribute name="description" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="propertyType"> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="request"> <xs:complexType> <xs:sequence> <xs:element name="domain" type="domainType" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:choice> <!--Positive case--> <xs:element name="response"> <xs:complexType> <xs:sequence> <xs:element name="ok"/> </xs:sequence> </xs:complexType> </xs:element> <!--Or error--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/np_declare
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_declare.xsd"> <request> <domain name="biysk.local"> <numbering_plan name="city" digitmap="xxxxxx" description="City subscribers"/> </domain> </request> </in>
Код ответа:
200
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_declare.xsd"> <response> <ok/> </response> </out>
Код ответа:
200
Ответ:
<?xml version="1.0" encoding="UTF-8"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_declare.xsd"> <error cmd="hc_np_declare" reason="already_declared" body="[{{error,already_exists},<<"city">>}]"/> </out>
Hc_np_info
Команда позволяет просмотреть список и свойства планов нумерации.
Аналог команды в CoCon:
domain/<DOMAIN>/np/info
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/np_info
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:include schemaLocation="error.xsd"/> <xs:complexType name="domainType"> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="propertyType"> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="numPlanType"> <xs:sequence> <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="digitmap" type="xs:string" use="optional"/> <xs:attribute name="description" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="domainOutType"> <xs:sequence> <xs:element name="numbering_plan" type="numPlanType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="request"> <xs:complexType> <xs:sequence> <xs:element name="domain" type="domainType" minOccurs="1" maxOccurs="1"/> <xs:element name="numbering_plan" type="domainType" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:choice> <!--Positive case--> <xs:element name="response"> <xs:complexType> <xs:all> <xs:element name="domain" type="domainOutType"/> </xs:all> </xs:complexType> </xs:element> <!--Or error--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/np_info
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_info.xsd"> <request> <domain name="biysk.local"/> <numbering_plan name="city"/> </request> </in>
Код ответа:
200
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_info.xsd"> <response> <domain name="biysk.local"> <numbering_plan name="city" digitmap="xxxxxx" description="City subscribers"/> </domain> </response> </out>
Hc_np_set
Команда позволяет изменить свойства плана нумерации.
Аналог команды в CoCon:
domain/<DOMAIN>/np/set
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/np_set
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:include schemaLocation="error.xsd"/> <xs:complexType name="domainType"> <xs:sequence> <xs:element name="numbering_plan" type="npType" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="npType"> <xs:sequence> <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="digitmap" type="xs:string" use="optional"/> <xs:attribute name="description" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="propertyType"> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="request"> <xs:complexType> <xs:sequence> <xs:element name="domain" type="domainType" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:choice> <!--Positive case--> <xs:element name="response"> <xs:complexType> <xs:sequence> <xs:element name="ok"/> </xs:sequence> </xs:complexType> </xs:element> <!--Or error--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/np_set
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_set.xsd"> <request> <domain name="biysk.local"> <numbering_plan name="city" digitmap="25xxxx" description="City subscribers"> <property name="ni" value="local"/> <property name="nai" value="nationalNumber"/> </numbering_plan> <numbering_plan name="local_np" description="Local subscribers" /> </domain> </request> </in>
Код ответа:
200
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_set.xsd"> <response> <ok/> </response> </out>
Hc_np_clean
Команда позволяет удалить определенное свойство из номерного плана.
Аналог команды в CoCon:
domain/<DOMAIN>/np/clean
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/np_clean
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:include schemaLocation="error.xsd"/> <xs:complexType name="domainType"> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="request"> <xs:complexType> <xs:sequence> <xs:element name="domain" type="domainType" minOccurs="1" maxOccurs="1"/> <xs:element name="numbering_plan" type="domainType" minOccurs="1" maxOccurs="1"/> <xs:element name="property" type="domainType" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:choice> <!--Positive case--> <xs:element name="response"> <xs:complexType> <xs:sequence> <xs:element name="ok"/> </xs:sequence> </xs:complexType> </xs:element> <!--Or error--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/np_clean
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_clean.xsd"> <request> <domain name="biysk.local"/> <numbering_plan name="city"/> <property name="nai"/> </request> </in>
Код ответа:
200
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_clean.xsd"> <response> <ok/> </response> </out>
Код ответа:
200
Ответ:
<?xml version="1.0" encoding="UTF-8"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_clean.xsd"> <error cmd="hc_np_clean" reason="not_exists" body="{{error,not_exists},"x-plan"}"/> </out>
Hc_np_remove
Команда позволяет удалить существующий номерной план
Аналог команды в CoCon:
domain/<DOMAIN>/np/remove
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/np_remove
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:include schemaLocation="error.xsd"/> <xs:complexType name="domainType"> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="request"> <xs:complexType> <xs:sequence> <xs:element name="domain" type="domainType" minOccurs="1" maxOccurs="1"/> <xs:element name="numbering_plan" type="domainType" minOccurs="1" maxOccurs="1"/> </xs:sequence> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:choice> <!--Positive case--> <xs:element name="response"> <xs:complexType> <xs:sequence> <xs:element name="ok"/> </xs:sequence> </xs:complexType> </xs:element> <!--Or error--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/np_remove
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_remove.xsd"> <request> <domain name="biysk.local" /> <numbering_plan name="city" /> </request> </in>
Код ответа:
200
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_remove.xsd"> <response> <ok/> </response> </out>
Код ответа:
200
Ответ:
<?xml version="1.0" encoding="UTF-8"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_remove.xsd"> <error cmd="hc_np_remove" reason="not_exists" body="{{error,not_exists},"city"}"/> </out>
Hc_np_list
Команда предназначена для отображения списка имен планов нумерации в определенном домене.
Аналог команды в CoCon:
/domain/<DOMAIN>/np/info
Метод http запроса:
POST
Шаблон http запроса:
http://host:port/commands/np_list
Код http ответа:
200 – в случае успеха;
404 – в случае ошибки.
Xsd схема xml файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <!-- NPType --> <xs:complexType name="NPType"> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="description" type="xs:string" use="optional"/> </xs:complexType> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="request"> <xs:complexType> <xs:attribute name="domain" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:choice> <xs:element name="response"> <xs:complexType> <xs:sequence> <xs:element name="np" type="NPType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/np_list
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_list.xsd"> <request domain="biysk.local"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_np_list.xsd"> <response> <np name="city" description="City subscribers"/> <np name="np_240" description=""/> </response> </out>