We use cookies on our website to ensure we provide you with the best experience on our website. By using our website, you agree to the use of cookies for analytics and personalized content.This website uses cookies. More Information
It seems like your browser didn't download the required fonts. Please revise your security settings and try again.

Config.set

  • Last updated on

Use this method to set the values of variables in the system configuration. This method sets the variables(s) with the given values(s) for the object of type $type, identified by $path.

Parameters Allowed

The following variables are used by the config.set method and should be provided as part of the request XML in the HTTP POST request:

  • password – A required parameter which the API uses to authenticate access to a page and which is set by your administrator.
  • type – A required parameter that specifies the class/scope of an object.
  • path – A required parameter that is the qualified name of an object for which the values are to be set.
  • variable list – This is a required parameter that tells the API what variables are to be set and the corresponding values.

Example 1: Set the value for a scoped object under global scope

Set the value for a scoped object under global scope. This example sets the value of Spam Score limit block level to '4' for the xyz.com domain. In the web interface, this value would be set from the BASIC > Spam Checking page after clicking on the Manage Domain link for xyz.com on the DOMAINS page.

Arguments
  • type: 'domain',
  • path: 'xyz.com'
  • variable list: scana_pd_block_level = 4
Sample Request
 <?xml version="1.0" encoding="UTF8"?>
<methodCall>
 <methodName>config.set</methodName>
  <params>
   <param>
    <value>
     <struct>
      <member>
       <name>scana_pd_block_level</name>
        <value>
         <i4>4</i4>
       </value>
      </member>
      <member>
       <name>path</name>
        <value>
         <string>
          <![CDATA[xyz.com]]>
         </string>
        </value>
      </member>
      <member>
       <name>type</name>
        <value>
         <string>
          <![CDATA[domain]]>
         </string>
        </value>
       </member>
     </struct>
    </value>
   </param>
  </params>
</methodCall>
Response
 OK <?xml version="1.0" encoding="UTF8"?>
<methodResponse>
 <params>
  <param>
   <value>
    <struct>
     <member>
      <name>Result</name>
       <value>
        <string>
         <![CDATA[200: OK]]>
        </string>
       </value>
      </member>
     </struct>
    </value>
  </param>
 </params>
</methodResponse>

Example 2: Set values for several variables under global scope

 Set the values of https_port to '443' and mta_rate_control to '40'. The value for Web Interface HTTPS/SSL port can be set on the ADVANCED > Secure Administration page of the web interface, and the value of Rate Control is set on the BLOCK/ACCEPT > Rate Control page. These variables appear in the configuration like this (values not yet set):

  • # HTTPS Web Interface Port
  • https_port =
  • # Maximum Connections By IP Per 30 Minutes
  • mta_rate_control =
Arguments
  • type: 'global'
  • path: ''
  • variable list: https_port => 443, mta_rate_control => 40
Sample Request
 <?xml version="1.0" encoding="UTF8"?>
<methodCall>
<methodName>config.set</methodName>
 <params>
  <param>
   <value>
    <struct>
     <member>
      <name>https_port</name>
       <value>
        <i4>443</i4>
       </value>
      </member>
      <member>
       <name>mta_rate_control</name>
        <value>
         <i4>40</i4>
        </value>
      </member>
      <member>
       <name>path</name>
        <value>
         <string></string>
        </value>
      </member>
      <member>
       <name>type</name>
        <value>       
          <string>
           <![CDATA[global]]>
          </string>
         </value>
        </member>
       </struct>
      </value>
    </param>
  </params>
</methodCall>

Example 3: Set the value of a global tied variable

Set the value of httpd_acl_ip_config_netmask to 255.255.128.0 for the httpd_acl_ip_config_address of 192.168.130.222. Note that these variables are available in the configuration only if you have entered values for Allowed API IP/Range in the BASIC > Administration page, and would appear in the configuration like this:

  • # API/SNMP IP Address List
  • httpd_acl_ip_config_address = 192.168.130.222
  • # API/SNMP IP Netmask List
  • httpd_acl_ip_config_netmask =
Arguments 
  • type: 'httpd_acl_ip_config_address'
  • path: '192.168.130.222'
  • variable-value list: httpd_acl_ip_config_netmask =255.255.128.0
Sample Request
 <?xml version="1.0" encoding="UTF8"?>
<methodCall>
 <methodName>config.set
 </methodName>
  <params>
   <param>
    <value>
     <struct>
      <member>  
       <name>
        httpd_acl_ip_config_netmask
       </name>
       <value>
        <string>
         <![CDATA[255.255.128.0]]>
        </string>
       </value>
       </member>
       <member>
        <name>path</name>
         <value>
          <string>
           <![CDATA[192.168.130.222]]>
          </string>
         </value>
        </member>
        <member>
         <name>type</name>
           <value>
             <string>
              <![CDATA[httpd_acl_ip_config_address]]>
             </string>
            </value>
         </member>
        </struct>
      </value>
    </param>
  </params>
</methodCall>
Last updated on