Hc_ap_speaker_off

Команда выключает динамик на блоке аварийной сигнализации (БАС).

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

 cluster/mediator/<CLUSTER>/ap/speaker-off 

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

POST

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

http://host:port/commands/ap_speaker_off

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 202 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:attribute name="mediator" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример:

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

<?xml version="1.0"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ap_speaker_off.xsd">
        <request mediator="md1"/>
</in>
CODE

Ответ:

202

Hc_ap_status

Команда возвращает состояние блока аварийной сигнализации (БАС).

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

 cluster/mediator/<CLUSTER>/ap/status 

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

POST

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

http://host:port/commands/ap_status

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <!-- errorType-->
    <xs:complexType name="errorType">
        <xs:attribute name="reason" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- basType-->
    <xs:complexType name="basType">
        <xs:attribute name="ip" type="xs:string" use="required"/>
        <xs:attribute name="port" type="xs:integer" use="required"/>
        <xs:attribute name="speaker" type="xs:boolean" use="required"/>
        <xs:attribute name="led_0" type="xs:boolean" use="required"/>
        <xs:attribute name="led_1" type="xs:boolean" use="required"/>
        <xs:attribute name="led_2" type="xs:boolean" use="required"/>
        <xs:attribute name="led_3" type="xs:boolean" use="required"/>
        <xs:attribute name="led_4" type="xs:boolean" use="required"/>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:attribute name="mediator" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out-->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="error" type="errorType" minOccurs="0" />
                <xs:element name="bas" type="basType" minOccurs="0" />
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример:

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

<?xml version="1.0"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ap_status.xsd">
    <request mediator="md1"/>
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="ap_status.xsd">
    <bas ip="192.168.1.10" port="2222" speaker="false" led_0="true" led_1="false" led_2="false" led_3="false" led_4="false"/>
</out>
CODE


В случае ошибки:

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="ap_status.xsd">
    <error reason="Not connection to the alarm panel."/>
</out>
CODE

Hc_alarms_list

Команда возвращает список аварий в системе.

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

 cluster/mediator/<CLUSTER>/alarms/list 

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

POST

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

http://host:port/commands/alarms_list

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:include schemaLocation="rps.xsd"/>
    <!-- stringType -->
    <xs:complexType name="stringType">
        <xs:attribute name="value" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- pstrArgType -->
    <xs:complexType name="pstrArgType">
        <xs:attribute name="value" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- pstrType -->
    <xs:complexType name="pstrType">
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element name="arg" type="pstrArgType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="value" type="xs:string" use="required"/>
        <xs:attribute name="id" type="xs:string" use="optional"/>
        <xs:attribute name="template" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- requestType -->
    <xs:simpleType name="requestType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="active"/>
            <xs:enumeration value="cleared"/>
            <xs:enumeration value="all"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- operType -->
    <xs:simpleType name="operType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="equal"/>
            <xs:enumeration value="not_equal"/>
            <xs:enumeration value="more"/>
            <xs:enumeration value="less"/>
            <xs:enumeration value="more_or_equal"/>
            <xs:enumeration value="less_or_equal"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- sortType -->
    <xs:simpleType name="sortType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="asc"/>
            <xs:enumeration value="desc"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- columnType -->
    <xs:complexType name="columnType">
        <xs:attribute name="name" type="columnNameType" use="required"/>
        <xs:attribute name="sort" type="sortType" use="optional"/>
    </xs:complexType>
    <!-- filterType -->
    <xs:complexType name="filterType">
        <xs:choice>
            <xs:element name="id" type="stringType"/>
            <xs:element name="managedObjectClass" type="stringType"/>
            <xs:element name="managedObjectInstance" type="stringType"/>
            <xs:element name="location" type="stringType"/>
            <xs:element name="domain" type="stringType"/>
            <xs:element name="user_id" type="stringType"/>
            <xs:element name="eventTime" type="eventTimeType"/>
            <!-- datetime or undefined -->
            <xs:element name="cleared" type="eventTimeType"/>
            <xs:element name="probableCause">
                <xs:complexType>
                    <xs:attribute name="value" type="alarmCauseType" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="eventType">
                <xs:complexType>
                    <xs:attribute name="value" type="alarmEventTypeType" use="required"/>
                </xs:complexType>
            </xs:element>
            <!-- term -->
            <xs:element name="specificProblems" type="stringType"/>
            <xs:element name="perceivedSeverity">
                <xs:complexType>
                    <xs:attribute name="value" type="severityType" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="originalSeverity">
                <xs:complexType>
                    <xs:attribute name="value" type="severityType" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="backedupStatus">
                <xs:complexType>
                    <xs:attribute name="value" type="backedupStatusType" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="backupObject" type="stringType"/>
            <xs:element name="trendIndication">
                <xs:complexType>
                    <xs:attribute name="value" type="trendIndicationType" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="thresholdInformation" type="stringType"/>
            <xs:element name="notificationIdentifier" type="stringType"/>
            <xs:element name="correlatedNotifications" type="stringType"/>
            <xs:element name="stateChangeDefinition" type="stringType"/>
            <xs:element name="monitoredAttributes" type="stringType"/>
            <xs:element name="proposedRepairActions" type="stringType"/>
            <xs:element name="additionalText" type="stringType"/>
            <xs:element name="additionalInformation" type="stringType"/>
        </xs:choice>
        <xs:attribute name="oper" type="operType" use="required"/>
    </xs:complexType>
    <!-- columnsType -->
    <xs:complexType name="columnsType">
        <xs:sequence>
            <xs:element name="column" type="columnType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <!-- filtersType -->
    <xs:complexType name="filtersType">
        <xs:sequence>
            <xs:element name="filter" type="filterType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <!-- rowType -->
    <xs:complexType name="rowType">
        <xs:all>
            <xs:element name="id" type="stringType" minOccurs="0"/>
            <xs:element name="managedObjectClass" type="stringType" minOccurs="0"/>
            <xs:element name="managedObjectInstance" type="stringType" minOccurs="0"/>
            <xs:element name="location" type="stringType" minOccurs="0"/>
            <xs:element name="domain" type="stringType" minOccurs="0"/>
            <xs:element name="user_id" type="stringType" minOccurs="0"/>
            <xs:element name="eventTime" type="eventTimeType" minOccurs="0"/>
            <!-- datetime or undefined -->
            <xs:element name="cleared" type="eventTimeType" minOccurs="0"/>
            <xs:element name="probableCause" minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="value" type="alarmCauseType" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="eventType" minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="value" type="alarmEventTypeType" use="required"/>
                </xs:complexType>
            </xs:element>
            <!-- term -->
            <xs:element name="specificProblems" type="stringType" minOccurs="0"/>
            <xs:element name="perceivedSeverity" minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="value" type="severityType" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="originalSeverity" minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="value" type="severityType" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="backedupStatus" minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="value" type="backedupStatusType" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="backupObject" type="stringType" minOccurs="0"/>
            <xs:element name="trendIndication" minOccurs="0">
                <xs:complexType>
                    <xs:attribute name="value" type="trendIndicationType" use="required"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="thresholdInformation" type="stringType" minOccurs="0"/>
            <xs:element name="notificationIdentifier" type="stringType" minOccurs="0"/>
            <xs:element name="correlatedNotifications" type="stringType" minOccurs="0"/>
            <xs:element name="stateChangeDefinition" type="stringType" minOccurs="0"/>
            <xs:element name="monitoredAttributes" type="stringType" minOccurs="0"/>
            <xs:element name="proposedRepairActions" type="stringType" minOccurs="0"/>
            <xs:element name="additionalText" type="pstrType" minOccurs="0"/>
            <xs:element name="additionalInformation" type="stringType" minOccurs="0"/>
        </xs:all>
    </xs:complexType>
    <!-- rowsType -->
    <xs:complexType name="rowsType">
        <xs:sequence>
            <xs:element name="row" type="rowType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="columns" type="columnsType"/>
                            <xs:element name="filters" type="filtersType"/>
                        </xs:sequence>
                        <xs:attribute name="mediator" type="xs:string" use="required"/>
                        <xs:attribute name="type" type="requestType" use="required"/>
                        <xs:attribute name="count" type="xs:integer" use="optional"/>
                        <xs:attribute name="offset" type="xs:integer" use="optional"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="response">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="time" type="eventTimeType"/>
                            <xs:element name="columns" type="columnsType"/>
                            <xs:element name="rows" type="rowsType"/>
                        </xs:sequence>
                        <xs:attribute name="type" type="requestType" use="required"/>
                        <xs:attribute name="total" type="xs:integer" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

rps.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <!-- columnNameType -->
    <xs:simpleType name="columnNameType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="id"/>
            <xs:enumeration value="managedObjectClass"/>
            <xs:enumeration value="managedObjectInstance"/>
            <xs:enumeration value="location"/>
            <xs:enumeration value="domain"/>
            <xs:enumeration value="user_id"/>
            <xs:enumeration value="eventTime"/>
            <xs:enumeration value="cleared"/>
            <xs:enumeration value="probableCause"/>
            <xs:enumeration value="eventType"/>
            <xs:enumeration value="specificProblems"/>
            <xs:enumeration value="perceivedSeverity"/>
            <xs:enumeration value="originalSeverity"/>
            <xs:enumeration value="backedupStatus"/>
            <xs:enumeration value="backupObject"/>
            <xs:enumeration value="trendIndication"/>
            <xs:enumeration value="thresholdInformation"/>
            <xs:enumeration value="notificationIdentifier"/>
            <xs:enumeration value="correlatedNotifications"/>
            <xs:enumeration value="stateChangeDefinition"/>
            <xs:enumeration value="monitoredAttributes"/>
            <xs:enumeration value="proposedRepairActions"/>
            <xs:enumeration value="additionalText"/>
            <xs:enumeration value="additionalInformation"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- trendIndicationType -->
    <xs:simpleType name="trendIndicationType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="moreSevere"/>
            <xs:enumeration value="noChange"/>
            <xs:enumeration value="lessSevere"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- backedupStatusType -->
    <xs:simpleType name="backedupStatusType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="true"/>
            <xs:enumeration value="false"/>
            <xs:enumeration value="undefined"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- severityType -->
    <xs:simpleType name="severityType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="cleared"/>
            <xs:enumeration value="indeterminate"/>
            <xs:enumeration value="critical"/>
            <xs:enumeration value="major"/>
            <xs:enumeration value="minor"/>
            <xs:enumeration value="warning"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- alarmEventTypeType -->
    <xs:simpleType name="alarmEventTypeType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="other"/>
            <xs:enumeration value="communicationsAlarm"/>
            <xs:enumeration value="qualityOfServiceAlarm"/>
            <xs:enumeration value="processingErrorAlarm"/>
            <xs:enumeration value="equipmentAlarm"/>
            <xs:enumeration value="environmentalAlarm"/>
            <xs:enumeration value="integrityViolation"/>
            <xs:enumeration value="operationalViolation"/>
            <xs:enumeration value="physicalViolation"/>
            <xs:enumeration value="securityServiceOrMechanismViolation"/>
            <xs:enumeration value="timeDomainViolation"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- alarmCauseType -->
    <xs:simpleType name="alarmCauseType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="other"/>
            <xs:enumeration value="unexpectedInformation"/>
            <xs:enumeration value="unauthorizedAccessAttempt"/>
            <xs:enumeration value="proceduralError"/>
            <xs:enumeration value="outOfService"/>
            <xs:enumeration value="outOfHoursActivity"/>
            <xs:enumeration value="nonRepudiationFailure"/>
            <xs:enumeration value="keyExpired"/>
            <xs:enumeration value="informationOutOfSequence"/>
            <xs:enumeration value="informationModificationDetected"/>
            <xs:enumeration value="informationMissing"/>
            <xs:enumeration value="duplicateInformation"/>
            <xs:enumeration value="denialOfService"/>
            <xs:enumeration value="delayedInformation"/>
            <xs:enumeration value="cableTamper"/>
            <xs:enumeration value="breachOfConfidentiality"/>
            <xs:enumeration value="authenticationFailure"/>
            <xs:enumeration value="versionMismatchX733"/>
            <xs:enumeration value="underlyingResourceUnavailable"/>
            <xs:enumeration value="transmiterFailure"/>
            <xs:enumeration value="transmitFailureX733"/>
            <xs:enumeration value="toxicLeakDetected"/>
            <xs:enumeration value="timingProblemX733"/>
            <xs:enumeration value="thresholdCrossed"/>
            <xs:enumeration value="temperatureUnacceptable"/>
            <xs:enumeration value="storageCapacityProblemX733"/>
            <xs:enumeration value="softwareProgramError"/>
            <xs:enumeration value="softwareProgramAbnormallyTerminated"/>
            <xs:enumeration value="softwareErrorX733"/>
            <xs:enumeration value="retransmissionRateExcessive"/>
            <xs:enumeration value="responseTimeExecessive"/>
            <xs:enumeration value="resourceAtOrNearingCapacity"/>
            <xs:enumeration value="remoteNodeTransmissionErrorX733"/>
            <xs:enumeration value="receiverFailureX733"/>
            <xs:enumeration value="receiveFailureX733"/>
            <xs:enumeration value="queueSizeExceeded"/>
            <xs:enumeration value="pumpFailureX733"/>
            <xs:enumeration value="processorProblems"/>
            <xs:enumeration value="pressureUnacceptable"/>
            <xs:enumeration value="powerProblems"/>
            <xs:enumeration value="performanceDegraded"/>
            <xs:enumeration value="ouputDeviceError"/>
            <xs:enumeration value="outOfMemoryX733"/>
            <xs:enumeration value="multiplexerProblemX733"/>
            <xs:enumeration value="materialSupplyExhausted"/>
            <xs:enumeration value="lossOfSignalX733"/>
            <xs:enumeration value="lossOfFrameX733"/>
            <xs:enumeration value="localNodeTransmissionErrorX733"/>
            <xs:enumeration value="leakDetected"/>
            <xs:enumeration value="lanError"/>
            <xs:enumeration value="inputDeviceError"/>
            <xs:enumeration value="inputOutputDeviceError"/>
            <xs:enumeration value="humidityUnacceptable"/>
            <xs:enumeration value="heatingVentCoolingSystemProblem"/>
            <xs:enumeration value="framingErrorX733"/>
            <xs:enumeration value="fireDetected"/>
            <xs:enumeration value="fileErrorX733"/>
            <xs:enumeration value="excessiveVibration"/>
            <xs:enumeration value="equipmentMalfunction"/>
            <xs:enumeration value="enclosureDoorOpenX733"/>
            <xs:enumeration value="dteDceInterfaceError"/>
            <xs:enumeration value="degradedSignalX733"/>
            <xs:enumeration value="dataSetOrModemError"/>
            <xs:enumeration value="cpuCyclesLimitExceeded"/>
            <xs:enumeration value="coruptData"/>
            <xs:enumeration value="congestionX733"/>
            <xs:enumeration value="configurationOrCustomizationError"/>
            <xs:enumeration value="communicationsSubsystemFailure"/>
            <xs:enumeration value="communicationsProtocolError"/>
            <xs:enumeration value="callEstablishmentError"/>
            <xs:enumeration value="bandwidthReducedX733"/>
            <xs:enumeration value="applicationSubsystemFailture"/>
            <xs:enumeration value="adapterError"/>
            <xs:enumeration value="systemResourcesOverload"/>
            <xs:enumeration value="reducedLoggingCapability"/>
            <xs:enumeration value="excessiveRetransmissionRate"/>
            <xs:enumeration value="excessiveResponseTime"/>
            <xs:enumeration value="excessiveErrorRate"/>
            <xs:enumeration value="congestion"/>
            <xs:enumeration value="bandwidthReduced"/>
            <xs:enumeration value="versionMismatch"/>
            <xs:enumeration value="underlayingResourceUnavailable"/>
            <xs:enumeration value="timeoutExpired"/>
            <xs:enumeration value="softwareError"/>
            <xs:enumeration value="outOfMemory"/>
            <xs:enumeration value="fileError"/>
            <xs:enumeration value="databaseInconsistency"/>
            <xs:enumeration value="configurationOrCustomisationError"/>
            <xs:enumeration value="applicationSubsystemFailure"/>
            <xs:enumeration value="lossOfRealTimel"/>
            <xs:enumeration value="sfwrDownloadFailure"/>
            <xs:enumeration value="sfwrEnvironmentProblem"/>
            <xs:enumeration value="outOfCPUCycles"/>
            <xs:enumeration value="corruptData"/>
            <xs:enumeration value="memoryMismatch"/>
            <xs:enumeration value="storageCapacityProblem"/>
            <xs:enumeration value="externalPointFailure"/>
            <xs:enumeration value="externalEquipmentFailure"/>
            <xs:enumeration value="coolingSystemFailure"/>
            <xs:enumeration value="toxicGas"/>
            <xs:enumeration value="smoke"/>
            <xs:enumeration value="lowWater"/>
            <xs:enumeration value="lowTemperatue"/>
            <xs:enumeration value="lowCablePressure"/>
            <xs:enumeration value="lowHumidity"/>
            <xs:enumeration value="lowFuel"/>
            <xs:enumeration value="intrusionDetection"/>
            <xs:enumeration value="iceBuildUp"/>
            <xs:enumeration value="highWind"/>
            <xs:enumeration value="highTemperature"/>
            <xs:enumeration value="highHumidity"/>
            <xs:enumeration value="flood"/>
            <xs:enumeration value="fire"/>
            <xs:enumeration value="explosiveGas"/>
            <xs:enumeration value="enclosureDoorOpen"/>
            <xs:enumeration value="ventilationsSystemFailure"/>
            <xs:enumeration value="rectifierLowFVoltage"/>
            <xs:enumeration value="rectifierHighVoltage"/>
            <xs:enumeration value="rectifierFailure"/>
            <xs:enumeration value="pumpFailure"/>
            <xs:enumeration value="lowBatteryThreshold"/>
            <xs:enumeration value="generatorFailure"/>
            <xs:enumeration value="fuseFailure"/>
            <xs:enumeration value="fireDetectorFailure"/>
            <xs:enumeration value="engineFailure"/>
            <xs:enumeration value="coolingFanFailure"/>
            <xs:enumeration value="commercialPowerFailure"/>
            <xs:enumeration value="batteryFailure"/>
            <xs:enumeration value="batteryDischarging"/>
            <xs:enumeration value="airDryerFailure"/>
            <xs:enumeration value="airConditioningFailure"/>
            <xs:enumeration value="airCompressorFailure"/>
            <xs:enumeration value="protectingResourceFailure"/>
            <xs:enumeration value="protectionMechanismFailure"/>
            <xs:enumeration value="tranceiverFailure"/>
            <xs:enumeration value="signalQualityEvaluationFailure"/>
            <xs:enumeration value="powerSupplyFailure"/>
            <xs:enumeration value="lossOfRedundancy"/>
            <xs:enumeration value="lossOfSynchronisation"/>
            <xs:enumeration value="iODeviceError"/>
            <xs:enumeration value="frequencyHoppingFailure"/>
            <xs:enumeration value="diskFailure"/>
            <xs:enumeration value="batteryChargingFailure"/>
            <xs:enumeration value="antennaFailure"/>
            <xs:enumeration value="realTimeClockFailure"/>
            <xs:enumeration value="replaceableUnitProblem"/>
            <xs:enumeration value="trunkCardProblem"/>
            <xs:enumeration value="transmitterFailure"/>
            <xs:enumeration value="timingProblem"/>
            <xs:enumeration value="terminalProblem"/>
            <xs:enumeration value="synchronizationSourceMismatch"/>
            <xs:enumeration value="replaceableUnitTypeMismatch"/>
            <xs:enumeration value="replaceableUnitMissing"/>
            <xs:enumeration value="receiverFailure"/>
            <xs:enumeration value="protectionPathFailure"/>
            <xs:enumeration value="processorProblem"/>
            <xs:enumeration value="powerProblem"/>
            <xs:enumeration value="nEIdentifierDuplication"/>
            <xs:enumeration value="multiplexerProblem"/>
            <xs:enumeration value="lineCardProblem"/>
            <xs:enumeration value="externalIFDeviceProblem"/>
            <xs:enumeration value="equipmentIdentifierDuplication"/>
            <xs:enumeration value="dataSetProblem"/>
            <xs:enumeration value="backplaneFailure"/>
            <xs:enumeration value="routingFailure"/>
            <xs:enumeration value="remoteNodeTransmissionError"/>
            <xs:enumeration value="localNodeTransmissionError"/>
            <xs:enumeration value="invalidMessageReceived"/>
            <xs:enumeration value="connectionEstablishmentError"/>
            <xs:enumeration value="broadcastChannelFailure"/>
            <xs:enumeration value="demodulationFailure"/>
            <xs:enumeration value="modulationFailure"/>
            <xs:enumeration value="transmitFailure"/>
            <xs:enumeration value="receiveFailure"/>
            <xs:enumeration value="lossOfMultiFrame"/>
            <xs:enumeration value="signalLabelMismatch"/>
            <xs:enumeration value="unavailable"/>
            <xs:enumeration value="pathTraceMismatch"/>
            <xs:enumeration value="excessiveBER"/>
            <xs:enumeration value="remoteAlarmInterface"/>
            <xs:enumeration value="transmissionError"/>
            <xs:enumeration value="payloadTypeMismatch"/>
            <xs:enumeration value="lossOfSignal"/>
            <xs:enumeration value="lossOfPointer"/>
            <xs:enumeration value="lossOfFrame"/>
            <xs:enumeration value="framingError"/>
            <xs:enumeration value="farEndReceiverFailure"/>
            <xs:enumeration value="degradedSignal"/>
            <xs:enumeration value="callSetUpFailure"/>
            <xs:enumeration value="aIS"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- eventTimeType-->
    <xs:complexType name="eventTimeType">
        <xs:attribute name="year" type="xs:integer" use="required"/>
        <xs:attribute name="month" type="xs:integer" use="required"/>
        <xs:attribute name="day" type="xs:integer" use="required"/>
        <xs:attribute name="hour" type="xs:integer" use="required"/>
        <xs:attribute name="minute" type="xs:integer" use="required"/>
        <xs:attribute name="second" type="xs:integer" use="required"/>
    </xs:complexType>
    <!-- alarmEventType-->
    <xs:complexType name="alarmEventType">
        <xs:attribute name="cause" type="alarmCauseType" use="required"/>
        <xs:attribute name="type" type="alarmEventTypeType" use="required"/>
        <xs:attribute name="severity" type="severityType" use="required"/>
        <xs:attribute name="trend" type="trendIndicationType" use="required"/>
        <xs:attribute name="text" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- rpsEventType-->
    <xs:complexType name="rpsEventType">
        <xs:sequence>
            <xs:element name="time" type="eventTimeType"/>
            <xs:element name="info" type="alarmEventType"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:string" use="required"/>
        <xs:attribute name="class" type="xs:string" use="required"/>
        <xs:attribute name="location" type="xs:string" use="required"/>
        <xs:attribute name="instance" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- events -->
    <xs:element name="events">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="event" type="rpsEventType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

CODE

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_list.xsd">
    <request offset="0" mediator="md1" type="all" count="5">
        <columns>
            <column name="id"/>
            <column name="originalSeverity"/>
            <column name="perceivedSeverity"/>
            <column name="managedObjectClass"/>
            <column name="managedObjectInstance"/>
            <column name="location"/>
            <column name="user_id"/>
            <column sort="desc" name="eventTime"/>
            <column name="probableCause"/>
            <column name="eventType"/>
            <column name="additionalText"/>
        </columns>
        <filters>
            <filter oper="more_or_equal">
                <eventTime minute="0" second="0" day="17" month="09" year="2017" hour="0" />
            </filter>
            <filter oper="not_equal">
                <id value="65353061-3434-3734-6435-383562323062"/>
            </filter>
        </filters>
    </request>
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alarms_list.xsd">
    <response type="all" total="291">
        <time year="2019" month="5" day="14" hour="1" minute="48" second="5"/>
        <columns>
            <column name="id"/>
            <column name="originalSeverity"/>
            <column name="perceivedSeverity"/>
            <column name="managedObjectClass"/>
            <column name="managedObjectInstance"/>
            <column name="location"/>
            <column name="user_id"/>
            <column name="eventTime" sort="desc"/>
            <column name="probableCause"/>
            <column name="eventType"/>
            <column name="additionalText"/>
        </columns>
        <rows>
            <row>
                <id value="30363135-6331-6332-3262-326333346530"/>
                <originalSeverity value="critical"/>
                <perceivedSeverity value="cleared"/>
                <managedObjectClass value="ecss::cluster"/>
                <managedObjectInstance value="sip1"/>
                <location value="mycelium1@ecss1"/>
                <user_id value="[system]"/>
                <eventTime year="2019" month="5" day="14" hour="0" minute="26" second="48"/>
                <probableCause value="softwareProgramAbnormallyTerminated"/>
                <eventType value="processingErrorAlarm"/>
                <additionalText id="rps_tring_cluster" template="Cluster ~s lost" value="Cluster "sip1" lost">
                    <arg value=""sip1""/>
                </additionalText>
            </row>
            <row>
                <id value="30363135-6331-6332-3433-646462386439"/>
                <originalSeverity value="major"/>
                <perceivedSeverity value="cleared"/>
                <managedObjectClass value="ecss::cluster::node"/>
                <managedObjectInstance value="sip1@ecss1"/>
                <location value="ds1@ecss1"/>
                <user_id value="[system]"/>
                <eventTime year="2019" month="5" day="14" hour="0" minute="26" second="48"/>
                <probableCause value="softwareProgramAbnormallyTerminated"/>
                <eventType value="processingErrorAlarm"/>
                <additionalText id="rps_tring_node_cluster" template="Node ~s of ~s cluster terminated abnormaly" value="Node sip1@ecss1 of "sip1" cluster terminated abnormaly">
                    <arg value="sip1@ecss1"/>
                    <arg value=""sip1""/>
                </additionalText>
            </row>
            <row>
                <id value="30363135-6331-6332-3261-653539663736"/>
                <originalSeverity value="critical"/>
                <perceivedSeverity value="cleared"/>
                <managedObjectClass value="ecss::cluster"/>
                <managedObjectInstance value="md1"/>
                <location value="mycelium1@ecss1"/>
                <user_id value="[system]"/>
                <eventTime year="2019" month="5" day="14" hour="0" minute="26" second="14"/>
                <probableCause value="softwareProgramAbnormallyTerminated"/>
                <eventType value="processingErrorAlarm"/>
                <additionalText id="rps_tring_cluster" template="Cluster ~s lost" value="Cluster "md1" lost">
                    <arg value=""md1""/>
                </additionalText>
            </row>
            <row>
                <id value="30363135-6331-6332-3334-396461313836"/>
                <originalSeverity value="major"/>
                <perceivedSeverity value="cleared"/>
                <managedObjectClass value="ecss::cluster::node"/>
                <managedObjectInstance value="md1@ecss1"/>
                <location value="sip1@ecss1"/>
                <user_id value="[system]"/>
                <eventTime year="2019" month="5" day="14" hour="0" minute="26" second="14"/>
                <probableCause value="softwareProgramAbnormallyTerminated"/>
                <eventType value="processingErrorAlarm"/>
                <additionalText id="rps_tring_node_cluster" template="Node ~s of ~s cluster terminated abnormaly" value="Node md1@ecss1 of "md1" cluster terminated abnormaly">
                    <arg value="md1@ecss1"/>
                    <arg value=""md1""/>
                </additionalText>
            </row>
            <row>
                <id value="30363135-6331-6332-3239-313933633437"/>
                <originalSeverity value="critical"/>
                <perceivedSeverity value="cleared"/>
                <managedObjectClass value="ecss::cluster"/>
                <managedObjectInstance value="core1"/>
                <location value="mycelium1@ecss1"/>
                <user_id value="[system]"/>
                <eventTime year="2019" month="5" day="14" hour="0" minute="26" second="14"/>
                <probableCause value="softwareProgramAbnormallyTerminated"/>
                <eventType value="processingErrorAlarm"/>
                <additionalText id="rps_tring_cluster" template="Cluster ~s lost" value="Cluster "core1" lost">
                    <arg value=""core1""/>
                </additionalText>
            </row>
        </rows>
    </response>
</out>
CODE

Hc_alarms_mask_list

Команда возвращает список масок, используемых для маскирования алармов.

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

 cluster/mediator/<md>/alarms/masklist 

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

POST

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

http://host:port/commands/alarms_mask_list

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

hc_alarms_mask_common.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <!-- stringType-->
    <xs:complexType name="stringType">
        <xs:attribute name="value" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- stringArrayType-->
    <xs:complexType name="stringArrayType">
        <xs:sequence>
            <xs:element name="item" type="stringType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <!-- alarmMaskType-->
    <xs:complexType name="alarmMaskType">
        <xs:sequence>
            <xs:choice>
                <xs:element name="location" type="stringType"/>
                <xs:element name="ignoreLocations" type="stringArrayType"/>
            </xs:choice>
            <xs:choice>
                <xs:element name="class" type="stringType"/>
                <xs:element name="ignoreClasses" type="stringArrayType"/>
            </xs:choice>
            <xs:choice>
                <xs:element name="instance" type="stringType"/>
                <xs:element name="ignoreInstances" type="stringArrayType"/>
            </xs:choice>
        </xs:sequence>
        <xs:attribute name="id" type="xs:string" use="optional"/>
        <xs:attribute name="enabled" type="xs:boolean" use="required"/>
        <xs:attribute name="date" type="xs:string" use="optional"/>
    </xs:complexType>
</xs:schema>
CODE

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:include schemaLocation="hc_alarms_mask_common.xsd"/>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:attribute name="mediator" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out-->
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="masks">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="mask" type="alarmMaskType" minOccurs="0" maxOccurs="unbounded
"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

CODE

Пример:

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

<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_mask_list.xsd">
    <request mediator="md1"/>
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alarms_mask_list.xsd">
    <masks>
        <mask id="30363135-6334-6262-3230-633937383736" enabled="true" date="14.05.2019 10:50:10">
            <location value="*"/>
            <class value="*"/>
            <instance value="ds1@ecss1"/>
        </mask>
    </masks>
</out>
CODE

Hc_node_rps_alarms

Команда позволяет включить/выключить систему мониторинга и вывода аварий.

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

 /cluster/mediator/<CLUSTER>/properties/rpss/set 

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

POST

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

http://host:port/commands/node_rps_alarms

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 201 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:simpleType name = "stateType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="on"/>
            <xs:enumeration value="off"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="nodeType">
        <xs:attribute  name="name" type="xs:string" use="required"/>
        <xs:attribute  name="state" type="stateType" use="required"/>
    </xs:complexType>

    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="node" type="nodeType" minOccurs="1" maxOccurs="1"/>
            </xs:all>
    </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="node_rps_onoff.xsd">
    <node name="core1@ecss1" state="on" />
</in>
CODE

Ответ:

201

Hc_alarms_mask_add

Команда позволяет создать маску/маски для аварий.

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

 /cluster/mediator/<CLUSTER>/alarms/maskadd 

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

POST

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

http://host:port/commands/alarms_mask_add

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-файла запроса/ответа:

hc_alarms_mask_common.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="hc_alarms_mask_common.xsd"/>
    <!-- okType -->
    <xs:complexType name="okType">
        <xs:sequence>
            <xs:element name="mask" type="alarmMaskType" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
    </xs:complexType>
    <!-- errorReasonType -->
    <xs:simpleType name = "errorReasonType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="conflict" />
            <xs:enumeration value="notfound" />
        </xs:restriction>
    </xs:simpleType>
    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:sequence>
            <xs:element name="mask" type="alarmMaskType" minOccurs="1" maxOccurs="1"/>
            <xs:element name="conflictMask" type="alarmMaskType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="reason" type="errorReasonType" use="required"/>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="masks">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="mask" type="alarmMaskType" minOccurs="0" maxOccurs="unbounded"/>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="mediator" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out-->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="ok" type="okType" minOccurs="0" maxOccurs="unbounded"/>
                            <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_mask_add.xsd">
    <request mediator="md1">
        <masks>
            <mask enabled="true">
                <location value="core1@ecss1"/>
                <class value="ecss::zmq::connection"/>
                <instance value="msr_2(192.168.2.22:5700)"/>
            </mask>
            <mask enabled="true">
                <location value="ecss1"/>
                <class value="hw::interfaces"/>
                <instance value="bond1.2:2"/>
            </mask>
        </masks>
    </request>
</in>
CODE

Ответ:

Код: 200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alarms_mask_add.xsd">
    <response>
        <ok>
            <mask id="30363135-6336-3132-3861-303135366466" enabled="true" date="14.05.2019 12:21:44">
                <location value="ecss1"/>
                <class value="hw::interfaces"/>
                <instance value="bond1.2:2"/>
            </mask>
        </ok>
        <ok>
            <mask id="30363135-6336-3132-3861-303038366132" enabled="true" date="14.05.2019 12:21:44">
                <location value="core1@ecss1"/>
                <class value="ecss::zmq::connection"/>
                <instance value="msr_2(192.168.2.22:5700)"/>
            </mask>
        </ok>
    </response>
</out>
CODE

Hc_alarms_mask_del

Команда позволяет удалить маску/маски для аварий.

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

 /cluster/mediator/<CLUSTER>/alarms/maskdel 

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

POST

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

http://host:port/commands/alarms_mask_del

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить двумя сообщениями:

  • 204 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <!-- alarmMaskType-->
    <xs:complexType name="alarmMaskType">
        <xs:attribute name="id" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="masks">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="mask" type="alarmMaskType" minOccurs="0" maxOccurs="unbounded"/>
                                    </xs:sequence>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="mediator" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

CODE

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_mask_del.xsd">
    <request mediator="md1">
        <masks>
            <mask id="65353163-6466-6334-3861-666566626238"/>
            <mask id="65353163-3738-3161-3636-646462383537"/>
        </masks>
    </request>
</in>
CODE

Ответ:

204

Hc_alarms_clear

Команда позволяет удалить аварии из системы по идентификатору.

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

 /cluster/mediator/<CLUSTER>/alarms/clear 

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

POST

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

http://host:port/commands/alarms_clear

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 204 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-файла c запросом:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <!-- clearEventType -->
    <xs:complexType name="clearEventType">
        <xs:attribute name="id" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="events">
                    <xs:complexType>
                        <xs:choice>
                            <xs:sequence>
                                <xs:element name="event" type="clearEventType" maxOccurs="unbounded"/>
                            </xs:sequence>
                            <xs:element name="all"/>
                        </xs:choice>
                        <xs:attribute name="mediator" type="xs:string" use="required"/>
                        <xs:attribute name="userId" type="xs:string" use="optional">
                            <xs:annotation>
                                <xs:documentation xml:lang="en">
                                    Deprecated attribute.
								</xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

CODE

rps.xsd: 

См. схему запроса списка алармов в системе

Пример 1:

Отметка каждого из выбранных алармов, как просмотренные.

Запрос: http://192.168.1.21:9999/cluster/mediator/md/alarms_clear
Параметры:

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_clear.xsd">
    <events mediator="md1" userId="admin">
        <event id="30363333-3436-6564-3932-353930383363"/>
    </events>
</in>
CODE

Ответ:

204

Пример 2:

Отметка всех алармов, как просмотренные.

Запрос: http://192.168.1.21:9999/cluster/mediator/md/alarms_clear
Параметры:

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_clear.xsd">
    <events mediator="md1" userId="ecss1">
        <all/>
    </events>
</in>
CODE

Ответ:

204

Hc_alarms_delete

Команда позволяет удалить очищенные аварии из системы по следующим критериям:

  • последние N алармов;
  • в случае, если после удаления остаются активные алармы, отображает их колличество;
  • алармы за определенный промежуток времени;
  • алармы с определенными идентификаторами;
  • все алармы.

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

 /cluster/mediator/<CLUSTER>/alarms/delete 

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

POST

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

http://host:port/commands/alarms_delete

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 204 – в случае успеха;
  • 404 – в случае ошибки.

XSD-схема XML-файла c запросом:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!-- timeType-->
	<xs:complexType name="timeType">
		<xs:attribute name="year" type="xs:integer" use="required"/>
		<xs:attribute name="month" type="xs:integer" use="required"/>
		<xs:attribute name="day" type="xs:integer" use="required"/>
		<xs:attribute name="hour" type="xs:integer" use="required"/>
		<xs:attribute name="minute" type="xs:integer" use="required"/>
		<xs:attribute name="second" type="xs:integer" use="required"/>
	</xs:complexType>
	<!-- in -->
	<xs:element name="in">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="request">
					<xs:complexType>
						<xs:choice>
							<xs:element name="all">
								<xs:complexType/>
							</xs:element>
							<xs:element name="last">
								<xs:complexType>
									<xs:attribute name="count" type="xs:integer" use="required"/>
								</xs:complexType>
							</xs:element>
							<xs:element name="between">
								<xs:complexType>
									<xs:all>
										<xs:element name="from" type="timeType" minOccurs="0" maxOccurs="1"/>
										<xs:element name="to" type="timeType" minOccurs="0" maxOccurs="1"/>
									</xs:all>
								</xs:complexType>
							</xs:element>
							<xs:element name="ids">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="id" minOccurs="0" maxOccurs="unbounded">
											<xs:complexType>
												<xs:attribute name="value" type="xs:string" use="required"/>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:choice>
						<xs:attribute name="mediator" type="xs:string" use="required"/>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!-- out -->
	<xs:element name="out">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="result">
					<xs:complexType>
						<xs:attribute name="active_alarms_count" type="xs:integer" use="required"/>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>

CODE

Пример:

  1. Пример запроса удаления последних 10-ти алармов:

    Запрос: http://192.168.1.21:9999/commands/alarms_delete
    Параметры:

    <?xml version="1.0" encoding="UTF-8"?>
    <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_delete.xsd">
        <request mediator="md1">
            <last count="10" />
        </request>
    </in>
    CODE

    Ответ: 204

    <?xml version="1.0"?>
    <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alarms_delete.xsd">
    	<result active_alarms_count="1"/>
    </out>
    CODE
  2. Пример запроса удаления алармов, случившихся после 2019/05/13 16:00:00:

    Запрос: http://192.168.1.21:9999/commands/alarms_delete
    Параметры:

    <?xml version="1.0" encoding="UTF-8"?>
    <in
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_delete.xsd">
        <request mediator="md1">
            <between>
                <from day="13" month="5" year="2019" hour="16" minute="0" second="0" />
            </between>
        </request>
    </in>
    CODE

    Ответ: 204

    <?xml version="1.0"?>
    <out
        xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alarms_delete.xsd">
        <result active_alarms_count="3"/>
    </out>
    CODE
  3. Пример запроса удаления алармов по идентификаторам:

    Запрос: http://192.168.1.21:9999/commands/alarms_delete
    Параметры:

    Ответ: 200

    <?xml version="1.0" encoding="UTF-8"?>
    <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_delete.xsd">
        <request mediator="md1">
            <ids>
                <id value="30363333-3932-6164-3534-303931383665" />
            </ids>
        </request>
    </in>
    CODE
  4. Пример запроса удаления всех алармов:

    Запрос: http://192.168.1.21:9999/commands/alarms_delete
    Параметры:

    <?xml version="1.0" encoding="UTF-8"?>
    <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_delete.xsd">
        <request mediator="md1">
            <all/>
        </request>
    </in>
    CODE

    Ответ: 200

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




Hc_alarm_notifiers_options_clean

Команда позволяет сбрасывать значения параметров службы уведомления по электронной почте или Jabber.

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

 /cluster/mediator/<CLUSTER>/alarms/notifiers/email/clean  
/domain/<DOMAIN>/alarms/notifiers/email/clean

/cluster/mediator/<CLUSTER>/alarms/notifiers/jabber/clean
/domain/<DOMAIN>/alarms/notifiers/jabber/clean

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

http://host:port/commands/alarm_notifiers_options_clean

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XML-схема

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:annotation>
        <xs:documentation xml:lang="en">
      Clean properties of alarm notifier service.
      Usage: http://server:9999/commands/alarm_notifiers_options_clean.
      Implementation: hc_alarm_notifiers_options_clean.erl.
      Git: git@git.eltex.loc:httpTerminal.git.
      Copyright (c) 2016, Eltex. All rights reserved.
    </xs:documentation>
    </xs:annotation>
    <xs:include schemaLocation="error.xsd"/>
    <xs:include schemaLocation="ecm_common.xsd"/>
    <!-- resultType-->
    <xs:complexType name="resultType">
        <xs:all>
            <xs:element name="domain_options" type="domainCleanOutType" minOccurs="1"/>
        </xs:all>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="domain_options" type="domainCleanInType"/>
                        </xs:all>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="result" type="resultType"/>
                <xs:element name="error" type="errorType"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>

CODE

Пример:

http://192.168.1.21:9999/commands/alarm_notifiers_options_clean

Запрос:

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alarm_notifiers_options_clean.xsd">
    <request>
        <domain_options>
            <system/>
            <domain name="biysk.local">
                <option name="email_body_limit"/>
                <option name="email_enabled"/>
                <option name="jabber_body_format"/>
                <option name="jabber_body_limit"/>
            </domain>
        </domain_options>
    </request>
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alarm_notifiers_options_clean.xsd">
    <result>
        <domain_options>
            <system/>
            <domain name="biysk.local">
                <success option="email_body_limit"/>
                <success option="email_enabled"/>
                <success option="jabber_body_format"/>
                <success option="jabber_body_limit"/>
            </domain>
        </domain_options>
    </result>
</out>
CODE

Hc_alarm_notifiers_options_info

Команда просмотра текущих настроек аварийных уведомлений, которые передаются через электронную почту или Jabber.

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

 /cluster/mediator/<CLUSTER>/alarms/notifiers/email/info  
/domain/<DOMAIN>/alarms/notifiers/email/info

/cluster/mediator/<CLUSTER>/alarms/notifiers/jabber/info
/domain/<DOMAIN>/alarms/notifiers/jabber/info

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

http://host:port/commands/alarm_notifiers_options_info

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XML-схема

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
           attributeFormDefault="unqualified">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Show properties of alarm notifier service.
            Usage: http://server:9999/commands/alarm_notifiers_options_info.
            Implementation: hc_alarm_notifiers_options_info.erl.
            Git: git@git.eltex.loc:httpTerminal.git.
            Copyright (c) 2016, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>
    <xs:include schemaLocation="error.xsd"/>
    <xs:include schemaLocation="ecm_common.xsd"/>
    <xs:complexType name="alarmNotifiersOptionsType">
        <xs:complexContent>
            <xs:extension base="baseOptionsType">
                <xs:attribute name="email_body_format" type="xs:string" use="optional"/>
                <xs:attribute name="email_body_limit" type="xs:string" use="optional"/>
                <xs:attribute name="email_enabled" type="booleanType" use="optional"/>
                <xs:attribute name="email_from_name" type="xs:string" use="optional"/>
                <xs:attribute name="email_subject_format" type="xs:string" use="optional"/>
                <xs:attribute name="email_subject_limit" type="xs:string" use="optional"/>
                <xs:attribute name="to_emails" type="xs:string" use="optional">
                    <xs:annotation>
                        <xs:documentation xml:lang="en">
                            The list of email addresses separated by ";".
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="email_to_name" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_body_format" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_body_limit" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_enabled" type="booleanType" use="optional"/>
                <xs:attribute name="to_jids" type="xs:string" use="optional">
                    <xs:annotation>
                        <xs:documentation xml:lang="en">
                            The list of jabber addresses separated by ";".
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <!-- resultType-->
    <xs:complexType name="resultType">
        <xs:all>
            <xs:element name="domain_options" type="domainInfoOutType" minOccurs="1"/>
        </xs:all>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="domain_options" type="domainInfoInType" minOccurs="1"/>
                        </xs:all>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="result" type="resultType"/>
                <xs:element name="error" type="errorType"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример:

http://192.168.1.21:9999/commands/alarm_notifiers_options_info

Запрос:

<?xml version="1.0"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarm_notifiers_options_info.xsd">
    <request>
         <domain_options domain="biysk.local"/>
    </request>
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alarm_notifiers_options_info.xsd">
    <result>
        <domain_options>
            <system>
                <options xs:type="alarmNotifiersOptionsType"/>
            </system>
            <domain name="biysk.local">
                <options xs:type="alarmNotifiersOptionsType" to_jids="" to_emails="ryaskowa.s@yandex.ru" jabber_enabled="false" jabber_body_limit="1000" jabber_body_format="Class: %CLASS% ~nLocation: %LOCATION% ~nInstance: %INSTANCE% ~nTime: %TIME% ~nText: %TEXT%" email_to_name="ECSS-SUPPORT" email_subject_limit="75" email_subject_format="ALARM (%SEVERITY%)" email_from_name="ECSS-NO-REPLY-ALARM-NOTIFICATOR" email_enabled="true" email_body_limit="1500" email_body_format="Class: %CLASS% ~nLocation: %LOCATION% ~nInstance: %INSTANCE% ~nTime: %TIME% ~nText: %TEXT%"/>
            </domain>
        </domain_options>
    </result>
</out>
CODE

Hc_alarm_notifiers_options_set

Команда настройки параметров уведомления, отправляемого по электронной почте или Jabber.

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

 /cluster/mediator/<CLUSTER>/alarms/notifiers/email/set  
/domain/<DOMAIN>/alarms/notifiers/email/set

/cluster/mediator/<CLUSTER>/alarms/notifiers/jabber/set
/domain/<DOMAIN>/alarms/notifiers/jabber/set

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

http://host:port/commands/alarm_notifiers_options_set

Код HTTP-ответа:

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XML-схема

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
           attributeFormDefault="unqualified">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Set properties of alarm notifier service.
            Usage: http://server:9999/commands/alarm_notifiers_options_set.
            Implementation: hc_alarm_notifiers_options_set.erl.
            Git: git@git.eltex.loc:httpTerminal.git.
            Copyright (c) 2016, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>
    <xs:include schemaLocation="error.xsd"/>
    <xs:include schemaLocation="ecm_common.xsd"/>
    <!-- Types -->
    <xs:complexType name="alarmNotifiersOptionsType">
        <xs:complexContent>
            <xs:extension base="baseOptionsType">
                <xs:attribute name="email_body_format" type="xs:string" use="optional"/>
                <xs:attribute name="email_body_limit" type="xs:string" use="optional"/>
                <xs:attribute name="email_enabled" type="booleanType" use="optional"/>
                <xs:attribute name="email_from_name" type="xs:string" use="optional"/>
                <xs:attribute name="email_subject_format" type="xs:string" use="optional"/>
                <xs:attribute name="email_subject_limit" type="xs:string" use="optional"/>
                <xs:attribute name="to_emails" type="xs:string" use="optional">
                    <xs:annotation>
                        <xs:documentation xml:lang="en">
                            The list of email addresses separated by ";".
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="email_to_name" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_body_format" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_body_limit" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_enabled" type="booleanType" use="optional"/>
                <xs:attribute name="to_jids" type="xs:string" use="optional">
                    <xs:annotation>
                        <xs:documentation xml:lang="en">
                            The list of jabber addresses separated by ";".
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <!-- resultType-->
    <xs:complexType name="resultType">
        <xs:all>
            <xs:element name="domain_options" type="domainSetOutType" minOccurs="1"/>
        </xs:all>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="domain_options" type="domainSetInType"/>
                        </xs:all>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="result" type="resultType" minOccurs="1" maxOccurs="1"/>
                <xs:element name="error" type="errorType" minOccurs="1" maxOccurs="1"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>

CODE

Пример:

http://192.168.1.21:9999/commands/alarm_notifiers_options_set

Запрос:

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alarm_notifiers_options_set.xsd">
    <request>
        <domain_options>
            <system>
                <options xs:type="alarmNotifiersOptionsType"/>
            </system>
            <domain name="biysk.local">
                <options xs:type="alarmNotifiersOptionsType" email_body_limit="1500" email_enabled="false" email_from_name="ECSS-NO-REPLY-ALARM-NOTIFICATOR" email_subject_limit="75" to_emails="ryaskowa.s@yandex.ru"/>
            </domain>
        </domain_options>
    </request>
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alarm_notifiers_options_set.xsd">
    <result>
        <domain_options>
            <system/>
            <domain name="biysk.local">
                <success option="email_body_limit"/>
                <success option="email_enabled"/>
                <success option="email_from_name"/>
                <success option="email_subject_limit"/>
                <success option="to_emails"/>
            </domain>
        </domain_options>
    </result>
</out>
CODE

Hc_alarms_notifiers_send_test_msg

Команда позволяет послать тестовое сообщение об аварии на ECSS-10 по почте/jabber.

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

 cluster/mediator/<CLUSTER>/alarms/notifiers/email/send_test_email  
domain/<DOMAIN>/alarms/notifiers/email/send_test_email

cluster/mediator/<CLUSTER>/alarms/notifiers/jabber/send_test_email
domain/<DOMAIN>/alarms/notifiers/jabber/send_test_email

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

POST

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

http://host:port/commands/alarms_notifiers_send_test_msg

Код 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">
    <xs:include schemaLocation="error.xsd" />
    <xs:simpleType name="typeType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="email"/>
            <xs:enumeration value="jabber"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:attribute name="domain" type="xs:string" use="required"/>
                        <xs:attribute name="type" type="typeType" use="required"/>
                        <xs:attribute name="msg" type="xs:string" use="optional"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>

          
    <!-- out-->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <!--Positive case-->
                <xs:element name="response">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="ok"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <!--Or error-->
                <xs:element name="error" type="errorType"/>
          </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример

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

<?xml version="1.0"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alarms_notifiers_send_test.xsd">
  <request domain="biysk.local" type="email" msg="Test message"/>
</in>
CODE

Ответ:

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