Hc_trunk_clean
Команда позволяет для определенного свойства транка установить значение по умолчанию.
Аналог команды в CoCon:
domain/<DOMAIN>/trunk/clean
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/trunk_clean
Код HTTP-ответа:
При выполнении команды HTTP-терминал может ответить следующими сообщениями:
- 200 – в случае успеха;
- 404 – в случае ошибки.
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="requestType"> <xs:sequence> <xs:element name="property" type="trunkProperty" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="trunk" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="trunkProperty"> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <!-- in --> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="request" type="requestType"/> </xs:all> </xs:complexType> </xs:element> <!-- out --> <xs:element name="out"> <xs:complexType> <xs:choice> <xs:element name="response"> <xs:complexType> <xs:all> <xs:element name="success" type="xs:string"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Примеры
Запрос:
http://192.168.1.21:9999/commands/trunk_set
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_trunk_clean.xsd"> <request domain="biysk.local" trunk="bsk1"> <property name="black_list\out\enabled"/> <property name="CPS_limit"/> </request> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_trunk_clean.xsd"> <success/> </out>
Hc_trunk_info
Команда позволяет просматривать конфигурации определенного транка и информацию о транке в реальном времени.
Аналог команды в CoCon:
domain/<DOMAIN>/trunk/info
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/trunk_info
Код HTTP-ответа:
При выполнении команды HTTP-терминал может ответить следующими сообщениями:
- 200 – в случае успеха;
- 404 – в случае ошибки.
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="requestType"> <xs:sequence> <xs:element name="property" type="trunkProperty" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="trunk" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="trunkProperty"> <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" type="requestType"/> </xs:all> </xs:complexType> </xs:element> <!-- out --> <xs:element name="out"> <xs:complexType> <xs:choice> <xs:element name="response"> <xs:complexType> <xs:all> <xs:element name="success" type="xs:string"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Примеры
Запрос:
http://192.168.1.21:9999/commands/trunk_info
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_trunk_info.xsd"> <request domain="biysk.local" trunk="smg-4"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_trunk_info.xsd"> <response> <trunk name="smg-4" group="smg.gr"> <property name="stat\last_activity" value="undefined"/> <property name="stat\rejected\member" value="0"/> <property name="stat\rejected\out" value="0"/> <property name="stat\rejected\in" value="0"/> <property name="stat\cps_max\out" value="0"/> <property name="stat\cps_max\in" value="1"/> <property name="stat\out" value="0"/> <property name="stat\in" value="21"/> <property name="cps\out" value="0"/> <property name="cps\in" value="0"/> <property name="out" value="0"/> <property name="in" value="0"/> <property name="owner" value="sip1"/> <property name="type" value="sip"/> <property name="cps_limit\total" value="256"/> <property name="cps_limit\out" value="256"/> <property name="cps_limit\in" value="256"/> <property name="white_list\out\enabled" value="false"/> <property name="white_list\out" value="undefined"/> <property name="white_list\in\enabled" value="false"/> <property name="white_list\in" value="undefined"/> <property name="black_list\out\enabled" value="false"/> <property name="black_list\out" value="undefined"/> <property name="black_list\in\enabled" value="false"/> <property name="black_list\in" value="undefined"/> <property name="bandwidth\total" value="256"/> <property name="bandwidth\out" value="256"/> <property name="bandwidth\in" value="256"/> </trunk> </response> </out>
Hc_trunk_set
Команда позволяет выполнить настройку конфигурации определенного транка.
Аналог команды в CoCon:
domain/<DOMAIN>/trunk/set
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/trunk_set
Код HTTP-ответа:
При выполнении команды HTTP-терминал может ответить следующими сообщениями:
- 200 – в случае успеха;
- 404 – в случае ошибки.
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="requestType"> <xs:sequence> <xs:element name="property" type="trunkProperty" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="trunk" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="trunkProperty"> <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" type="requestType"/> </xs:all> </xs:complexType> </xs:element> <!-- out --> <xs:element name="out"> <xs:complexType> <xs:choice> <xs:element name="response"> <xs:complexType> <xs:all> <xs:element name="success" type="xs:string"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Примеры
Запрос:
http://192.168.1.21:9999/commands/trunk_set
<?xml version="1.0"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_trunk_set.xsd"> <request domain="biysk.local" trunk="bsk1"> <property name="black_list\out\enabled" value="true"/> <property name="CPS_limit" value="10"/> </request> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_trunk_set.xsd"> <success/> </out>
Hc_trunk_list
Команда возвращает список транковых интерфейсов, определенных для конкретного домена.
Аналог команды в CoCon:
/domain/<DOMAIN>/trunk/list
Метод http запроса:
POST
Шаблон http запроса:
http://host:port/commands/trunk_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"> <!-- ifaceType --> <xs:complexType name="ifaceType"> <xs:attribute name="id" type="xs:string" use="required"/> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="owner" type="xs:string" use="required"/> <xs:attribute name="group" type="xs:string" use="required"/> <xs:attribute name="type" type="xs:string" use="required"/> <xs:attribute name="active" type="xs:string" use="required"/> </xs:complexType> <!-- ifacesType --> <xs:complexType name="ifacesType"> <xs:sequence> <xs:element name="iface" type="ifaceType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </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:attribute name="owner" type="xs:string" use="optional"/> <xs:attribute name="group" type="xs:string" use="optional"/> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:all> <xs:element name="ifaces" type="ifacesType"/> </xs:all> </xs:complexType> </xs:element> </xs:schema>
Пример запроса всех транков в определенном домене:
Запрос: http://192.168.1.21:9999/commands/trunk_list
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_trunk_list.xsd"> <request domain="biysk.local"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_trunk_list.xsd"> <ifaces> <iface id="smg-4" name="smg-4" owner="sip1" group="smg.gr" type="sip" active="true"/> <iface id="to_aster" name="to_aster" owner="sip1" group="sbc.gr" type="sip" active="true"/> <iface id="ems1" name="ems1" owner="sip1" group="ssw.gr" type="sip" active="true"/> <iface id="ems2" name="ems2" owner="sip1" group="ssw.gr" type="sip" active="true"/> <iface id="bsk1" name="bsk1" owner="sip1" group="ssw.gr" type="sip" active="true"/> <iface id="to_sipp" name="to_sipp" owner="sip1" group="sbc.gr" type="sip" active="true"/> <iface id="bsk2" name="bsk2" owner="sip1" group="ssw.gr" type="sip" active="true"/> <iface id="nsk_sbc" name="nsk_sbc" owner="sip1" group="sbc.gr" type="sip" active="true"/> </ifaces> </out>
Пример запроса всех транков по определенному владельцу в определенном домене:
Запрос: http://192.168.1.21:9999/commands/trunk_list
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_trunk_list.xsd"> <request domain="biysk.local" owner="sip1"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_trunk_list.xsd"> <ifaces> <iface id="smg-4" name="smg-4" owner="sip1" group="smg.gr" type="sip" active="true"/> <iface id="to_aster" name="to_aster" owner="sip1" group="sbc.gr" type="sip" active="true"/> <iface id="ems1" name="ems1" owner="sip1" group="ssw.gr" type="sip" active="true"/> <iface id="ems2" name="ems2" owner="sip1" group="ssw.gr" type="sip" active="true"/> <iface id="bsk1" name="bsk1" owner="sip1" group="ssw.gr" type="sip" active="true"/> <iface id="to_sipp" name="to_sipp" owner="sip1" group="sbc.gr" type="sip" active="true"/> <iface id="bsk2" name="bsk2" owner="sip1" group="ssw.gr" type="sip" active="true"/> <iface id="nsk_sbc" name="nsk_sbc" owner="sip1" group="sbc.gr" type="sip" active="true"/> </ifaces> </out>
Пример запроса всех транков по определенной группе и домену:
Запрос: http://192.168.1.21:9999/commands/trunk_list
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_trunk_list.xsd"> <request domain="biysk.local" group="sbc.gr"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_trunk_list.xsd"> <ifaces> <iface id="to_aster" name="to_aster" owner="sip1" group="sbc.gr" type="sip" active="true"/> <iface id="to_sipp" name="to_sipp" owner="sip1" group="sbc.gr" type="sip" active="true"/> <iface id="nsk_sbc" name="nsk_sbc" owner="sip1" group="sbc.gr" type="sip" active="true"/> </ifaces> </out>