Retrieving Log Rotation Settings

The get 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 retrieving Log Rotation settings includes the get operation node:

<packet version="1.5.0.0">
<log-rotation>
   <get>
   ...
   </get>
</log-rotation>
</packet>

 

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

 

Remarks

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

<packet version="1.5.0.0">
<log-rotation>
   <get>
   ...
   </get>
...
   <get>
   ...
   </get>
</log-rotation>
</packet>

 

 

Response Packet Structure

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

 

 

Samples

Retrieving settings of a single site

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

<packet>
  <log-rotation>
    <get>
        <filter>
        <site-name>example.com</site-name>
        </filter>
    </get>
  </log-rotation>
</packet>

Response:

<packet>
  <log-rotation>
    <get>
      <result>
        <status>ok</status>
        <filter-id>example.com</filter-id>
        <id>12</id>
        <settings>
          <log-condition>
            <log-bysize>204800000</log-bysize>
          </log-condition>
          <log-max-num-files>10</log-max-num-files>
          <log-compress>true</log-compress>
        </settings>
      </result>
    </get>
  </log-rotation>
</packet>

 

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

<packet>
  <log-rotation>
    <get>
      <result>
        <status>error</status>
        <errcode>1013</errcode>
        <errtext>site does not exist</errtext>
        <filter-id>example.com</filter-id>
      </result>
    </get>
  </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 domain is not hosted physically</errtext>
        <filter-id>example.com</filter-id>
      </result>
    </get>
  </log-rotation>
</packet> 
Retrieving settings of multiple domains

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

<packet>
  <log-rotation>
    <get>
        <filter>
          <customer-id>5</customer-id>
          <customer-id>8</customer-id>
        </filter>
    </get>
  </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>
    <get>
      <result>
        <status>error</status>
        <errcode>1015</errcode>
        <errtext>customer does not exist</errtext>
        <filter-id>5</filter-id>
      </result>
    </get>
    <get>
      <result>
        <status>ok</status>
        <filter-id>8</filter-id>
        <id>17</id>
        <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>
      </result>
    </get>
    <get>
      <result>
        <status>ok</status>
        <filter-id>8</filter-id>
        <id>29</id>
        <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>
      </result>
    </get>
  </log-rotation>
</packet>