Hc_statistics_show

Команда предназначена для получения статистики ECSS-10 за определенный интервал времени с использованием определенных фильтров.

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

/domain/<DOMAIN>/core/statistics/show

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

POST

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

http://host:port/commands/ecss_statistics_show

Код http ответа:

201 – в случае успеха;
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="common.xsd"/>
    <!-- systemType -->
    <xs:simpleType name="systemType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="ecss10.common"/>
            <xs:enumeration value="ecss10.ssw"/>
            <xs:enumeration value="ecss10.cc"/>
            <xs:enumeration value="ecss10.tc"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- systemType -->
    <xs:simpleType name="measureType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="realtime"/>
            <xs:enumeration value="intrahour"/>
            <xs:enumeration value="hour"/>
            <xs:enumeration value="day"/>
            <xs:enumeration value="week"/>
            <xs:enumeration value="month"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- subsystemType -->
    <xs:simpleType name="subsystemType">
        <xs:restriction base="xs:string">
            <xs:annotation>
                <xs:documentation xml:lang="en">
                    In ECSS-10 v. 3.4.2 are supported subsystems:
                    queue, agent, core, sip, megaco, sigtran, ds, mediator, mycelium, trunk_manager, direction_manager.
                </xs:documentation>
            </xs:annotation>
        </xs:restriction>
    </xs:simpleType>
    <!-- statisticTypeType -->
    <xs:simpleType name="statisticTypeType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="counter"/>
            <xs:enumeration value="gauge"/>
            <xs:enumeration value="meter"/>
            <xs:enumeration value="histogram"/>
        </xs:restriction>
    </xs:simpleType>    
    <!-- statisticsValueType -->
    <xs:complexType name="statisticsValueType">
        <xs:attribute name="time" type="dateTimeType"/>
        <xs:attribute name="value" type="xs:int"/>
        <xs:attribute name="n" type="xs:int"/>
        <xs:attribute name="min" type="xs:int" use="optional"/>
        <xs:attribute name="max" type="xs:int" use="optional"/>
        <xs:attribute name="avg" type="xs:double" use="optional"/>
    </xs:complexType>
    <!-- statisticsInType -->
    <xs:complexType name="statisticsInType">
        <xs:attribute name="from" type="dateTimeType"/>
        <xs:attribute name="to" type="dateTimeType"/>
        <xs:attribute name="system" type="systemType"/>
        <xs:attribute name="subsystem" type="subsystemType" use="optional"/>
        <xs:attribute name="statistic" type="xs:string" use="optional"/>
        <xs:attribute name="type" type="statisticTypeType" use="optional"/>
        <xs:attribute name="variable_part_1" type="xs:string" use="optional"/>
        <xs:attribute name="variable_part_2" type="xs:string" use="optional"/>
    </xs:complexType>
    <!-- statisticsOutType -->
    <xs:complexType name="statisticsOutType">
        <xs:sequence>
            <xs:element name="value" minOccurs="0" maxOccurs="unbounded" type="statisticsValueType"/>
        </xs:sequence>
        <xs:attribute name="system" type="systemType"/>
        <xs:attribute name="subsystem" type="subsystemType"/>
        <xs:attribute name="statistic" type="xs:string"/>
        <xs:attribute name="type" type="statisticTypeType"/>
        <xs:attribute name="measure" type="measureType" use="optional"/>
        <xs:attribute name="variable_part_1" type="xs:string" use="optional"/>
        <xs:attribute name="variable_part_2" type="xs:string" use="optional"/>        
    </xs:complexType>
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="statistics" maxOccurs="unbounded" type="statisticsInType"/>
                        </xs:sequence>
                        <xs:attribute name="domain" type="xs:string"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="response">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="statistics" minOccurs="0" maxOccurs="unbounded" type="statisticsOutType"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример 1

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ecss_statistics_show.xsd">
    <request domain="biysk.local">
        <statistics system="ecss10.ssw" subsystem="trunk_manager" from="2017/12/05 00:00:00" to="2017/12/10 00:00:00" statistic="incoming_seizures.counter"/>
    </request>
</in>
CODE

Ответ:

Код: 200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="ecss_statistics_show.xsd">
    <response>
        <statistics system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_seizures.counter" measure="day" type="counter" variable_part_1="smg-4">
            <value time="2017/12/05 16:59:59" value="7" n="" min="" max="" avg=""/>
            <value time="2017/12/06 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/07 16:59:59" value="21" n="" min="" max="" avg=""/>
            <value time="2017/12/08 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/09 16:59:59" value="13" n="" min="" max="" avg=""/>
        </statistics>
        <statistics system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_seizures.counter" measure="day" type="counter" variable_part_1="system:teleconference">
            <value time="2017/12/05 16:59:59" value="1" n="" min="" max="" avg=""/>
            <value time="2017/12/06 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/07 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/08 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/09 16:59:59" value="2" n="" min="" max="" avg=""/>
        </statistics>
    </response>
</out>
CODE

Пример 2

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ecss_statistics_show.xsd">
        <request domain="biysk.local">
            <statistics system="ecss10.ssw" subsystem="trunk_manager" from="2017/12/05 00:00:00" to="2017/12/10 00:00:00" statistic="incoming_seizures.counter" />
            <statistics system="ecss10.ssw" subsystem="trunk_manager" from="2017/12/05 00:00:00" to="2017/12/10 00:00:00" statistic="incoming_accepted_seizures.counter" />
        </request>
</in>
CODE

Ответ:

Код: 200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="ecss_statistics_show.xsd">
    <response>
        <statistics system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_seizures.counter" measure="day" type="counter" variable_part_1="smg-4">
            <value time="2017/12/05 16:59:59" value="7" n="" min="" max="" avg=""/>
            <value time="2017/12/06 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/07 16:59:59" value="21" n="" min="" max="" avg=""/>
            <value time="2017/12/08 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/09 16:59:59" value="13" n="" min="" max="" avg=""/>
        </statistics>
        <statistics system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_seizures.counter" measure="day" type="counter" variable_part_1="system:teleconference">
            <value time="2017/12/05 16:59:59" value="1" n="" min="" max="" avg=""/>
            <value time="2017/12/06 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/07 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/08 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/09 16:59:59" value="2" n="" min="" max="" avg=""/>
        </statistics>
        <statistics system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_accepted_seizures.counter" measure="day" type="counter" variable_part_1="smg-4">
            <value time="2017/12/05 16:59:59" value="7" n="" min="" max="" avg=""/>
            <value time="2017/12/06 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/07 16:59:59" value="21" n="" min="" max="" avg=""/>
            <value time="2017/12/08 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/09 16:59:59" value="13" n="" min="" max="" avg=""/>
        </statistics>
        <statistics system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_accepted_seizures.counter" measure="day" type="counter" variable_part_1="system:teleconference">
            <value time="2017/12/05 16:59:59" value="1" n="" min="" max="" avg=""/>
            <value time="2017/12/06 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/07 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/08 16:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/12/09 16:59:59" value="2" n="" min="" max="" avg=""/>
        </statistics>
    </response>
</out>
CODE