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

Hc_ gateway_sdp_template_declare

Команда предназначена для создания нового шаблона SDP.

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

/gateway/sdp-template/declare

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

POST

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

http://host:port/commands/gateway_sdp_template_declare

Код HTTP-ответа:

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

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:simpleType name = "nameType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="v"/>
            <xs:enumeration value="o"/>
            <xs:enumeration value="s"/>
            <xs:enumeration value="i"/>
            <xs:enumeration value="u"/>
            <xs:enumeration value="e"/>
            <xs:enumeration value="p"/>
            <xs:enumeration value="c"/>
            <xs:enumeration value="b"/>
            <xs:enumeration value="z"/>
            <xs:enumeration value="k"/>
            <xs:enumeration value="a"/>
            <xs:enumeration value="t"/>
            <xs:enumeration value="r"/>
            <xs:enumeration value="m"/>
        </xs:restriction>
    </xs:simpleType>

          
    <xs:complexType name="sdp-templateType">
        <xs:sequence>
            <xs:element name="property" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="name" type="nameType" use="required"/>
                    <xs:attribute name="value" type="xs:string" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

          
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="sdp-template" type="sdp-templateType" minOccurs="1" />
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_sdp_template_declare

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_sdp_template_declare.xsd">
    <sdp-template domain="p.city" name="template4">
        <property name="a" value="123" />
        <property name="b" value="[1, 2, 3]" />
    </sdp-template>
</in>

Hc_ gateway_sdp_template_remove

Команда предназначена для удаления шаблона SDP.

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

/gateway/sdp-template/remove

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

POST

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

http://host:port/commands/gateway_sdp_template_remove

Код HTTP-ответа:

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

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="templateType">
        <xs:attribute  name="domain" type="xs:string" use="required"/>
        <xs:attribute  name="name" type="xs:string" use="required"/>
    </xs:complexType>

          
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="template" type="templateType" minOccurs="1"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_sdp_template_remove

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_sdp_template_remove.xsd">
    <template domain="p.city" name="template1" />
</in>

Может вернуть модал:

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="modal.xsd">
    <modal ref="{md@sky,{1315,393114,432462}}" from="remove" 
           header="SDP template "template1" is used in gateway(s) ["gw1"]. Before remove SDP template the system remove it from the gateways." 
           passwd="false" results="yesno" error="You should enter 'yes' or 'no'." prompt="Are you sure"/>
</out>

Hc_ gateway_sdp_template_info

Команда предназначена для просмотра информации по имеющимся шаблонам SDP.

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

/gateway/sdp-template/info

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

POST

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

http://host:port/commands/gateway_sdp_template_info

Код HTTP-ответа:

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

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="sdp-templateType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="optional"/>
    </xs:complexType>
    <xs:complexType name="sdp-templateOutType">
        <xs:sequence>
            <xs:element name="property" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="name" type="xs:string" use="required"/>
                    <xs:attribute name="value" type="xs:string" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="returnType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="sdp-template" type="sdp-templateType" minOccurs="1"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="sdp-template" type="sdp-templateOutType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример 1:

Запрос: http://192.168.23.34:9999/commands/gateway_sdp_template_info

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="../priv/xsd/gateway_sdp_template_info.xsd">
    <sdp-template domain="p.city" name="template1" />
</in>

Ответ:

<?xml version="1.0"?><out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_sdp_template_info.xsd">
    <sdp-template name="template1">
        <property name="c" value="123"/>
        <property name="t" value="1234"/>
    </sdp-template>
</out>

Пример 2:

Запрос: http://192.168.23.34:9999/commands/gateway_sdp_template_info

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="../priv/xsd/gateway_sdp_template_info.xsd">
    <sdp-template domain="p.city" />
</in>

Ответ:

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_sdp_template_info.xsd">
    <sdp-template name="template4">
        <property name="b" value="434"/>
    </sdp-template>
    <sdp-template name="template1">
        <property name="c" value="123"/>
        <property name="t" value="1234"/>
    </sdp-template>
    <sdp-template name="template3"/>
</out>

Hc_ gateway_sdp_template_set

Команда предназначена для установки свойств определенного шаблона SDP.

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

/gateway/sdp-template/set

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

POST

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

http://host:port/commands/gateway_sdp_template_set

Код HTTP-ответа:

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

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="error.xsd" />

          
    <xs:simpleType name = "nameType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="v"/>
            <xs:enumeration value="o"/>
            <xs:enumeration value="s"/>
            <xs:enumeration value="i"/>
            <xs:enumeration value="u"/>
            <xs:enumeration value="e"/>
            <xs:enumeration value="p"/>
            <xs:enumeration value="c"/>
            <xs:enumeration value="b"/>
            <xs:enumeration value="z"/>
            <xs:enumeration value="k"/>
            <xs:enumeration value="a"/>
            <xs:enumeration value="t"/>
            <xs:enumeration value="r"/>
            <xs:enumeration value="m"/>
        </xs:restriction>
    </xs:simpleType>

          
    <xs:complexType name="sdp-templateType">
        <xs:sequence>
            <xs:element name="property" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="name" type="nameType" use="required"/>
                    <xs:attribute name="value" type="xs:string" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

          
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="sdp-template" type="sdp-templateType" minOccurs="1" />
            </xs:all>
        </xs:complexType>
    </xs:element>

          
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="error" type="errorType" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_sdp_template_set

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_sdp_template_set.xsd">
    <sdp-template domain="p.city" name="profile4">
        <property name="a" value="123" />
        <property name="b" value="[1, 2, 3]" />
    </sdp-template>
</in>
  • Нет меток