Child pages
  • WHM API 1 Functions - set_tweaksetting

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function sets an option's value in WHM's Tweak Settings interface (Home >> Server Configuration >> Tweak Settings)

 The system stores the keys and values that this function updates in the /var/cpanel/cpanel.config file.

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/set_tweaksetting?api.version=1&key=proxysubdomains&value=1



Expand
titleXML API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/set_tweaksetting?api.version=1&key=proxysubdomains&value=1



Expand
titleCommand Line


Code Block
languagebash
whmapi1 set_tweaksetting key=proxysubdomains value=1

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
    result:{
        metadata:{
            version:1,
            reason:'OK',
            result:1,
            command:'set_tweaksetting'
        }
    }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<result>
  <metadata>
    <version>1</version>
    <reason>OK</reason>
    <result>1</result>
    <command>set_tweaksetting</command>
  </metadata>
</result>


Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
keystring

Required

The cpanel.config setting name that corresponds to the desired setting in WHM's Tweak Settings interface (Home >> Server Configuration >> Tweak Settings).

The name of a setting that resides in the /var/cpanel/cpanel.config file.proxysubdomains
modulestring

The Tweak Settings interface section.

The name of a Tweak Settings interface section.Main
valuestring

The value to assign to the setting.

  • If you do not include this parameter in the call, the value defaults to undef.
  • If you include this parameter in the call but do not set a value, the value defaults to an empty value.

A valid string.

For more information about the requirements for values in the cpanel.config settings, read our The cpanel.config File documentation.

example.com

Returns

This function only returns metadata.