Hс_ecss_statistics_show

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

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

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

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

POST

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

http://host:port/commands/ecss_statistics_show

Код 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">
    <!-- 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>
    <!-- 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="xs:string"/> <!--YY/MM/DD HH:MM:SS-->
        <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="xs:string"/> <!--YY/MM/DD HH:MM:SS-->
        <xs:attribute name="to" type="xs:string"/> <!--YY/MM/DD HH:MM:SS-->
        <xs:attribute name="system" type="systemType"/>
        <xs:attribute name="subsystem" type="xs:string" 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:attribute name="measure_type" type="statisticIntervalType" 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="domain" type="xs:string"/>
        <xs:attribute name="from" type="xs:string"/> <!--YY/MM/DD HH:MM:SS-->
        <xs:attribute name="to" type="xs:string"/> <!--YY/MM/DD HH:MM:SS-->
        <xs:attribute name="system" type="systemType"/>
        <xs:attribute name="subsystem" type="xs:string"/>
        <xs:attribute name="statistic" type="xs:string"/>
        <xs:attribute name="type" type="statisticTypeType"/>
        <xs:attribute name="measure_type" type="xs:string" use="optional"/>
        <xs:attribute name="sum" type="xs:float" 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>
    <!-- statisticIntervalType -->
    <xs:simpleType name="statisticIntervalType">
        <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:enumeration value="auto"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- 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:attribute name="measure_type" type="statisticIntervalType" use="optional"/>
                        <xs:attribute name="request_time_utc" type="xs:boolean" use="optional"/>
                    </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>
XML

Пример

Запрос: 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="2019/11/05 00:00:00" to="2019/11/17 00:00:00" statistic="incoming_seizures.counter" variable_part_1="smg-4" />
    </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 domain="biysk.local" from="2019/11/05 00:00:00" to="2019/11/17 00:00:00" system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_seizures.counter" type="counter" measure_type="day" sum="1533.000000" variable_part_1="smg-4">
            <value time="2019/11/05 16:59:59" value="79" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/06 16:59:59" value="134" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/07 16:59:59" value="97" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/08 16:59:59" value="163" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/09 16:59:59" value="82" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/10 16:59:59" value="57" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/11 16:59:59" value="140" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/12 16:59:59" value="148" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/13 16:59:59" value="219" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/14 16:59:59" value="155" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/15 16:59:59" value="181" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/16 16:59:59" value="78" 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="2019/11/05 00:00:00" to="2019/11/18 00:00:00 " statistic="incoming_seizures.counter" variable_part_1="smg-4"/>
            <statistics system="ecss10.ssw" subsystem="trunk_manager" from="2019/11/05 00:00:00" to="2019/11/18 00:00:00"  statistic="incoming_accepted_seizures.counter" variable_part_1="smg-4" />
        </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 domain="biysk.local" from="2019/11/05 00:00:00" to="2019/11/18 00:00:00" system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_seizures.counter" type="counter" measure_type="day" sum="1654.000000" variable_part_1="smg-4">
            <value time="2019/11/05 16:59:59" value="79" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/06 16:59:59" value="134" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/07 16:59:59" value="97" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/08 16:59:59" value="163" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/09 16:59:59" value="82" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/10 16:59:59" value="57" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/11 16:59:59" value="140" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/12 16:59:59" value="148" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/13 16:59:59" value="219" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/14 16:59:59" value="155" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/15 16:59:59" value="181" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/16 16:59:59" value="78" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/17 16:59:59" value="121" n="-" min="-" max="-" avg="-"/>
        </statistics>
        <statistics domain="biysk.local" from="2019/11/05 00:00:00" to="2019/11/18 00:00:00" system="ecss10.ssw" subsystem="trunk_manager" statistic="incoming_accepted_seizures.counter" type="counter" measure_type="day" sum="1654.000000" variable_part_1="smg-4">
            <value time="2019/11/05 16:59:59" value="79" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/06 16:59:59" value="134" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/07 16:59:59" value="97" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/08 16:59:59" value="163" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/09 16:59:59" value="82" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/10 16:59:59" value="57" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/11 16:59:59" value="140" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/12 16:59:59" value="148" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/13 16:59:59" value="219" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/14 16:59:59" value="155" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/15 16:59:59" value="181" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/16 16:59:59" value="78" n="-" min="-" max="-" avg="-"/>
            <value time="2019/11/17 16:59:59" value="121" n="-" min="-" max="-" avg="-"/>
        </statistics>
    </response>
</out>
CODE

Hс_ ecss_statistics_get_metric

Команда предназначена для получения метрик статистики ECSS-10

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

POST

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

http://host:port/commands/ecss_statistics_get_metric

Код 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">
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="statistics" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:attribute name="system" type="xs:string"/>
                                    <xs:attribute name="subsystem" type="xs:string"/>
                                    <xs:attribute name="metric" type="xs:string"/>
                                    <xs:attribute name="variable_part_1" type="xs:string" use="optional"/>
                                    <xs:attribute name="variable_part_2" type="xs:string" use="optional"/>
                                    <xs:attribute name="type" type="xs:string"/>
                                </xs:complexType>
                            </xs:element>
                        </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">
                                <xs:complexType>
                                    <xs:attribute name="system" type="xs:string"/>
                                    <xs:attribute name="subsystem" type="xs:string"/>
                                    <xs:attribute name="metric" type="xs:string"/>
                                    <xs:attribute name="variable_part_1" type="xs:string" use="optional"/>
                                    <xs:attribute name="variable_part_2" type="xs:string" use="optional"/>
                                    <xs:attribute name="type" type="xs:string"/>
                                    <xs:attribute name="value" type="xs:int"/>
                                    <xs:attribute name="time" type="xs:string"/>
                                    <xs:attribute name="n" type="xs:int" use="optional"/>
                                    <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>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>
CODE

Пример:

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

<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ecss_statistics_get_metric.xsd">
    <request domain="biysk.local">
        <statistics system="ecss10.ssw" subsystem="core" metric="ecss_statistics_get_metric" type="counter"/>
    </request>
</in>
CODE

Ответ: 200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="ecss_statistics_get_metric.xsd">
    <response/>
</out>
CODE