Child pages
  • WHM API 1 Functions - get_tweaksetting
Skip to end of metadata
Go to start of metadata

Description

This function retrieves a value from the /var/cpanel/cpanel.config file.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/get_tweaksetting?api.version=1&key=update_log_analysis_retention_strength
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/get_tweaksetting?api.version=1&key=update_log_analysis_retention_strength
 Command Line
whmapi1 get_tweaksetting key=update_log_analysis_retention_strength


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
    result:{
        data:{
            tweaksetting:{
                value:90,
                key:'update_log_analysis_retention_length'
            }
        },
        metadata:{
            version:1,
            reason:'OK',
            result:1,
            command:'get_tweaksetting'
        }
    }
}
 Output (XML)
<result>
  <data>
    <tweaksetting>
      <value>90</value>
      <key>update_log_analysis_retention_length</key>
    </tweaksetting>
  </data>
  <metadata>
    <version>1</version>
    <reason>OK</reason>
    <result>1</result>
    <command>get_tweaksetting</command>
  </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
key string

Required

The Tweak Settings option.

A valid string.update_log_analysis_retention_length

module

string

The Tweak Settings section.

This value defaults to Main.

A valid string.

Main

Returns

ReturnTypeDescriptionPossible valuesExample
tweaksettinghashA hash of the tweak setting information.This hash includes the value and key returns. 

value

string

The value.

The function returns this value in the tweaksetting hash.

This value depends on the key's requirements.90

key

string

The key.

The function returns this value in the tweaksetting hash.

A valid key name in the cpanel.config file.
update_log_analysis_retention_length