Hc_media_zone_declare

Команда предназначена для создания нового идентификатора сети для медиа-сервера.

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

system/media/zone/declare

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

POST
http://host:port/commands/media_zone_declare

Коды ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

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

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">
            Declare zone.
            Usage: http://server:9999/commands/media_zone_declare.
            Implementation: hc_media_zone_declare.erl.
            Git: git@git.eltex.loc:httpTerminal.git.
            Copyright (c) 2016, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>

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

<!-- mediaZoneType -->
    <xs:complexType name="mediaZoneType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="mediaZoneResultType">
        <xs:attribute name="zone" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- resultType-->
    <xs:complexType name="resultType">
      <xs:choice maxOccurs="unbounded">
        <xs:sequence>
            <xs:element name="created" type="mediaZoneResultType" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="error" type="errorMediaZoneResultType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:choice>
    </xs:complexType>

    <xs:complexType name="errorMediaZoneResultType">
        <xs:attribute name="reason" type="xs:string" use="required"/>
        <xs:attribute name="property" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="zone" type="mediaZoneType" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </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>
CODE

Пример

http://192.168.1.21:9999/commands/media_zone_declare

Запрос:

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_zone_declare.xsd">
    <request>
        <zone name="core-zone1"/>
        <zone name="core-zone2"/>
        <zone name="core-zone3"/>
        <zone name="core-zone4"/>
        <zone name="core-zone5"/>
        <zone name="core-zone6"/>
    </request>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_zone_declare.xsd">
    <result>
        <created zone="core-zone1"/>
        <created zone="core-zone2"/>
        <created zone="core-zone3"/>
        <created zone="core-zone4"/>
        <created zone="core-zone5"/>
        <created zone="core-zone6"/>
    </result>
</out>
CODE

Hc_media_zone_list

Команда возвращает список идентификаторов сети для медиа-серверов.

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

system/media/zone/list

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

POST
http://host:port/commands/media_zone_list

Коды ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

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

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">
            List of zones.
            Usage: http://server:9999/commands/media_zone_list.
            Implementation: hc_media_zone_list.erl.
            Git: git@git.eltex.loc:httpTerminal.git.
            Copyright (c) 2016, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>

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

          
<!-- mediaZoneType -->
    <xs:complexType name="mediaZoneType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

          
    <!-- resultType-->
    <xs:complexType name="resultType">
      <xs:sequence>
        <xs:element name="zone" type="mediaZoneType" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType/>
                </xs:element>
            </xs:all>
        </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>
CODE

Пример

http://192.168.1.21:9999/commands/media_zone_list

Запрос:

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_media_zone_list.xsd">
    <request/>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_zone_list.xsd">
	<result>
		<zone name="core-zone1"/>
		<zone name="core-zone2"/>
		<zone name="core-zone3"/>
		<zone name="core-zone4"/>
		<zone name="core-zone5"/>
		<zone name="core-zone6"/>
		<zone name="default"/>
	</result>
</out>
CODE

Hc_media_zone_remove

Команда предназначена для удаление идентификатора сети для медиа-сервера.

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

system/media/zone/remove

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

POST
http://host:port/commands/media_zone_remove

Коды ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

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

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">
            Remove zone.
            Usage: http://server:9999/commands/media_zone_remove.
            Implementation: hc_media_zone_remove.erl.
            Git: git@git.eltex.loc:httpTerminal.git.
            Copyright (c) 2016, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>

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

<!-- mediaZoneType -->
    <xs:complexType name="mediaZoneType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="mediaZoneResultType">
        <xs:attribute name="zone" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- resultType-->
    <xs:complexType name="resultType">
      <xs:choice maxOccurs="unbounded">
        <xs:sequence>
            <xs:element name="deleted" type="mediaZoneResultType" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:choice>
    </xs:complexType>

    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="zone" type="mediaZoneType" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </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>
CODE

Пример

http://192.168.1.21:9999/commands/media_zone_remove

Запрос:

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_zone_remove.xsd">
    <request>
        <zone name="core-zone1"/>
        <zone name="core-zone2"/>
        <zone name="core-zone6"/>
        <zone name="core-zone7"/>
    </request>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_zone_remove.xsd">
	<result>
		<deleted zone="core-zone6"/>
		<deleted zone="core-zone2"/>
		<deleted zone="core-zone1"/>
		<error cmd="hc_media_zone_remove" reason="zone_not_found" entity="core-zone7"/>
	</result>
</out>
CODE