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

Hc_notifier_send_test_msg

Команда позволяет отправить тестовое сообщение через службу уведомлений на электронную почту, Jabber.

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

/domain/<DOMAIN>/notifier/send_test_msg

Метод http запроса:

POST

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

http://host:port/commands/notifier_send_test_msg

Код 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:include schemaLocation="error.xsd" />
    <xs:simpleType name="typeType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="email"/>
            <xs:enumeration value="jabber"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:attribute name="domain" type="xs:string" use="required"/>
                        <xs:attribute name="type" type="typeType" use="required"/>
                        <xs:attribute name="address" type="xs:string" use="required"/>
                        <xs:attribute name="msg" type="xs:string" use="optional"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>

          
    <!-- out-->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <!--Positive case-->
                <xs:element name="response">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="ok"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <!--Or error-->
                <xs:element name="error" type="errorType"/>
          </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

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

<?xml version="1.0"?>
  <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_notifier_send_test.xsd">
    <request domain="biysk.local" type="email" address="asz@sibnet.ru" msg="Test1 message"/>
</in>

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_notifier_send_test.xsd">
    <response>
        <ok/>
    </response>
</out>
  • Нет меток