Дерево страниц
Перейти к концу метаданных
Переход к началу метаданных

Hc_check_connection

Команда проверки доступности БД портала абонента.

Аналог команды в CoCon:

domain/<DOMAIN>/subscriber-portal/check-connection

Шаблон HTTP-запроса:

http://server:9999/commands/check_connection

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="hc_check_connection">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Command for checking connection to subscriber portal database.
            Copyright (C) 2014, Eltex. All right reserved.
        </xs:documentation>
    </xs:annotation>

          
    <xs:include schemaLocation="error.xsd" />
    <xs:include schemaLocation="ecm_common.xsd" />

          
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:attribute name="storage" type="nonEmptyTokenType" use="optional">
                            <xs:annotation>
                                <xs:documentation xml:lang="en">
                                    Deprecated attribute.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="domain" type="nonEmptyTokenType" use="optional" />
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- in -->

          
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="success" minOccurs="1" maxOccurs="1" />
                <xs:element name="error" type="errorType" minOccurs="1" maxOccurs="1" />
            </xs:choice>
        </xs:complexType>
    </xs:element>
    <!-- out -->
</xs:schema>

Пример: 

Запрос: http://192.168.1.21:9999/commands/check_connection

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_check_connection.xsd">
    <request domain="biysk.local" />
</in>

Ответ:

Соединение с базой успешно установлено:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_check_connection.xsd">
    <success/>
</out>

При соединении произошла ошибка (недоступна выбранная база):

<?xml version="1.0" encoding="UTF-8"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_check_connection.xsd">
    <error cmd="check-connection" reason="db_error" body="failed_changing_database" />
</out>

Hc_sp_properties_list

Команда просмотра свойств портала абонентов для всех виртуальных АТС.

Аналог команды в CoCon:

domain/<DOMAIN>/subscriber-portal/properties/info

Шаблон URL-запроса:

http://server:9999/commands/sp_properties_list

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="sp_properties_list">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Get list of subscriber portal properties for all active domains in cluster.
            Usage: http://server:9999/commands/sp_properties_list.
            Implementation: hc_sp_properties_list.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" />

          
<!-- Types -->

          
    <!-- request -->
    <xs:complexType name="requestType">
        <xs:attribute name="storage" type="nonEmptyTokenType" use="optional">
            <xs:annotation>
                <xs:documentation xml:lang="en">
                    Deprecated attribute.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="domain" type="nonEmptyTokenType" use="optional" />
    </xs:complexType>
    <!-- request -->

          
    <!-- successful response -->
    <!-- spPropertiesType-->
    <xs:complexType name="spDomainPropertiesType">
        <xs:complexContent>
            <xs:extension base="baseOptionsType">
              <xs:attribute name="auto_create_account" type="xs:boolean" use="optional" />
              <xs:attribute name="auto_delete_account" type="xs:boolean" use="optional" />
              <xs:attribute name="connection" type="xs:normalizedString" use="optional" />
              <xs:attribute name="web_sp_server" type="xs:normalizedString" use="optional" />
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <!-- successful response -->

          
    <!-- resultType-->
    <xs:complexType name="resultType">
        <xs:all>
            <xs:element name="domain_options" type="domainInfoOutType" minOccurs="1"/>
        </xs:all>
    </xs:complexType>

          
<!-- Root elements -->

          
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" type="requestType" minOccurs="1" maxOccurs="1" />
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- in -->

          
    <!-- 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>
    <!-- out -->

          
</xs:schema>

Пример:

Запрос:
http://192.168.1.21:9999/commands/sp_properties_list

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_list.xsd">
    <request storage="ds1" />
</in>

Ответ:

Успешный запрос.

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_list.xsd">
    <result>
        <domain_options>
            <system>
                <options xs:type="spDomainPropertiesType" web_sp_server="http://subscriberportal.ecss:81/" connection="Host: 192.168.1.71; Port: 3306; Login: subscribers; Password: subscribers; Database: ecss_subscribers" auto_delete_account="true" auto_create_account="true"/>
            </system>
            <domain name="ct.office">
                <options xs:type="spDomainPropertiesType" connection="Host: localhost; Port: 3306; Login: subscribers; Password: subscribers; Database: ecss_subscribers" auto_delete_account="true" auto_create_account="true"/>
            </domain>
            <domain name="biysk.local">
                <options xs:type="spDomainPropertiesType" connection="Host: 192.168.1.71; Port: 3306; Login: subscribers; Password: subscribers; Database: ecss_subscribers" auto_delete_account="true" auto_create_account="true"/>
            </domain>
        </domain_options>
    </result>
</out>

Ошибка при выполнении запроса:

<?xml version="1.0" encoding="UTF-8"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_list.xsd">
    <error cmd="sp_properties_list" reason="error" body="test" />
</out>

Hc_sp_properties_set

Команда для редактирования свойств портала абонентов.

Аналог команды в CoCon:

domain/<DOMAIN>/subscriber-portal/properties/set

Шаблон URL-запроса:

http://server:9999/commands/sp_properties_set

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="sp_properties_list">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Set properties of subscriber portal.
            Usage: http://server:9999/commands/sp_properties_set.
            Implementation: hc_sp_properties_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" />

          
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="set" minOccurs="1" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:attribute name="property" type="nonEmptyTokenType" use="required" />
                                    <xs:attribute name="value" type="xs:normalizedString" use="required" />
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="storage" type="nonEmptyTokenType" use="optional">
                            <xs:annotation>
                                <xs:documentation xml:lang="en">
                                    Deprecated attribute.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="domain" type="nonEmptyTokenType" use="optional" />
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- in -->

          
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
                <xs:element name="success" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:attribute name="property" type="xs:token" use="required" />
                        <xs:attribute name="old_value" type="xs:normalizedString" use="required" />
                        <xs:attribute name="new_value" type="xs:normalizedString" use="required" />
                    </xs:complexType>
                </xs:element>
                <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out -->
</xs:schema>

Пример:

Запрос:
http://192.168.1.21:9999/commands/sp_properties_set

Изменение всех свойств домена biysk.local:

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_set.xsd">
    <request storage="ds1" domain="biysk.local">
        <set property="auto_create_account" value="true" />
        <set property="auto_delete_account" value="true" />
        <set property="connection" value="Host: localhost; Port: 3306; Login: user; Password: secret; Database: test" />
    </request>
</in>

Результат запроса:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_set.xsd">
    <success property="auto_create_account" old_value="true" new_value="true"/>
    <success property="auto_delete_account" old_value="true" new_value="true"/>
    <success property="connection" old_value="{"192.168.1.71",3306,"subscribers","subscribers","ecss_subscribers"}" new_value="{"localhost",3306,"user","secret","test"}"/>
</out>

Hc_sp_properties_clean

Команда для сброса политики работы с порталом абонентов.

Аналог команды в CoCon:

domain/<DOMAIN>/subscriber-portal/properties/clean

Шаблон URL-запроса:

http://server:9999/commands/sp_properties_clean

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="sp_properties_clean">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Reset to default properties of subscriber portal.
            Usage: http://server:9999/commands/sp_properties_clean.
            Implementation: hc_sp_properties_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" />

          
<!-- Root elements -->

          
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                            <xs:element name="clean" minOccurs="0" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:attribute name="property" type="nonEmptyTokenType" use="required"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="storage" type="nonEmptyTokenType" use="optional">
                            <xs:annotation>
                                <xs:documentation xml:lang="en">
                                    Deprecated attribute.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="domain" type="nonEmptyTokenType" use="optional" />
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- in -->

          
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence minOccurs="0" maxOccurs="unbounded">
                <xs:element name="success" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:attribute name="property" type="nonEmptyTokenType" use="required" />
                    </xs:complexType>
                </xs:element>
                <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out -->

          
</xs:schema>

Пример:

Запрос на сброс всех свойств:
http://192.168.1.21:9999/commands/sp_properties_clean

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_clean.xsd">
    <!-- Сбросить все свойства для всех доменов -->
    <request storage="ds1" />
</in>

Сброс всех свойств, второй вариант (если указать домен, будут сброшены все свойства для этого домена):

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_clean.xsd">
    <!-- Сбросить все свойства для всех доменов, второй вариант -->
    <request storage="ds1" domain="biysk.local" />
</in>

Ответ на запрос о сбросе всех свойств:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_clean.xsd">
    <success property="all"/>
</out>

Запрос на сброс некоторых свойств для домена:

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_clean.xsd">
    <!-- Сбросить перечисленные свойства для d.local -->
    <request storage="ds1" domain="biysk.local">
        <clean property="auto_create_account" />
        <clean property="auto_delete_account" />
    </request>
</in>

Ответ на запрос о сбросе некоторых свойств для определенного домена:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_clean.xsd">
    <success property="auto_create_account"/>
    <success property="auto_delete_account"/>
</out>

Ответ на запрос о сбросе трех свойств, при обработке одного из которых произошла ошибка:

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_properties_clean.xsd">
    <success property="auto_create_account"/>
    <success property="auto_delete_account"/>
    <error cmd="sp_properties_clean" reason="error" body="{error,{}}" entity="connection"/>
</out>

Hc_sync

Синхронизация алиасов ECSS-10 с порталом абонентов.

Аналог команды в CoCon:

domain/<DOMAIN>/subscriber-portal/sync

Шаблон URL-запроса:

http://server:9999/commands/sync

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="sync">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Synchronizing aliases of local softswitch and aliases of subscriber portal.
            Usage: http://server:9999/commands/sync.
            Copyright (c) 2014, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>

          
    <xs:include schemaLocation="error.xsd" />
    <xs:include schemaLocation="ecm_common.xsd" />

          
    <!-- resultType -->
    <xs:simpleType name="resultType">
        <xs:restriction base="xs:token">
            <xs:enumeration value="ok" />
            <xs:enumeration value="already_exists" />
            <xs:enumeration value="error" />
        </xs:restriction>
    </xs:simpleType>
    <!-- /resultType -->

          
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:attribute name="domain" type="nonEmptyTokenType" use="required" />
                        <xs:attribute name="address_range" type="nonEmptyTokenType" use="required" />
                        <xs:attribute name="iface_range" type="nonEmptyTokenType" use="required" />
                        <xs:attribute name="password" type="nonEmptyTokenType" use="optional" />
                        <xs:attribute name="verbose" type="xs:boolean" use="optional" />
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- /in -->

          
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="results" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="result" minOccurs="0" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:attribute name="alias" type="xs:string" use="required" />
                                    <xs:attribute name="login" type="xs:string" use="required" />
                                    <xs:attribute name="password" type="xs:string" use="required" />
                                    <xs:attribute name="result" type="resultType" use="required" />
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="success" type="xs:nonNegativeInteger" use="required" />
                        <xs:attribute name="fail" type="xs:nonNegativeInteger" use="required" />
                        <xs:attribute name="total" type="xs:nonNegativeInteger" use="required" />
                    </xs:complexType>
                </xs:element>
                <xs:element name="error" type="errorType" minOccurs="1" maxOccurs="1" />
            </xs:choice>
        </xs:complexType>
    </xs:element>
    <!-- /out -->
</xs:schema>

Пример:

Запрос:
http://server:9999/commands/sync

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sync.xsd">
    <request domain="d.local" 
             address_range="73{0-9}" 
             iface_range="73{0-9}@d.local" 
             password="password" 
             verbose="true" />
</in>

Ответ:

Успешный запрос:

<?xml version="1.0" encoding="UTF-8"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sync.xsd">
    <results success="2" fail="1" total="3">
        <result alias="730, 730@d.local" login="730" password="password" result="ok" />
        <result alias="731, 731@d.local" login="731" password="password" result="already_exists" />
        <result alias="732, 732@d.local" login="732" password="password" result="error" />
    </results>
</out>

Ошибка при выполнении запроса:

<?xml version="1.0" encoding="UTF-8"?><out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sync.xsd">
    <error cmd="sync" reason="no_enough_addresses" body="{}"/>
</out>
  • Нет меток