Дерево страниц

Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

Оглавление

Hc_cluster_info

Команда позволяет вывести информацию о кластере.

...

Блок кода
<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="../priv/xsd/cluster_info.xsd">
    <cluster name="ds" role="storage" active="true">
        <nodes>
            <node name="ds@naomi"/>
            <node name="ds2@naomi"/>
            <node name="ds4@ryabkov"/>
        </nodes>
        <properties>
            <property name="prop1" value="value1"/>
            <property name="prop2" value="value3"/>
            <property name="prop3" value="[v,v1,v2]"/>
            <property name="asdf" value="asdf"/>
        </properties>
    </cluster>
</out>

Hc_list_of_adapter_clusters

Команда позволяет вывести список кластеров, определенных в системе с ролью adapter определенного типа (SIP, Megaco).

...

Блок кода
<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_list_of_adapter_clusters.xsd">
    <adapters>
        <adapter name="sip1" type="sip" active="true"/>
    </adapters>
</out>

Hc_get_cluster_properties

Команда позволяет вывести свойства кластера. Команда возвращает информацию, что и команда "Информация о кластере", только в другом формате.

...

Блок кода
<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="cluster_properties.xsd">
    <cluster name="ds1" role="storage">
        <properties>
            <property name="nodes" value="[ds1@ecss1,ds1@ecss2]"/>
            <property name="isActive" value="true"/>
        </properties>
    </cluster>
</out>

Hc_cluster_set

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

...

Блок кода
<?xml version="1.0" encoding="UTF-8"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="common_error.xsd">
    <error cmd="cluster_set" reason="no_rights" body="{not_authorized,no_rights}"/>
</out>

Hc_cluster_clear

Команда позволяет удалить свойство кластера (одного или все).

...

Блок кода
<?xml version="1.0" encoding="UTF-8"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="common_error.xsd">
    <error cmd="cluster_clear" reason="no_rights" body="{not_authorized,no_rights}"/>
</out>

Hc_clusters_list

Команда возвращает список кластеров, определенных в системе.

...

Блок кода
<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_list_of_clusters.xsd">
    <clusters>
        <cluster name="ds1" role="storage" active="true"/>
        <cluster name="core1" role="core" active="true"/>
        <cluster name="md1" role="mediator" active="true"/>
        <cluster name="sip1" role="adapter" active="true"/>
        <cluster name=".system_bridge" role="adapter" active="true"/>
        <cluster name=".virtual" role="adapter" active="true"/>
        <cluster name="megaco1" role="adapter" active="false"/>
    </clusters>
</out>

Hc_cluster_properties

Команда возвращает свойства кластера. Hc_cluster_properties возвращает ту же информацию, что и команда Hc_cluster_info, только в другом формате.

...

Блок кода
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="common.xsd"/>
    <!-- nodeType-->
    <xs:complexType name="nodeType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- propertyType-->
    <xs:complexType name="propertyType">
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="value" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- clusterType -->
    <xs:complexType name="clusterType">
        <xs:all>
            <xs:element name="properties">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:all>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="role" type="roleType" use="required"/>
    </xs:complexType>
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="cluster">
                    <xs:complexType>
                        <xs:attribute name="storage" type="xs:string" use="required"/>
                        <xs:attribute name="role" type="roleType" use="required"/>
                        <xs:attribute name="name" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="cluster" type="clusterType" minOccurs="1" maxOccurs="1"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

common.xsd: 

См. страницу Hc_cluster_info.

Пример:

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

...