Hc_domain_ldap - Команды управления LDAP/AD сервером
hc_domain_ldap_declare
Команда позволяет создавать новую конфигурации до LDAP/AD сервера.
Аналог команды в CoCon:
/domain/<DOMAIN>/ldap/declare
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_ldap_declare
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запрса/ответа:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:include schemaLocation="error.xsd"/>
<xs:include schemaLocation="ecm_common.xsd"/>
<xs:complexType name="ldapOptionsType">
<xs:complexContent>
<xs:extension base="baseOptionsType">
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="host" type="xs:string"/>
<xs:attribute name="port" type="xs:string"/>
<xs:attribute name="dc_or_domain" type="xs:string"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="responseType">
<xs:attribute name="result" type="xs:string"/>
</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="response" type="responseType"/>
<xs:element name="error" type="errorType"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/domain_ldap_declare
<in
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_domain_ldap_declare.xsd">
<request>
<domain_options>
<system>
<options xs:type="ldapOptionsType"/>
</system>
<domain name="test">
<options dc_or_domain="test" host="ldap.maas.eltex.loc" id="maas.eltex.loc" port="3899" type="LDAP" DC_OR_DOMAIN ="dc=eltex,dc=loc" ssl="true" xs:type="ldapOptionsType"/>
</domain>
</domain_options>
</request>
</in>
Ответ: 200
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_domain_ldap_declare.xsd">
<response result="ok"/>
</out>
hc_domain_ldap_info
Команда позволяет просматривать новую конфигурации до LDAP/AD сервера.
Аналог команды в CoCon:
/domain/<DOMAIN>/ldap/info
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_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">
<xs:include schemaLocation="error.xsd"/>
<xs:complexType name="ldapOptionsType">
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="host" type="xs:string"/>
<xs:attribute name="domain" type="xs:string"/>
<xs:attribute name="port" type="xs:string"/>
<xs:attribute name="use_ssl" type="xs:boolean"/>
<xs:attribute name="base_search_dn" type="xs:string"/>
<xs:attribute name="login_attribute" type="xs:string"/>
<xs:attribute name="recursive_search" type="xs:boolean"/>
<xs:attribute name="search_auth" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">
usage:
anonymous | Login:Password
In case of strong security restrictions password may be shown as ********
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="sync_auth" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">
usage:
anonymous | Login:Password
In case of strong security restrictions password may be shown as ********
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ssl_certificate" type="xs:string"/>
</xs:complexType>
<!-- resultType-->
<xs:complexType name="resultType">
<xs:sequence minOccurs="0">
<xs:element name="options" type="ldapOptionsType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- in-->
<xs:element name="in">
<xs:complexType>
<xs:sequence>
<xs:element name="request">
<xs:complexType>
<xs:attribute name="domain" type="xs:string"/>
</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/domain_ldap_info
<in
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_domain_ldap_info.xsd">
<request domain="test"/>
</in>
Ответ: 200
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_domain_ldap_info.xsd">
<result>
<options xs:type="ldapOptionsType" type="ldap" id="1" host="192.168.1.12" port="default" base_search_dn="dc" login_attribute="uid" recursive_search="true" search_auth="user1:********" use_ssl="false" ssl_certificate="undefined"/>
</result>
</out>
hc_domain_ldap_remove
Команда для удаления настроек конфигурации до LDAP/AD сервера
Аналог команды в CoCon:
/domain/<DOMAIN>/ldap/remove
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_ldap_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">
<xs:include schemaLocation="error.xsd"/>
<xs:complexType name="responseType">
<xs:attribute name="result" type="xs:string"/>
</xs:complexType>
<!-- in-->
<xs:element name="in">
<xs:complexType>
<xs:sequence>
<xs:element name="request">
<xs:complexType>
<xs:sequence>
<xs:element name="connection" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</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" type="responseType"/>
<xs:element name="error" type="errorType"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/domain_ldap_remove
<in
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_domain_ldap_remove.xsd">
<request domain="test">
<connection id="maas.eltex.loc"/>
</request>
</in>
Ответ: 200
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_domain_ldap_remove.xsd">
<response result="ok"/>
</out>
hc_domain_ldap_set
Команда для изменения настроек конфигурации до LDAP/AD сервера
Аналог команды в CoCon:
/domain/<DOMAIN>/ldap/set
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_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">
<xs:include schemaLocation="error.xsd"/>
<xs:complexType name="ldapOptionsType">
<xs:attribute name="host" type="xs:string"/>
<xs:attribute name="port" type="xs:string"/>
<xs:attribute name="use_ssl" type="xs:boolean"/>
<xs:attribute name="base_search_dn" type="xs:string"/>
<xs:attribute name="login_attribute" type="xs:string"/>
<xs:attribute name="recursive_search" type="xs:boolean"/>
<xs:attribute name="domain" type="xs:string"/>
<xs:attribute name="ssl_certificate" type="xs:string"/>
<xs:attribute name="search_auth" type="xs:string"/>
<xs:attribute name="sync_auth" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">
search_auth example:
search_auth="anonymous";
search_auth="uid=test,ou=System,dc=eltex,dc=loc:test123"
sync_auth example:
search_auth="login:password"
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="successType">
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="property" type="xs:string"/>
</xs:complexType>
<!-- resultType-->
<xs:complexType name="resultType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:choice>
<xs:element name="success" type="successType" maxOccurs="unbounded"/>
<xs:element name="error" type="errorType" maxOccurs="unbounded"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:complexType name="connectionType">
<xs:sequence minOccurs="0">
<xs:element name="options" type="ldapOptionsType" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
<!-- in-->
<xs:element name="in">
<xs:complexType>
<xs:sequence>
<xs:element name="request">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="connection" type="connectionType" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="domain" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- out -->
<xs:element name="out">
<xs:complexType>
<xs:all>
<xs:element name="result" type="resultType"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/domain_ldap_set
<in
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_domain_ldap_set.xsd">
<request domain="test">
<connection id="maas.eltex.loc">
<options host="ldap.maas.eltex.loc" port="3896" />
</connection>
</request>
</in>
Ответ: 200
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_domain_ldap_set.xsd">
<result>
<success id="maas.eltex.loc" property="port"/>
<success id="maas.eltex.loc" property="host"/>
</result>
</out>