Hc_domain_regime - Управление режимами обслуживания абонентов
Hc_domain_import_regime
Команда позволяет изменить параметр Regime у абонентов системы при помощи списка.
Команда используется для оперативного изменения режима обслуживания у абонентов.
Аналог команды в CoCon:
/cluster/storage/<CLUSTER>/alias/import-regime
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_import_regime
Код HTTP-ответа:
При выполнении команды HTTP-терминал может ответить следующими сообщениями:
- 206 – в случае прогресса;
- 201 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="regimeType">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="address" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="domainType">
<xs:sequence>
<xs:element name="regime" type="regimeType" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="refType">
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="okType">
<xs:attribute name="domain" type="xs:string" use="required"/>
<xs:attribute name="address" type="xs:string" use="required"/>
<xs:attribute name="regime" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="errorType">
<xs:attribute name="reason" type="xs:string" use="required"/>
<xs:attribute name="domain" type="xs:string" use="required"/>
<xs:attribute name="address" type="xs:string" use="required"/>
<xs:attribute name="regime" type="xs:string" use="required"/>
</xs:complexType>
<xs:element name="in">
<xs:complexType>
<xs:all>
<xs:element name="domain" type="domainType" minOccurs="1" />
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="progress">
<xs:complexType>
<xs:sequence>
<xs:element name="ref" minOccurs="1" maxOccurs="1" type="refType" />
<xs:element name="ok" minOccurs="0" maxOccurs="unbounded" type="okType" />
<xs:element name="error" minOccurs="0" maxOccurs="unbounded" type="errorType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/domain_import_regime
<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="domain_import_regime.xsd">
<domain name="biysk.local">
<regime name="accpori" address="240500" />
<regime name="accpori" address="240501" />
<regime name="accpori" address="240502" />
<regime name="block_international" address="240316" />
<regime name="accsusp" address="240699" />
</domain>
</in>
Ответ: 206
Команда посылает прогрессы с состояниями. В одном не более 10 адресов.
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="domain_import_regime.xsd">
<ref value="md1@ecss1:1827"/>
<ok domain="biysk.local" address="240699" regime="accsusp"/>
<ok domain="biysk.local" address="240316" regime="block_international"/>
<ok domain="biysk.local" address="240502" regime="accpori"/>
<ok domain="biysk.local" address="240501" regime="accpori"/>
<ok domain="biysk.local" address="240500" regime="accpori"/>
</out>
Hc_domain_regime_info
Команда позволяет просмотреть профили Regime-доступа.
Аналог команды в CoCon:
/domain/<DOMAIN>/regime/info
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_regime_info
Код HTTP-ответа:
При выполнении команды HTTP-терминал может ответить следующими сообщениями:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла c ответом:
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="regimeInType">
<xs:attribute name="domain" type="xs:string" use="required"/>
<xs:attribute name="name" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="regimeType">
<xs:attribute name="domain" type="xs:string" use="required"/>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="private_in" type="xs:boolean" use="required"/>
<xs:attribute name="private_out" type="xs:boolean" use="required"/>
<xs:attribute name="local_in" type="xs:boolean" use="required"/>
<xs:attribute name="local_out" type="xs:boolean" use="required"/>
<xs:attribute name="zone_in" type="xs:boolean" use="required"/>
<xs:attribute name="zone_out" type="xs:boolean" use="required"/>
<xs:attribute name="intercity_in" type="xs:boolean" use="required"/>
<xs:attribute name="intercity_out" type="xs:boolean" use="required"/>
<xs:attribute name="international_in" type="xs:boolean" use="required"/>
<xs:attribute name="international_out" type="xs:boolean" use="required"/>
<xs:attribute name="emergency_in" type="xs:boolean" use="required"/>
<xs:attribute name="emergency_out" type="xs:boolean" use="required"/>
<xs:attribute name="cause" type="xs:string" use="optional"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<xs:element name="in">
<xs:complexType>
<xs:all>
<xs:element name="regime" type="regimeInType" minOccurs="1" />
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="out">
<xs:complexType>
<xs:sequence>
<xs:element name="regime" type="regimeType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/domain_regime_info
<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="domain_regime_info.xsd">
<regime domain="biysk.local" />
</in>
Ответ: 200
<?xml version="1.0"?>
<out
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="domain_regime_info.xsd">
<regime domain="biysk.local" name="accsusp" private_in="false" private_out="false" local_in="false" local_out="false" zone_in="false" zone_out="false" intercity_in="false" intercity_out="false" international_in="false" international_out="false" emergency_in="true" emergency_out="true" cause="21" description="accsusp"/>
<regime domain="biysk.local" name="city" private_in="true" private_out="true" local_in="true" local_out="true" zone_in="true" zone_out="false" intercity_in="true" intercity_out="false" international_in="true" international_out="false" emergency_in="true" emergency_out="true" cause="21" description="block 8"/>
<regime domain="biysk.local" name="block_international" private_in="true" private_out="true" local_in="true" local_out="true" zone_in="true" zone_out="true" intercity_in="true" intercity_out="true" international_in="false" international_out="false" emergency_in="true" emergency_out="true" cause="" description=""/>
</out>
Hc_domain_regime_remove
Команда позволяет удалить профиль Regime-доступа.
Аналог команды в CoCon:
/domain/<DOMAIN>/regime/remove
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_regime_remove
Код HTTP-ответа:
При выполнении команды HTTP-терминал может ответить следующими сообщениями:
- 204 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="regimeType">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="domain" type="xs:string" use="required"/>
</xs:complexType>
<xs:element name="in">
<xs:complexType>
<xs:sequence>
<xs:element name="regime" type="regimeType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/domain_regime_remove
<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="domain_regime_remove.xsd">
<regime domain="biysk.local" name="city" />
</in>
Ответ: 204
Hc_domain_regime_declare
Команда предназначена для создания нового профиля режима доступа.
Аналог команды в CoCon:
/domain/<DOMAIN>/regime/declare
Метод http запроса:
POST
Шаблон http запроса:
http://host:port/commands/domain_regime_declare
Код http ответа:
204 – в случае успеха;
404 – в случае ошибки.
Xsd схема xml файла запроса/ответа:
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="regimeType">
<xs:attribute name="domain" type="xs:string" use="required"/>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="private_in" type="xs:boolean" use="required"/>
<xs:attribute name="private_out" type="xs:boolean" use="required"/>
<xs:attribute name="local_in" type="xs:boolean" use="required"/>
<xs:attribute name="local_out" type="xs:boolean" use="required"/>
<xs:attribute name="zone_in" type="xs:boolean" use="required"/>
<xs:attribute name="zone_out" type="xs:boolean" use="required"/>
<xs:attribute name="intercity_in" type="xs:boolean" use="required"/>
<xs:attribute name="intercity_out" type="xs:boolean" use="required"/>
<xs:attribute name="international_in" type="xs:boolean" use="required"/>
<xs:attribute name="international_out" type="xs:boolean" use="required"/>
<xs:attribute name="emergency_in" type="xs:boolean" use="required"/>
<xs:attribute name="emergency_out" type="xs:boolean" use="required"/>
<xs:attribute name="cause" type="xs:string" use="optional"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<xs:element name="in">
<xs:complexType>
<xs:sequence>
<xs:element name="regime" type="regimeType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/domain_regime_declare
<?xml version="1.0" encoding="UTF-8"?>
<in
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="../priv/xsd/domain_regime_declare.xsd">
<regime domain="biysk.local" name="block_international" private_in="true" private_out="true" local_in="true" local_out="true" zone_in="true" zone_out="true"
intercity_in="true" intercity_out="true" international_in="false" international_out="false" emergency_in="true" emergency_out="true"/>
<regime domain="biysk.local" name="city" private_in="true" private_out="true" local_in="true" local_out="true" zone_in="true" zone_out="false"
intercity_in="true" intercity_out="false" international_in="true" international_out="false" emergency_in="true" emergency_out="true" cause="21" description="block 8"/>
</in>
Ответ: 204