Hc_ecss_statistics - Получение статистики по домену
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-файла запроса/ответа:
Пример
Запрос: 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>
Ответ:
Код: 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>
Пример 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>
Ответ:
Код: 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>
Hс_ ecss_statistics_get_metric
Команда предназначена для получения метрик статистики ECSS-10
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/ecss_statistics_get_metric
Код 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">
<!-- 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>
Пример:
Запрос: 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>
Ответ: 200
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="ecss_statistics_get_metric.xsd">
<response/>
</out>