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

Hс_ecss_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>

Пример

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

<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/10/16 00:00:00" to="2017/10/17 00:00:00" statistic="incoming_seizures.counter" variable_part_1="smg-4" />
    </request>
</in>

Ответ:

Код: 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="hour" type="counter" variable_part_1="smg-4">
            <value time="2017/10/15 17:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/15 18:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/15 19:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/15 20:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/15 21:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/15 22:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/15 23:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/16 00:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/16 01:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/16 02:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/16 03:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/16 04:59:59" value="4" n="" min="" max="" avg=""/>
            <value time="2017/10/16 05:59:59" value="1" n="" min="" max="" avg=""/>
            <value time="2017/10/16 06:59:59" value="1" n="" min="" max="" avg=""/>
            <value time="2017/10/16 07:59:59" value="1" n="" min="" max="" avg=""/>
            <value time="2017/10/16 08:59:59" value="2" n="" min="" max="" avg=""/>
            <value time="2017/10/16 09:59:59" value="1" n="" min="" max="" avg=""/>
            <value time="2017/10/16 10:59:59" value="2" n="" min="" max="" avg=""/>
            <value time="2017/10/16 11:59:59" value="3" n="" min="" max="" avg=""/>
            <value time="2017/10/16 12:59:59" value="2" n="" min="" max="" avg=""/>
            <value time="2017/10/16 13:59:59" value="1" n="" min="" max="" avg=""/>
            <value time="2017/10/16 14:59:59" value="1" n="" min="" max="" avg=""/>
            <value time="2017/10/16 15:59:59" value="" n="" min="" max="" avg=""/>
            <value time="2017/10/16 16:59:59" value="" n="" min="" max="" avg=""/>
        </statistics>
    </response>
</out>

Пример 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="p.city">
            <statistics system="ecss10.ssw" subsystem="trunk_manager" from="2015/10/01 00:00:00" to="2015/10/05 00:00:00" statistic="incoming_seizures.counter" />
            <statistics system="ecss10.ssw" subsystem="trunk_manager" from="2015/10/01 00:00:00" to="2015/10/05 00:00:00" statistic="incoming_accepted_seizures.counter" />
        </request>
</in>

Ответ:

Код: 200

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="ecss_statistics_show.xsd">
    <result>
        <statistics system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_seizures.counter" type="counter" measure="day" variable_part_1="1234@192.168.23.87">
            <value time="2015/10/03 00:00:00" value="15" n="" min="" max="" avg=""/>
        </statistics>
        <statistics system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_seizures.counter" type="gauge" measure="day" variable_part_1="1234@192.168.23.87">
            <value time="2015/10/03 00:00:00" value="0" n="" min="" max="" avg=""/>
        </statistics>
        <statistics system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_accepted_seizures.counter" type="gauge" measure="day" variable_part_1="1234@192.168.23.87">
            <value time="2015/10/03 00:00:00" value="0" n="" min="" max="" avg=""/>
        </statistics>
    </result>
</out>


  • Нет меток