Hc_sip_ldap - Управление параметрами соединения с сервером LDAP
Hc_sip_ldap_info
Команда позволяет просмотреть свойства LDAP кластера SIP.
Аналог команды в CoCon:
domain/<DOMAIN>/sip/ldap/info
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/sip_ldap_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:annotation>
<xs:documentation xml:lang="en">
Show LDAP properties of SIP cluster.
Usage: http://server:9999/commands/sip_ldap_info.
Implementation: hc_sip_ldap_info.erl.
Git: git@git.eltex.loc:httpTerminal.git.
Copyright (c) 2014, Eltex. All rights reserved.
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="error.xsd"/>
<xs:include schemaLocation="ecm_common.xsd"/>
<!-- sipLDAPOptionsType-->
<xs:complexType name="sipLDAPOptionsType">
<xs:complexContent>
<xs:extension base="baseOptionsType">
<xs:attribute name="ip" type="stringType" use="optional"/>
<xs:attribute name="port" type="stringType" use="optional"/>
<xs:attribute name="access.path" type="stringType" use="optional"/>
<xs:attribute name="access.login" type="stringType" use="optional"/>
<xs:attribute name="access.passw" type="stringType" use="optional"/>
<xs:attribute name="attr.domain" type="stringType" use="optional"/>
<xs:attribute name="attr.phone" type="stringType" use="optional"/>
<xs:attribute name="attr.login" type="stringType" use="optional"/>
<xs:attribute name="attr.passw" type="stringType" use="optional"/>
<xs:attribute name="alive_timeout"
type="xs:nonNegativeInteger"
use="optional"/>
<xs:attribute name="enable" type="xs:boolean" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- resultType-->
<xs:complexType name="resultType">
<xs:all>
<xs:element name="domain_options" type="domainInfoOutType" minOccurs="1"/>
</xs:all>
</xs:complexType>
<!-- in-->
<xs:element name="in">
<xs:complexType>
<xs:sequence>
<xs:element name="request">
<xs:complexType>
<xs:all>
<xs:element name="domain_options" type="domainInfoInType" minOccurs="1"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- out -->
<xs:element name="out">
<xs:complexType>
<xs:choice>
<xs:element name="result" type="resultType"/>
<xs:element name="error" type="errorType"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/sip_ldap_info
<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sip_ldap_info.xsd">
<request>
<domain_options domain="biysk.local" />
</request>
</in>
Ответ: 200
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_ldap_info.xsd">
<result>
<domain_options>
<system>
<options xs:type="sipLDAPOptionsType"/>
</system>
<domain name="biysk.local">
<options xs:type="sipLDAPOptionsType" port="389" ip="localhost" enable="true" attr.phone="telephoneNumber" attr.passw="description" attr.login="cn" attr.domain="dc" alive_timeout="10000" access.path="ou=sip1,dc=ecss" access.passw="admin" access.login="cn=admin,dc=ecss"/>
</domain>
</domain_options>
</result>
</out>
Hc_ sip_ldap_set
Команда позволяет редактировать свойства LDAP кластера SIP.
Аналог команды в CoCon:
domain/<DOMAIN>/sip/ldap/set
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/sip_ldap_set
Код 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:annotation>
<xs:documentation xml:lang="en">
Set LDAP properties of SIP cluster.
Usage: http://server:9999/commands/sip_ldap_set.
Implementation: hc_sip_ldap_set.erl.
Git: git@git.eltex.loc:httpTerminal.git.
Copyright (c) 2014, Eltex. All rights reserved.
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="error.xsd"/>
<xs:include schemaLocation="ecm_common.xsd"/>
<!-- msExtensionType -->
<xs:simpleType name="msExtensionType">
<xs:restriction base="unionType">
<xs:enumeration value="header"/>
<xs:enumeration value="body"/>
</xs:restriction>
</xs:simpleType>
<!-- limitType -->
<xs:simpleType name="limitType">
<xs:restriction base="unionType">
<xs:enumeration value="none"/>
<xs:enumeration value="normal"/>
<xs:enumeration value="warning"/>
<xs:enumeration value="minor"/>
<xs:enumeration value="major"/>
<xs:enumeration value="critical"/>
<xs:enumeration value="fatal"/>
</xs:restriction>
</xs:simpleType>
<!-- sipLDAPOptionsType-->
<xs:complexType name="sipLDAPOptionsType">
<xs:complexContent>
<xs:extension base="baseOptionsType">
<xs:attribute name="ip" type="stringType" use="optional"/>
<xs:attribute name="port" type="stringType" use="optional"/>
<xs:attribute name="access.path" type="stringType" use="optional"/>
<xs:attribute name="access.login" type="stringType" use="optional"/>
<xs:attribute name="access.passw" type="stringType" use="optional"/>
<xs:attribute name="attr.domain" type="stringType" use="optional"/>
<xs:attribute name="attr.phone" type="stringType" use="optional"/>
<xs:attribute name="attr.login" type="stringType" use="optional"/>
<xs:attribute name="attr.passw" type="stringType" use="optional"/>
<xs:attribute name="alive_timeout"
type="xs:nonNegativeInteger"
use="optional"/>
<xs:attribute name="enable" type="xs:boolean" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- resultType-->
<xs:complexType name="resultType">
<xs:all>
<xs:element name="domain_options" type="domainSetOutType" minOccurs="1"/>
</xs:all>
</xs:complexType>
<!-- in-->
<xs:element name="in">
<xs:complexType>
<xs:sequence>
<xs:element name="request">
<xs:complexType>
<xs:all>
<xs:element name="domain_options" type="domainSetInType"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- out -->
<xs:element name="out">
<xs:complexType>
<xs:choice>
<xs:element name="result" type="resultType" minOccurs="1" maxOccurs="1"/>
<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/sip_ldap_set
<?xml version="1.0" encoding="UTF-8"?>
<in
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_ldap_set.xsd">
<request>
<domain_options>
<system>
<options xs:type="sipLDAPOptionsType"/>
</system>
<domain name="ct.office">
<options xs:type="sipLDAPOptionsType" ip="192.168.1.21" port="3890" access.path="ou=pa_sip,dc=ecss" access.login="cn=ecss_system,dc=ecss" access.passw="admin" attr.domain="dc" attr.phone="phoneNum" attr.login="cn" attr.passw="password1" enable="true" />
</domain>
</domain_options>
</request>
</in>
Ответ: 200
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_ldap_set.xsd">
<result>
<domain_options>
<system/>
<domain name="biysk.local">
<success option="access.login"/>
<success option="access.passw"/>
<success option="access.path"/>
<success option="attr.domain"/>
<success option="attr.login"/>
<success option="attr.passw"/>
<success option="attr.phone"/>
<success option="enable"/>
<success option="ip"/>
<success option="port"/>
</domain>
</domain_options>
</result>
</out>
Hc_sip_ldap_clean
Команда позволяет установить значение по умолчанию свойства LDAP кластера SIP.
Аналог команды в CoCon:
domain/<DOMAIN>/sip/ldap/clean
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/sip_ldap_clean
Код 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:annotation>
<xs:documentation xml:lang="en">
Clean LDAP properties of SIP cluster.
Usage: http://server:9999/commands/sip_ldap_clean.
Implementation: hc_sip_ldap_clean.erl.
Git: git@git.eltex.loc:httpTerminal.git.
Copyright (c) 2014, Eltex. All rights reserved.
</xs:documentation>
</xs:annotation>
<xs:include schemaLocation="error.xsd"/>
<xs:include schemaLocation="ecm_common.xsd"/>
<!-- resultType-->
<xs:complexType name="resultType">
<xs:all>
<xs:element name="domain_options" type="domainCleanOutType" minOccurs="1"/>
</xs:all>
</xs:complexType>
<!-- in-->
<xs:element name="in">
<xs:complexType>
<xs:sequence>
<xs:element name="request">
<xs:complexType>
<xs:all>
<xs:element name="domain_options" type="domainCleanInType"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- out -->
<xs:element name="out">
<xs:complexType>
<xs:choice>
<xs:element name="result" type="resultType" minOccurs="1" maxOccurs="1"/>
<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/sip_ldap_clean
<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_ldap_clean.xsd">
<request>
<domain_options>
<system />
<domain name="ct.office">
<option name="ip"/>
<option name="port"/>
<option name="access.path"/>
<option name="access.login"/>
<option name="access.passw"/>
<option name="attr.domain"/>
<option name="attr.phone"/>
<option name="attr.login"/>
<option name="attr.passw"/>
</domain>
</domain_options>
</request>
</in>
Ответ: 200
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_ldap_clean.xsd">
<result>
<domain_options>
<system/>
<domain name="ct.office">
<success option="access.login"/>
<success option="access.passw"/>
<success option="access.path"/>
<success option="attr.domain"/>
<success option="attr.login"/>
<success option="attr.passw"/>
<success option="attr.phone"/>
<success option="ip"/>
<success option="port"/>
</domain>
</domain_options>
</result>
</out>