Child pages
  • WHM API 0 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.


Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


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



Expand
titleXML API


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



Expand
titleCommand Line


Code Block
languagebash
whmapi0 nvset key=ThermalDetonator value=Active

Include Page
LIB:_WHMAPI0CLINote
LIB:_WHMAPI0CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
   "result":[
      {
         "status":1,
         "key":"ThermalDetonator:Active"
      }
   ]
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<nvset>
      <result>
            <key>ThermalDetonator:Active</key>
            <status>1</status>
      </result>
</nvset>




   

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
nvsetarray of hashes

An array of hashes of the function's results.

This hash includes the key and status returns. 

key

string

The variable and its value.

The function returns this value in the nvset hash.

Two valid strings, separated by a colon (:).ThermalDetonator:Active

status

Boolean

Whether the function succeeded.

The function returns this value in the nvset hash.

  • 1 — Success.
  • 0 — Failure.
1