Hc_http_routing_servers_change
Команда изменяет параметры сервера HTTP маршрутизации вызовов.
Аналог команды в CoCon:
/domain/<DOMAIN>/routing/http/set
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/http_routing_servers_change
Код 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="HttpServer"> <xs:attribute name="id" type="xs:string" use="required"/> <xs:attribute name="url" type="xs:string" use="required"/> <xs:attribute name="api_key" type="xs:string" use="optional"/> </xs:complexType> <!--in--> <xs:element name = "in"> <xs:complexType> <xs:sequence> <xs:element name="request"> <xs:complexType> <xs:all> <xs:element name="server" type="HttpServer"/> </xs:all> <xs:attribute name="domain" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <!--out--> <xs:element name = "out"> <xs:complexType> <xs:choice> <xs:element name="response"> <xs:complexType> <xs:all> <xs:element name="ok"/> </xs:all> </xs:complexType> </xs:element> <!--bad. command failed:--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/http_routing_servers_change
Или с помощью curl:
curl -X POST 192.168.1.21:9999/commands/http_routing_servers_change -b "token=<Token>;" --data "<in><request domain=\"biysk.local\"><server id=\"serv2\" url=\"10.16.33.5\"></server></request></in>"
<in> <request domain="biysk.local"> <server id="serv2" url="10.16.33.5"/> </request> </in>
Ответ: 200
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http_routing_servers_change.xsd"> <response> <ok/> </response> </out>
Hc_http_routing_servers_declare
Команда добавляет новый сервер HTTP маршрутизации вызовов.
Аналог команды в CoCon:
/domain/<DOMAIN>/routing/http/declare
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/http_routing_servers_declare
Код HTTP-ответа:
200 – в случае успеха;
409 – если сервер с данным идентификатором уже существует.
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="HttpServer"> <xs:attribute name="id" type="xs:string" use="required"/> <xs:attribute name="url" type="xs:string" use="required"/> <xs:attribute name="api_key" type="xs:string" use="optional"/> </xs:complexType> <!--in--> <xs:element name = "in"> <xs:complexType> <xs:sequence> <xs:element name="request"> <xs:complexType> <xs:all> <xs:element name="server" type="HttpServer"/> </xs:all> <xs:attribute name="domain" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <!--out--> <xs:element name = "out"> <xs:complexType> <xs:choice> <xs:element name="response"> <xs:complexType> <xs:all> <xs:element name="ok"/> </xs:all> </xs:complexType> </xs:element> <!--bad. command failed:--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/http_routing_servers_declare
<in> <request domain="biysk.local"> <server id="server1" url="192.168.1.21" api_key="151235215wehfhdgv"/> </request> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http_routing_servers_declare.xsd"> <response> <ok/> </response> </out>
Нс_http_routing_servers_info
Команда просмотра информации о настроенных серверах HTTP маршрутизации вызовов.
Аналог команды в CoCon:
/domain/<DOMAIN>/routing/http/info
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/http_routing_servers_info
Код 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="HttpServer"> <xs:attribute name="id" type="xs:string" use="required"/> <xs:attribute name="url" type="xs:string" use="required"/> <xs:attribute name="api_key" type="xs:string" use="optional"/> </xs:complexType> <!--in--> <xs:element name = "in"> <xs:complexType> <xs:sequence> <xs:element name="request"> <xs:complexType> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="id" type="xs:string" use="optional"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <!--out--> <xs:element name = "out"> <xs:complexType> <xs:choice> <xs:element name="response"> <xs:complexType> <xs:sequence> <xs:element name="server" type="HttpServer"/> </xs:sequence> </xs:complexType> </xs:element> <!--bad. command failed:--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример 1:
Запрос:
http://192.168.1.21:9999/commands/http_routing_servers_info
<in> <request domain="biysk.local"/> </in>
Ответ: 200
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http_routing_servers_info.xsd"> <response> <servers> <server id="server4" url="http://localhost:8788" api_key="meeli5eik1ainahl"/> <server id="server3" url="192.168.2.21" api_key="oi6ohcheiw6et2ai"/> <server id="server2" url="10.16.33.5" api_key="eeyaang4zo4jaemi"/> <server id="server1" url="192.168.1.21" api_key="151235215wehfhdgv"/> </servers> </response> </out>
Пример 2:
Запрос:
http://192.168.1.21:9999/commands/http_routing_servers_info
<in> <request domain="biysk.local" id="server2"/> </in>
Ответ: 200
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http_routing_servers_info.xsd"> <response> <servers> <server id="server2" url="10.16.33.5" api_key="eeyaang4zo4jaemi"/> </servers> </response> </out>
Hc_http_routing_servers_remove
Команда удаляет сервер HTTP маршрутизации вызовов
Аналог команды в CoCon:
/domain/<DOMAIN>/routing/http/remove
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/http_routing_servers_remove
Код 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"/> <!--in--> <xs:element name = "in"> <xs:complexType> <xs:sequence> <xs:element name="request"> <xs:complexType> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="id" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <!--out--> <xs:element name = "out"> <xs:complexType> <xs:choice> <xs:element name="response"> <xs:complexType> <xs:all> <xs:element name="ok"/> </xs:all> </xs:complexType> </xs:element> <!--bad. command failed:--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/http_routing_servers_remove
<in> <request domain="biysk.local" id="server4"/> </in>
Ответ: 200
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http_routing_servers_remove.xsd"> <response> <ok/> </response> </out>
Нc_http_routing_servers_set_all
Команда заменияет весь набор настроенных серверов HTTP маршрутизации новым набором.
Аналог команды в CoCon:
нет
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/http_routing_servers_set_all
Код HTTP-ответа:
200 – в случае успеха;
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="HttpServer"> <xs:attribute name="id" type="xs:string" use="required"/> <xs:attribute name="url" type="xs:string" use="required"/> <xs:attribute name="api_key" type="xs:string" use="optional"/> </xs:complexType> <!--in--> <xs:element name = "in"> <xs:complexType> <xs:sequence> <xs:element name="request"> <xs:complexType> <xs:sequence> <xs:element name="server" type="HttpServer" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="domain" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <!--out--> <xs:element name = "out"> <xs:complexType> <xs:choice> <xs:element name="response"> <xs:complexType> <xs:all> <xs:element name="ok"/> </xs:all> </xs:complexType> </xs:element> <!--bad. command failed:--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/http_routing_servers_set_all
<in> <request domain="biysk.local"> <server id="serv4" url="http://localhost:8789" api_key="faih3ieheiqu9ath"/> <server id="serv3" url="192.168.2.21" api_key="oi6ohcheiw6et2ai"/> <server id="serv2" url="10.16.33.6" api_key="eeyaang4zo4jaemi"/> </request> </in>
Ответ: 200
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="http_routing_servers_set_all.xsd"> <response> <ok/> </response> </out>
Добавить комментарий