Child pages
  • WHM API 1 Functions - list_cparchive_files
Skip to end of metadata
Go to start of metadata

 

Description

This function lists all available cparchive files. The function checks for the following filenames:

  • cpmove-USER
  • cpmove-USER.tar
  • cpmove-USER.tar.gz
  • USER.tar
  • USER.tar.gz
  • backup-BACKUP-DATE_TIME_USER.tar
  • backup-BACKUP-DATE_TIME_USER.tar.gz

The function checks for these filenames in the following locations:

  • /home
  • /home2
  • /home3
  • /root
  • /usr
  • /usr/home
  • /web

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/list_cparchive_files?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/list_cparchive_files?api.version=1
 Command Line
whmapi1 list_cparchive_files


Notes:

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

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
  "data": {
    "quickrestore_files": [
      {
        "user": "username1",
        "file": "cpmove-username1.tar.gz",
        "path": "/home"
      },
      {
        "user": "username2",
        "file": "cpmove-username2.tar.gz",
        "path": "/home"
      }
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "list_cparchive_files"
  }
}
 Output (XML)
<result>
    <data>
        <quickrestore_files>
            <user>username1</user>
            <file>cpmove-username1.tar.gz</file>
            <path>/home</path>
        </quickrestore_files>
        <quickrestore_files>
            <user>username2</user>
            <file>cpmove-username2.tar.gz</file>
            <path>/home</path>
        </quickrestore_files>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>list_cparchive_files</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
quickrestore_fileshashA hash of information about each cparchive file.The hash includes the userfile, and path returns.

 

user

string

The backup file's account.

The function returns this value in the quickrestore_files hash.

A valid username.username1

file

string

The backup file's name.

The function returns this value in the quickrestore_files hash.

A valid filename in one of the following formats:

  • cpmove-USER
  • cpmove-USER.tar
  • cpmove-USER.tar.gz
  • USER.tar
  • USER.tar.gz
  • backup-BACKUP-DATE_TIME_USER.tar
  • backup-BACKUP-DATE_TIME_USER.tar.gz
cpmove-username1.tar.gz

path

string

The backup file's directory.

The function returns this value in the quickrestore_files hash.

A valid absolute file path in one of the following locations:

  • /home
  • /home2
  • /home3
  • /root
  • /usr
  • /usr/home
  • /web
/home