Hc_restfs_clusters_autocleaner_add_rule

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

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

restfs/<RESTFS-CLUSTERNAME>/autocleaner/add-rule

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

POST

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

http://host:port/commands/restfs_clusters_autocleaners_add_rule

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

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

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

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

    <xs:include schemaLocation="error.xsd"/>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="cluster" minOccurs="1" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="rule" minOccurs="1" maxOccurs="unbounded">
                                            <xs:complexType>
                                                <xs:attribute name="position" type="xs:nonNegativeInteger" use="optional"/>
                                                <xs:attribute name="file_path" type="xs:string" use="required"/>
                                                <xs:attribute name="file_mask" type="xs:string" use="required"/>
                                                <xs:attribute name="outdate" type="xs:nonNegativeInteger" use="required"/>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                    <xs:attribute name="name" type="xs:string" use="required"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>
XML

Пример:

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

<in>
    <request>
        <cluster name="default">
            <rule position="6" file_path="test4" file_mask="*.png" outdate="10"/>
            <rule file_path="mp4" file_mask="*.mp4" outdate="7"/>
        </cluster>
    </request>
</in>
XML

Ответ:

status: 200
content: 
XML

Hc_restfs_clusters_autocleaner_change_rule

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

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

restfs/<RESTFS-CLUSTERNAME>/autocleaner/change-rule

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

POST

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

http://host:port/commands/restfs_clusters_autocleaners_change_rule

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

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

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

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

    <xs:include schemaLocation="error.xsd"/>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="cluster" minOccurs="1" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="rule" minOccurs="1" maxOccurs="unbounded">
                                            <xs:complexType>
                                                <xs:attribute name="position" type="xs:nonNegativeInteger" use="required"/>
                                                <xs:attribute name="file_path" type="xs:string" use="optional"/>
                                                <xs:attribute name="file_mask" type="xs:string" use="optional"/>
                                                <xs:attribute name="outdate" type="xs:nonNegativeInteger" use="optional"/>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                    <xs:attribute name="name" type="xs:string" use="required"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </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" maxOccurs="unbounded"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>

</xs:schema>
XML

Пример:

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

<in>
    <request>
        <cluster name="default">
            <rule position="3" file_path="test2" file_mask="*.tiff" outdate="5"/>
            <rule position="4" file_path="test5" file_mask="*.mp3" outdate="3"/>
        </cluster>
        <cluster name="mpeg">
            <rule position="1" file_path="mpeg" file_mask="*.mp4" outdate="3"/>
        </cluster>
    </request>
</in>
XML

Ответ:

status: 201
content: 
XML

Hc_restfs_clusters_autocleaner_info

Команда показывает список правил подсистемы Autocleaner кластера Restfs.

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

restfs/<RESTFS-CLUSTERNAME>/autocleaner/info

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

POST

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

http://host:port/commands/restfs_clusters_autocleaners_info

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

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

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

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

    <xs:include schemaLocation="error.xsd"/>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="cluster" minOccurs="1" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:attribute name="name" type="xs:string" use="required"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="cluster" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="rule" minOccurs="0" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:attribute name="position" type="xs:integer" use="required"/>
                                    <xs:attribute name="file_path" type="xs:string" use="required"/>
                                    <xs:attribute name="file_mask" type="xs:string" use="required"/>
                                    <xs:attribute name="outdate" type="xs:string" use="required"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="name" type="xs:string" use="required"/>
                        <xs:attribute name="peer" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>
XML

Пример:

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

<in>
    <request>
        <cluster name="default"/>
        <cluster name="ringtones"/>
    </request>
</in>
XML

Ответ:

status: 200
content: 
<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_restfs_clusters_autocleaner_info.xsd">
    <cluster name="default" peer="http://system.restfs.ecss:9990">
        <rule position="1" file_path="mpeg" file_mask="*.mp4" outdate="3"/>
        <rule position="2" file_path="records" file_mask="*.mp3" outdate="180"/>
        <rule position="3" file_path="test2" file_mask="*.tiff" outdate="5"/>
        <rule position="4" file_path="test5" file_mask="*.mp3" outdate="3"/>
        <rule position="5" file_path="records" file_mask="*.wav" outdate="180"/>
        <rule position="6" file_path="test4" file_mask="*.png" outdate="10"/>
        <rule position="7" file_path="mp4" file_mask="*.mp4" outdate="7"/>
    </cluster>
    <cluster name="mpeg" peer="http://192.168.1.21:9990">
        <rule position="1" file_path="mpeg" file_mask="*.mp4" outdate="3"/>
        <rule position="2" file_path="records" file_mask="*.mp3" outdate="180"/>
        <rule position="3" file_path="test2" file_mask="*.tiff" outdate="5"/>
        <rule position="4" file_path="test5" file_mask="*.mp3" outdate="3"/>
        <rule position="5" file_path="records" file_mask="*.wav" outdate="180"/>
        <rule position="6" file_path="test4" file_mask="*.png" outdate="10"/>
        <rule position="7" file_path="mp4" file_mask="*.mp4" outdate="7"/>
    </cluster>
</out>
XML


Hc_restfs_clusters_autocleaner_remove_rule

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

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

restfs/<RESTFS-CLUSTERNAME>/autocleaner/remove_rule

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

POST

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

http://host:port/commands/restfs_clusters_autocleaners_remove_rule

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

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

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

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

    <xs:include schemaLocation="error.xsd"/>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="cluster" minOccurs="1" maxOccurs="unbounded">
                                <xs:complexType>
                                    <xs:sequence>
                                        <xs:element name="rule" minOccurs="1" maxOccurs="unbounded">
                                            <xs:complexType>
                                                <xs:attribute name="position" type="xs:nonNegativeInteger" use="required"/>
                                            </xs:complexType>
                                        </xs:element>
                                    </xs:sequence>
                                    <xs:attribute name="name" type="xs:string" use="required"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </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" maxOccurs="unbounded"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>

</xs:schema>
XML

Пример:

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

<in>
    <request>
        <cluster name="default">
            <rule position="3"/>
        </cluster>
        <cluster name="mpeg">
            <rule position="4"/>
        </cluster>
    </request>
</in>
XML

Ответ:

status: 201
content: 
XML

Ответ в случае ошибки:

status: 200
content: 
<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_restfs_clusters_autocleaner_remove_rule.xsd">
    <error cmd="hc_restfs_clusters_autocleaner_remove_rule" reason="high id: 4" entity="mpeg"/>
    <error cmd="hc_restfs_clusters_autocleaner_remove_rule" reason="high id: 3" entity="default"/>
</out>
XML