Changing Log Rotation Settings

The set operation is used to change settings of Log Rotation.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet changing Log Rotation settings includes the set operation node:

<packet>
<log-rotation>
   <set>
   ...
   </set>
</log-rotation>
</packet>

 

The set node is presented by type LogRotationSetInput (logrotation.xsd), and its graphical representation is as follows:

SET_RPS

Remarks

You can use different filtering rules in a single packet. Add as many set operations as the number of different filtering rules.

<packet>
<log-rotation>
   <set>
   ...
   </set>
...
   <set>
   ...
   </set>
</log-rotation>
</packet>

Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.

 

Response Packet Structure

The set node of the output XML packet is presented by type LogRotationSetOutput (logrotation.xsd) and structured as follows:

 

 

Samples

Changing settings of a single site

The following request packet changes Log Rotation settings of site example.com:

<packet>
  <log-rotation>
    <set>
        <filter>
        <site-name>example.com</site-name>
        </filter>
        <settings>
          <log-condition>
            <log-bysize>2073741824</log-bysize>
          </log-condition>
          <log-max-num-files>1</log-max-num-files>
          <log-compress>true</log-compress>
        </settings>
    </set>
  </log-rotation>
</packet>

Response:

<packet>
  <log-rotation>
    <set>
      <result>
        <status>ok</status>
        <filter-id>example.com</filter-id>
        <id>33</id>
      </result>
    </set>
  </log-rotation>
</packet>

 

If the site was not found, the response from the server looks as follows:

<packet>
  <log-rotation>
    <set>
      <result>
        <status>error</status>
        <errcode>1013</errcode>
        <errtext>domain does not exist</errtext>
        <filter-id>example.com</filter-id>
      </result>
    </set>
  </log-rotation>
</packet>

 

If a packet sender has no rights to manage physical hosting, the response looks as follows:

<packet>
  <log-rotation>
    <get>
      <result>
        <status>error</status>
        <errcode>1006</errcode>
        <errtext>Access denied</errtext>
        <filter-id>example.com</filter-id>
      </result>
    </get>
  </log-rotation>
</packet>

 

If the site is not hosted physically, the response from the server looks as follows:

<packet>
  <log-rotation>
    <get>
      <result>
        <status>error</status>
        <errcode>1034</errcode>
        <errtext>The site is not hosted physically</errtext>
        <filter-id>example.com</filter-id>
      </result>
    </get>
  </log-rotation>
</packet> 
Changing settings of multiple sites

The following request packet changes Log Rotation settings of domains used by the customers with ID 5 and ID 8:

<packet>
  <log-rotation>
    <set>
        <filter>
          <owner-id>5</owner-id>
          <owner-id>8</owner-id>
        </filter>
        <settings>
          <log-condition>
            <log-bysize>2073741824</log-bysize>
          </log-condition>
        </settings>
    </set>
  </log-rotation>
</packet>

Response (if the customer with ID 5 was not found on the server and the customer with ID 8 runs two domains (ID 17 and 29)):

<packet>
  <log-rotation>
   <set>
      <result>
        <status>error</status>
        <errcode>1015</errcode>
        <errtext>customer does not exist</errtext>
        <filter-id>5</filter-id>
      </result>
    </set>
    <set>
      <result>
        <status>ok</status>
        <filter-id>8</filter-id>
        <id>17</id>
      </result>
    </set>
    <set>
      <result>
        <status>ok</status>
        <filter-id>8</filter-id>
        <id>29</id>
      </result>
    </set>
  </log-rotation>
</packet>