Hc_get_info - Время работы узла(ов) с момента последнего перезапуска
Hс_get_info
Команда возвращает время работы узла(ов) с момента последнего перезапуска.
Аналог команды в CoCon:
/node/<NODE_NAME>/uptime
/node/uptime
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/get_info
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="nodeType">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="releaseType">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="version" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="uptimeType">
<xs:sequence>
<xs:element name="release" type="releaseType" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="days" type="xs:string" use="required"/>
<xs:attribute name="hours" type="xs:string" use="required"/>
<xs:attribute name="minutes" type="xs:string" use="required"/>
<xs:attribute name="seconds" type="xs:string" use="required"/>
</xs:complexType>
<xs:element name="in">
<xs:complexType>
<xs:all>
<xs:element name="node" type="nodeType" minOccurs="0" maxOccurs="1"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="out">
<xs:complexType>
<xs:sequence>
<xs:element name="uptime" type="uptimeType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
XML
Пример
Информация о конкретной подсистеме:
Запрос: http://192.168.1.21:9999/commands/get_info
<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="get_info.xsd">
<node name="md1@ecss1" />
</in>
XML
Ответ:
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="get_info.xsd">
<uptime name="md1@ecss1" days="0" hours="4" minutes="47" seconds="14">
<release name="ecss-mediator" version="3.14.3.43"/>
</uptime>
</out>
XML
Информация о всех подсистемах:
Запрос: http://192.168.1.21:9999/commands/get_info
<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="get_info.xsd" />
XML
Ответ:
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="get_info.xsd">
<uptime name="sip1@ecss1" days="0" hours="4" minutes="48" seconds="5">
<release name="ecss-pa-sip" version="3.14.3.43"/>
</uptime>
<uptime name="mycelium1@ecss1" days="0" hours="4" minutes="48" seconds="50">
<release name="ecss-mycelium" version="3.14.3.43"/>
</uptime>
<uptime name="megaco1@ecss1" days="0" hours="4" minutes="47" seconds="47">
<release name="ecss-pa-megaco" version="3.14.3.43"/>
</uptime>
<uptime name="md1@ecss1" days="0" hours="4" minutes="48" seconds="4">
<release name="ecss-mediator" version="3.14.3.43"/>
</uptime>
<uptime name="ds1@ecss1" days="0" hours="4" minutes="48" seconds="33">
<release name="ecss-ds" version="3.14.3.43"/>
</uptime>
<uptime name="core1@ecss1" days="0" hours="4" minutes="48" seconds="33">
<release name="ecss-core" version="3.14.3.43"/>
</uptime>
</out>
XML