Hc_security_profile_clean

Команда позволяет вернуть одно или все свойства профиля безопасности к значениям по-умолчанию

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

/system/security/profile/clean

/domain/<DOMAIN>/security/profile/clean

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

http://host:port/commands/hc_security_profile_clean

Коды ответа:

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

Xsd схема XML запроса/ответа

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="error.xsd"/>

    <xs:complexType name="domainType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="profileType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="optionType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="domain" type="domainType" minOccurs="0" maxOccurs="1"/>
                            <xs:element name="profile" type="profileType"/>
                            <xs:element name="option" type="optionType" minOccurs="0" maxOccurs="1"/>
                        </xs:sequence>
                    </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" fixed="ok"/>
                <!--Or error-->
                <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_security_profile_clean.xsd">
    <request>
        <profile name="test.profile"/>
    </request>
</in>
CODE

Код ответа:
200

Ответ:

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

Hc_security_profile_info

Команда позволяет просмотреть список и свойства профилей безопасности

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

/system/security/profile/info

/domain/<DOMAIN>/security/profile/info

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

http://host:port/commands/hc_security_profile_info

Коды ответа:

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

Xsd схема XML запроса/ответа

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="error.xsd"/>

    <xs:complexType name="domainType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="profileType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="profileOutType">
        <xs:choice>
            <xs:element name="password_restrictions">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="password_restriction" type="restrictionType" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="password_restrictions" fixed="default"/>
        </xs:choice>
        <xs:attribute name="system" type="xs:string" use="required"/>
        <xs:attribute name="show_password_at_cli" type="xs:string" use="required"/>
        <xs:attribute name="show_password_at_api" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="restrictionType">
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="args" type="xs:string" use="required"/>
        <xs:attribute name="msg" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="domain" type="domainType" minOccurs="0" maxOccurs="1"/>
                            <xs:element name="profile" type="profileType" minOccurs="0" maxOccurs="1"/>
                        </xs:sequence>
                    </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="profile" type="profileOutType" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <!--Or error-->
                <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_security_profile_info.xsd">
    <request>
        <domain name="d.city"/>
        <profile name="callcenter"/>
    </request>
</in>

CODE

Код ответа:
200

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_security_profile_info.xsd">
    <response>
        <profile system="callcenter" show_password_at_cli="true" show_password_at_api="true">
            <password_restrictions/>
        </profile>
    </response>
</out>
CODE

Hc_security_profile_set

Команда позволяет изменить список профилей безопасности

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

/system/security/profile/set

/domain/<DOMAIN>/security/profile/set

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

http://host:port/commands/hc_security_profile_set

Коды ответа:

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

Xsd схема XML запроса/ответа

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="error.xsd"/>

    <xs:complexType name="domainType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="profilesType">
        <xs:sequence>
            <xs:element name="profile" type="profileType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="profileType">
        <xs:choice>
            <xs:element name="password_restrictions">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="password_restriction" type="restrictionType" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="password_restrictions" fixed="default"/>
        </xs:choice>
        <xs:attribute name="system" type="xs:string" use="required"/>
        <xs:attribute name="show_password_at_cli" type="xs:string" use="required"/>
        <xs:attribute name="show_password_at_api" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="restrictionType">
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="args" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="domain" type="domainType" minOccurs="0"/>
                            <xs:element name="profiles" type="profilesType"/>
                        </xs:sequence>
                    </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" fixed="ok"/>
                <!--Or error-->
                <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_security_profile_set.xsd">
    <request>
        <profiles>
            <profile system="test_profile" show_password_at_cli="true" show_password_at_api="default">
                <password_restrictions>default</password_restrictions>
            </profile>
        </profiles>
    </request>
</in>
CODE

Код ответа:
200

Ответ:

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