Description

This function retrieves data from a non-volatile datastore.

 The system stores these files in the /home/user/.cpanel/nvdata directory, where user represents the account name.

We deprecated this function in cPanel & WHM version 74. Instead, we recommend that you use the UAPI Functions - Personalization::get function.


Examples 




https://hostname.example.com:2083/cpsess##########/execute/NVData/get?names=testfile



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Get the NVData file "testfile".
$get_nvdata = $cpanel->uapi(
    'NVData', 'get',
    array(
        'names'    => 'testfile',
    )
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Get the NVData file "testfile".
my $get_nvdata = $cpliveapi->uapi(
    'NVData', 'get',
    {
        'names'    => 'testfile',
    }
);

 



<!--  Get the minimum password strength for webdisk. -->
[% data = execute( 'NVData', 'get', { names => 'testfile'} ); %]
[% FOREACH q = data %]
     <p>
         [% q %]
     </p>
[% END %]

 



uapi --user=username NVData get names=testfile



{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": [
    {
      "value": "testvalue",
      "name": "testfile"
    }
  ],
  "metadata": {
    "transformed": 1
  }
}



   

Parameters

ParameterTypeDescriptionPossible valuesExample
namesstring

Required

The file or files to retrieve.

A valid file path, relative to the /home/user/.cpanel/nvdata directory, where user represents the cPanel user.

To retrieve multiple files, separate each file with a pipe (|) character.


testfile

 

Returns

ReturnTypeDescriptionPossible valuesExample
 array of hashesAn array of hashes that contains information about the non-volatile data.This array of hashes includes the name and value returns. 

name

string

The file's name.

The function returns this value in the unnamed hash.

A valid string.testfile

value

string

The file's contents.

The function returns this value in the unnamed hash.

A valid string.
testvalue