Hc_gateway_profile_declare
Команда предназначена для создания нового профиля шлюза.
Аналог команды в CoCon:
/gateway/profile/declare
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/gateway_profile_declare
Код HTTP-ответа:
- 201 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="profileType"> <xs:sequence> <xs:element name="property" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="profile" type="profileType" minOccurs="1" /> </xs:all> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос: http://192.168.23.34:9999/commands/gateway_profile_declare
<?xml version="1.0" encoding="UTF-8" ?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_profile_declare.xsd"> <profile domain="p.city" name="profile5"> <property name="key1" value="abc" /> <property name="key2" value="[1, 2, 3, 5]" /> </profile> </in>
Hc_gateway_profile_info
Команда предназначена для просмотра информации по имеющимся профилям шлюзов.
Аналог команды в CoCon:
/gateway/profile/info
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/gateway_profile_info
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="profileType"> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="name" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="profileOutType"> <xs:sequence> <xs:element name="property" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="profile" type="profileType" minOccurs="1" maxOccurs="1"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="out"> <xs:complexType> <xs:sequence> <xs:element name="profile" type="profileOutType" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
Пример 1:
Запрос: http://192.168.23.34:9999/commands/gateway_profile_info
<?xml version="1.0" encoding="UTF-8" ?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_profile_info.xsd"> <profile domain="p.city" name="profile5" /> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_profile_info.xsd"> <profile name="profile5"> <property name="key1" value="abc"/> <property name="key2" value="[1,2,3,5]"/> </profile> </out>
Пример 2:
Запрос: http://192.168.23.34:9999/commands/gateway_profile_info
<?xml version="1.0" encoding="UTF-8" ?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_profile_info.xsd" > <profile domain="p.city" /> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_profile_info.xsd"> <profile name="profile6"> <property name="key1" value="abc"/> <property name="key2" value="[1,2,3,5]"/> </profile> <profile name="profile5"> <property name="key1" value="abc"/> <property name="key2" value="[1,2,3,5]"/> </profile> <profile name="profile4"> <property name="k1" value="12223"/> <property name="k2" value="[1,4,3]"/> <property name="k3" value="123"/> </profile> <profile name="profile3"/> <profile name="profile2"> <property name="key1" value="value1"/> <property name="key2" value="[1,2,3]"/> </profile> <profile name="profile1"/> <profile name="profile10"/> </out>
Hc_gateway_profile_set
Команда предназначена для установки свойств для определенного профиля шлюза.
Аналог команды в CoCon:
/gateway/profile/set
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/gateway_profile_set
Код HTTP-ответа:
- 201 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="profileType"> <xs:sequence> <xs:element name="property" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="profile" type="profileType" minOccurs="1" /> </xs:all> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос: http://192.168.23.34:9999/commands/gateway_profile_set
<?xml version="1.0" encoding="UTF-8" ?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_profile_set.xsd"> <profile domain="p.city" name="profile4"> <property name="k1" value="123" /> <property name="k2" value="[1, 2, 3]" /> </profile> </in>
Hc_gateway_profile_clean
Команда предназначена для удаления свойств определенного профиля шлюза.
Аналог команды в CoCon:
/gateway/profile/clean
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/gateway_profile_clean
Код HTTP-ответа:
- 204 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="profileType"> <xs:sequence> <xs:element name="property" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="profile" type="profileType" minOccurs="1"/> </xs:all> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос: http://192.168.23.34:9999/commands/gateway_profile_clean
<?xml version="1.0" encoding="UTF-8" ?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_profile_clean.xsd"> <profile domain="p.city" name="profile1"> <property name="key1" /> <property name="key2" /> </profile> </in>
Hc_gateway_profile_remove
Команда предназначена для удалении профиля шлюза из виртуальной АТС.
Аналог команды в CoCon:
gateway/profile/remove
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/gateway_profile_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="profileType"> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="profile" type="profileType" minOccurs="1" maxOccurs="1"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="out"> <xs:complexType> <xs:all> <xs:element name="error" type="errorType" /> </xs:all> </xs:complexType> </xs:element> </xs:schema>
Пример 1:
Запрос: http://192.168.23.34:9999/commands/gateway_profile_remove
<?xml version="1.0" encoding="UTF-8" ?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_profile_remove.xsd"> <profile domain="p.city" name="profile5" /> </in>
Ответ:
204
Добавить комментарий