Hс_sip_cluster_network_clean

Команда позволяет восстановить в значение по умолчанию сетевые настройки SIP адаптера на уровне кластера.

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

cluster/adapter/<SIP_ADAPTER>/sip/network/clean

Метод HTTP-запроса:

POST

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

http://host:port/commands/sip_cluster_network_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 network properties of SIP cluster.
            Usage: http://server:9999/commands/sip_cluster_nerwork_clean.
            Implementation: hc_sip_general_clean.erl.
            Git: git@git.eltex.loc:httpTerminal.git.
            Copyright (c) 2015, 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="cluster_options" type="clusterCleanOutType" 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="cluster_options" type="clusterCleanInType"/>
                        </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>

XML

Пример

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

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_cluster_network_clean.xsd">
    <request>
        <cluster_options>
            <cluster name="sip1">
                <option name="ip_set"/>
            </cluster>
        </cluster_options>
    </request>
</in>
XML


Ответ: 200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_cluster_network_clean.xsd">
    <result>
        <cluster_options>
            <cluster name="sip1">
                <success option="ip_set"/>
            </cluster>
        </cluster_options>
    </result>
</out>
XML

Hс_sip_cluster_network_info

Команда позволяет получить сетевые настройки SIP адаптера на уровне кластера.

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

cluster/adapter/<SIP_ADAPTER>/sip/network/info

Метод HTTP-запроса:

POST

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

http://host:port/commands/sip_cluster_network_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 network settings of SIP cluster.
            Usage: http://server:9999/commands/sip_cluster_network_info.
            Implementation: hc_sip_cluster_network_info.erl.
            Git: git@git.eltex.loc:httpTerminal.git.
            Copyright (c) 2015, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>
    <xs:include schemaLocation="error.xsd"/>
    <xs:include schemaLocation="ecm_common.xsd"/>
    <!-- sipClusterNetworkOptionsType -->
    <xs:complexType name="sipClusterNetworkOptionsType">
        <xs:complexContent>
            <xs:extension base="baseOptionsType">
                <xs:attribute name="ip_set" type="stringType" use="optional">
                    <xs:annotation>
                        <xs:documentation xml:lang="en">
                            Format:
                                IpSetName_1:Port_11,Port_12,...:DSCP_1:Node_11#Host_11,Node_12#Host_12,...;IpSetName_2:Port_21,Port_22,...:DSCP_2:Node_21#Host_21,Node_22#Host_22,...;...
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <!-- resultType -->
    <xs:complexType name="resultType">
        <xs:all>
            <xs:element name="cluster_options" type="clusterInfoOutType" 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="cluster_options" type="clusterInfoInType" 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>

XML

Пример

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

<?xml version="1.0"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sip_cluster_network_info.xsd">
  <request>
    <cluster_options cluster="sip1" />
  </request>
</in>
XML


Ответ: 200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_cluster_network_info.xsd">
    <result>
        <cluster_options>
            <cluster name="sip1">
                <options xs:type="sipClusterNetworkOptionsType" ip_set="ipset1:5060,5061,5062,5063,5064,5065,5070,5071,5072,5073,5074,5075:24:sip1@ecss1#192.168.2.61,sip1@ecss2#192.168.2.62;ipset2:5090,5091:0:sip1@ecss1#192.168.2.61,sip1@ecss2#127.0.0.1"/>
            </cluster>
        </cluster_options>
    </result>
</out>
XML

Hс_sip_cluster_network_set

Команда позволяет перезаписать все текущие сетевые настройки (ip-sets) SIP адаптера на уровне кластера. .


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

cluster/adapter/<SIP_ADAPTER>/sip/network/set

Метод HTTP-запроса:

POST

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

http://host:port/commands/sip_cluster_network_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 network properties of SIP cluster.
            Usage: http://server:9999/commands/sip_cluster_network_set.
            Implementation: hc_sip_general_set.erl.
            Git: git@git.eltex.loc:httpTerminal.git.
            Copyright (c) 2015, Eltex. All rights reserved.
        </xs:documentation>
	</xs:annotation>
	<xs:include schemaLocation="error.xsd"/>
	<xs:include schemaLocation="ecm_common.xsd"/>
	<!-- sipClusterNetworkOptionsType -->
	<xs:complexType name="sipClusterNetworkOptionsType">
		<xs:complexContent>
			<xs:extension base="baseOptionsType">
				<xs:attribute name="ip_set" type="stringType" use="optional">
					<xs:annotation>
						<xs:documentation xml:lang="en">
                            Format:
							IpSetName_1:Port_11,Port_12,...:DSCP_1:Node_11#Host_11,Node_12#Host_12,...;IpSetName_2:Port_21,Port_22,...:DSCP_2:Node_21#Host_21,Node_22#Host_22,...;...
                        </xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- resultType-->
	<xs:complexType name="resultType">
		<xs:all>
			<xs:element name="cluster_options" type="clusterSetOutType"/>
		</xs:all>
	</xs:complexType>
	<!-- in-->
	<xs:element name="in">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="request">
					<xs:complexType>
						<xs:all>
							<xs:element name="cluster_options" type="clusterSetInType"/>
						</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>

XML

Пример

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

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_cluster_network_set.xsd">
    <request>
        <cluster_options>
            <cluster name="sip1">
                <options xs:type="sipClusterNetworkOptionsType" ip_set="ipset1:5060,5061,5062,5063,5064,5065,5071,5072,5073,5074,5075:sip1@ecss1#192.168.2.61,sip1@ecss2#192.168.2.62;ipset2:5080,5081,5082:24:sip1@ecss1#192.168.2.61,sip1@ecss2#192.168.2.62;"/>
            </cluster>
        </cluster_options>
    </request>
</in>
XML

Код ответа:
200

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_cluster_network_set.xsd">
    <result>
        <cluster_options>
            <cluster name="sip1">
                <success option="ip_set"/>
            </cluster>
        </cluster_options>
    </result>
</out>
XML