Child pages
  • WHM API 0 Functions - nvset
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Description


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

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/nvset?key=ThermalDetonator&value=Active
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/nvset?key=ThermalDetonator&value=Active
 Command Line
whmapi0 nvset key=ThermalDetonator value=Active


Notes:

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

    /usr/local/cpanel/bin/whmapi0

 Output (JSON)
{
   "result":[
      {
         "status":1,
         "key":"ThermalDetonator:Active"
      }
   ]
}
 Output (XML)
<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
  • No labels