Child pages
  • WHM API 1 Functions - nvset

Versions Compared

Key

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

Description


Excerpt

This function sets the value of a non-volatile variable.

 cPanel NVData is a per-account configuration storage mechanism that you can use to maintain persistent cPanel & WHM settings across multiple sessions. This includes custom settings for your own themes.

Note
titleNote:

We deprecated this function in cPanel & WHM version 74. Instead, we recommend that you use the WHM API 1 Functions - personalization_set function.


Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


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



Expand
titleXML API


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



Expand
titleCommand Line


Code Block
languagebash
whmapi1 nvset key=ThermalDetonator value=Active

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
  "data": {
    "nvdatum": [
      {
        "value": "Active",
        "key": "ThermalDetonator"
      }
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "nvset"
  }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<result>
    <data>
        <nvdatum>
            <value>Active</value>
            <key>ThermalDetonator</key>
        </nvdatum>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>nvset</command>
    </metadata>
</result>


Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote


   

Parameters

ParameterTypeDescriptionPossible valuesExample
keystring

Required

The variable's name.

A valid string.

ThermalDetonator
valuestring

Required

The variable's value.

A valid string.

Active

Returns

ReturnTypeDescriptionPossible valuesExample
nvdatumarray of hashes

An array of hashes of the variable's information.

This hash includes the data from the value and key returns. 

value

string

The variable's value.

This function returns this value in the nvdatum hash.

A valid string.
Active

key

string

The variable's name.

This function returns this value in the nvdatum hash.

A valid string.ThermalDetonator