Hс_ds_cmds_lists_declare

Команда создает новый список. Параметры description и number можно не задавать.

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

domain/<DOMAIN>/lists/declare

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

POST

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

http://host:port/commands/ds_cmds_lists_declare

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

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

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">
      Declare list of number.
      Usage: http://server:9999/commands/ds_cmds_lists_declare.
      Implementation: hc_ds_cmds_lists_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"/>

  <!-- numberType -->  
  <xs:complexType name="numberType">
    <xs:attribute name="value" type="xs:string" use="required"/>
  </xs:complexType>
 
  <!-- listType -->
  <xs:complexType name="listType">
    <xs:sequence>
      <xs:element name="number" type="numberType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required"/>
    <xs:attribute name="description" type="xs:string" use="optional"/>
    <xs:attribute name="type" type="xs:string" use="optional"/>
  </xs:complexType>

  <!-- request -->
  <xs:complexType name="requestType">
    <xs:sequence>
      <xs:element name="list" type="listType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="domain" type="xs:string" use="required"/> 
  </xs:complexType>

  <!-- in -->
  <xs:element name="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request" type="requestType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <!-- out -->
  <xs:element name="out">
    <xs:complexType>
      <xs:choice>
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

</xs:schema>
XML

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ds_cmds_lists_declare.xsd">
	<request domain="biysk.local">
		<list name="ListName" description="NewList" type="blf" >
			<number value="240545"/>
			<number value="416977"/>
			<number value="83852352804"/>
		</list>
	</request>
</in>
XML

Ответ: 201

Hс_ds_cmds_lists_info

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

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

domain/<DOMAIN>/lists/info

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

POST

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

http://host:port/commands/ds_cmds_lists_info

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

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

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 list number with description.
      Usage: http://server:9999/commands/ds_cmds_lists_info.
      Implementation: hc_ds_cmds_lists_info.erl.
      Git: git@git.eltex.loc:httpTerminal.git.
      Copyright (c) 2016, Eltex. All rights reserved.
    </xs:documentation>
  </xs:annotation>

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

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

  <!-- request -->
  <xs:complexType name="requestType">
    <xs:sequence>
      <xs:element name="list" type="listTypeIn" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="domain" type="xs:string" use="required"/> 
  </xs:complexType>

  <!-- in -->
  <xs:element name="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request" type="requestType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

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

  <!-- listTypeOUt -->
    <xs:complexType name="listTypeOut">
      <xs:sequence>
        <xs:element name="number" type="numberType" maxOccurs="unbounded" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute name="name" type="xs:string" use="required"/>
      <xs:attribute name="description" type="xs:string" use="required"/>
      <xs:attribute name="type" type="xs:string" use="optional"/>
    </xs:complexType>

  <!-- resultType -->
  <xs:complexType name="resultType">
    <xs:sequence>
      <xs:element name="list" type="listTypeOut" maxOccurs="unbounded" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <!-- out -->
  <xs:element name="out">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="result" type="resultType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>
XML

Пример

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

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

Ответ

<?xml version="1.0"?>
<out
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ds_cmds_lists_info.xsd">
	<result>
		<list name="debt_rate2" description="debt_rate2" type="default">
			<number value="416977" priority="normal"/>
			<number value="240465" priority="normal"/>
			<number value="240464" priority="normal"/>
			<number value="240101" priority="normal"/>
		</list>
	</result>
</out>
XML

Hс_ds_cmds_lists_list

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

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

domain/<DOMAIN>/lists/list

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

POST

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

http://host:port/commands/ds_cmds_lists_list

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

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

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 list of number lists.
      Usage: http://server:9999/commands/ds_cmds_lists_list.
      Implementation: hc_ds_cmds_lists_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"/>

  <!-- request -->
  <xs:complexType name="requestType">
    <xs:attribute name="domain" type="xs:string" use="required"/> 
    <xs:attribute name="type" type="xs:string" use="optional"/>
  </xs:complexType>

  <!-- in -->
  <xs:element name="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request" type="requestType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>


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

  <!-- resultType -->
  <xs:complexType name="resultType">
    <xs:sequence>
      <xs:element name="list" type="listType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>

  <!-- out -->
  <xs:element name="out">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="result" type="resultType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>
XML

Пример

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

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

Ответ

<?xml version="1.0"?>
<out
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ds_cmds_lists_list.xsd">
	<result>
		<list name="debt_rate2" description="debt_rate2" type="default"/>
		<list name="ListName" description="NewList" type="blf"/>
	</result>
</out>
XML

Hс_ds_cmds_lists_number_add

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

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

domain/<DOMAIN>/lists/numbers-add

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

POST

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

http://host:port/commands/ds_cmds_lists_number_add

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

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

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">
      Add specified numbers to exist list.
      Usage: http://server:9999/commands/ds_cmds_lists_number_add.
      Implementation: hc_ds_cmds_lists_number_add.erl.
      Git: git@git.eltex.loc:httpTerminal.git.
      Copyright (c) 2016, Eltex. All rights reserved.
    </xs:documentation>
  </xs:annotation>

  <xs:include schemaLocation="error.xsd"/>
  
  <!-- numberType --> 
  <xs:complexType name="numberType">
    <xs:attribute name="value" type="xs:string" use="required"/>
  </xs:complexType>
 
  <!-- listType -->
  <xs:complexType name="listType">
    <xs:sequence>
      <xs:element name="number" type="numberType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required"/>
  </xs:complexType>

  <!-- request -->
  <xs:complexType name="requestType">
    <xs:sequence>
      <xs:element name="list" type="listType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="domain" type="xs:string" use="required"/> 
  </xs:complexType>

  <!-- in -->
  <xs:element name="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request" type="requestType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <!-- out -->
  <xs:element name="out">
    <xs:complexType>
      <xs:choice>
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

</xs:schema>
XML

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_sd_cmds_lists_number_add.xsd">
    <request domain="biysk.local">
        <list name="spam_list">
            <number value="240501"/>
            <number value="240502"/>
            <number value="240503"/>
            <number value="83852352804"/>
            <number value="83832741001"/>
            <number value="89520001615"/>
        </list>
    </request>
</in>
XML

Ответ: 201

Hс_ds_cmds_lists_number_remove

Команда удаляет номера из существующего списка.

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

domain/<DOMAIN>/lists/numbers-remove

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

POST

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

http://host:port/commands/ds_cmds_lists_number_remove

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

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

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">
      Remove specified numbers to exist list.
      Usage: http://server:9999/commands/ds_cmds_lists_number_remove.
      Implementation: hc_ds_cmds_lists_number_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"/>
  
  <!-- numberType --> 
  <xs:complexType name="numberType">
    <xs:attribute name="value" type="xs:string" use="required"/>
  </xs:complexType>
 
  <!-- listType -->
  <xs:complexType name="listType">
    <xs:sequence>
      <xs:element name="number" type="numberType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required"/>
  </xs:complexType>

  <!-- request -->
  <xs:complexType name="requestType">
    <xs:sequence>
      <xs:element name="list" type="listType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="domain" type="xs:string" use="required"/> 
  </xs:complexType>

  <!-- in -->
  <xs:element name="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request" type="requestType"/>
      </xs:sequence>
    </xs:complexType> 
  </xs:element>

  <!-- out -->
  <xs:element name="out">
    <xs:complexType>
      <xs:choice>
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

</xs:schema>
XML

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_sd_cmds_lists_number_remove.xsd">
    <request domain="biysk.local">
        <list name="spam_list">
            <number value="240318"/>
            <number value="83832741001"/>
        </list>
    </request>
</in>
XML

Ответ: 201

Hс_ds_cmds_lists_remove

Команда удаляет существующий список.

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

domain/<DOMAIN>/lists/remove

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

POST

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

http://host:port/commands/ds_cmds_lists_remove

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

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

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">
      Remove specified exist list.
      Usage: http://server:9999/commands/ds_cmds_lists_remove.
      Implementation: hc_ds_cmds_lists_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"/>
  
  <!-- listType -->
  <xs:complexType name="listType">
    <xs:attribute name="name" type="xs:string" use="required"/>
  </xs:complexType>

  <!-- request -->
  <xs:complexType name="requestType">
    <xs:sequence>
      <xs:element name="list" type="listType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="domain" type="xs:string"  use="required"/> 
  </xs:complexType>

  <!-- in -->
  <xs:element name="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request" type="requestType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <!-- out -->
  <xs:element name="out">
    <xs:complexType>
      <xs:choice>
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

</xs:schema>
XML

Пример

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

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

Ответ: 201

Hс_ds_cmds_lists_set

Команда устанавливает новые значения для description и/или numbers в указанном списке.

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

domain/<DOMAIN>/lists/set

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

POST

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

http://host:port/commands/ds_cmds_lists_set

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

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

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 lists description and numbers list.
      Usage: http://server:9999/commands/ds_cmds_lists_set.
      Implementation: hc_ds_cmds_lists_set.erl.
      Git: git@git.eltex.loc:httpTerminal.git.
      Copyright (c) 2016, Eltex. All rights reserved.
    </xs:documentation>
  </xs:annotation>

  <xs:include schemaLocation="error.xsd"/>
  
  <!-- numberType --> 
  <xs:complexType name="numberType">
    <xs:attribute name="value" type="xs:string" use="required"/>
    <xs:attribute name="priority" type="xs:string" use="required"/>
  </xs:complexType>
 
  <!-- listType -->
  <xs:complexType name="listType">
    <xs:sequence>
      <xs:element name="number" type="numberType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string" use="required"/>
    <xs:attribute name="description" type="xs:string" use="optional"/>
    <xs:attribute name="type" type="xs:string" use="optional"/>
  </xs:complexType>

  <!-- request -->
  <xs:complexType name="requestType">
    <xs:sequence>
      <xs:element name="list" type="listType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="domain" type="xs:string" use="required"/> 
  </xs:complexType>

  <!-- in -->
  <xs:element name="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request" type="requestType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <!-- out -->
  <xs:element name="out">
    <xs:complexType>
      <xs:choice>
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

</xs:schema>
XML

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ds_cmds_lists_set.xsd">
    <request domain="biysk.local">
        <list name="ListName" description="my cool spamlist" type="default">
        </list>
    </request>
</in>
XML

Ответ: 201