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

Description


This function retrieves a backup destination's configuration settings.

Examples 


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


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. 

 Output (JSON)
{
    "data": {
        "disabled": "0",
        "local_subdir": "/",
        "mount": "0",
        "name": "destination name",
        "path": "/mylocaldir",
        "we_mounted_it": "0",
        "type": "Local",
        "id": "0W1ei2rd3A4lI5sT6he7Be8st",
        "no_mount_fail": "0"
    },
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": 1,
        "command": "backup_destination_get"
    }
}
 Output (XML)
<result>
   <data>
      <disabled>0</disabled>
      <local_subdir>/</local_subdir>
      <mount>0</mount>
      <name>destination name</name>
      <path>/mylocaldir</path>
      <we_mounted_it>0</we_mounted_it>
      <type>Local</type>
      <id>0W1ei2rd3A4lI5sT6he7Be8st</id>
      <no_mount_fail>0</no_mount_fail>
   </data>
   <metadata>
      <version>1</version>
      <reason>OK</reason>
      <result>1</result>
      <command>backup_destination_get</command>
   </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
id
string

Required

The backup destination's ID.

A valid string.
0W1ei2rd3A4lI5sT6he7Be8st

Returns

ReturnTypeDescriptionPossible valuesExample
name
string

The backup destination's name.

A valid string.
destination
typestring

The type of transport.

Note:

The type value determines which additional values the function returns.

  • FTP
  • SFTP
  • WebDAV
  • Local
  • Custom
  • AmazonS3
  • Rsync
  • GoogleDrive

 

Local

disabledBoolean

Whether to disable the backup destination.

  • 1 — Enabled.
  • 0 — Disabled.
0
disable_reasonstringAn error message that explains why the backup is disabled.A valid string.proton decay

Additional FTP returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
hoststring

The remote server's hostname.

A valid hostname.backups.example.com
portintegerThe remote server's FTP port.

A positive integer.

21
pathstring

The path to the remote server's backups directory.

A valid file path./backups
passiveBooleanWhether the remote server uses passive FTP.
  • 1 — Use passive FTP.
  • 0 — Use active FTP.
1
timeoutstringThe session timeout.A positive integer, in seconds.360
usernamestring

The remote server account's username.

A valid username.username

Additional local returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
mountBoolean

Whether the path is mounted.

  • 1 — The path is mounted.
  • 0 — The path is not mounted.
0
pathstring

The path to the backups directory.

A valid absolute file path./home/backups
no_mount_failBooleanWhether the backup attempt will fail if the mount fails.
  • 1 — Fail the backup attempt.
  • 0 — Do not fail the backup attempt.
0

Additional sftp returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
hoststring

The remote server's hostname.

A valid hostname.backups.example.com
portintegerThe remote server's FTP port.

A positive integer.

21
pathstring

The path to the remote server's backups directory.

A valid file path./backups
timeoutstringThe session timeout.A positive integer, in seconds.360
usernamestring

The remote server account's username.

A valid username.username

authtype

string

The authorization type.

  • password
  • key

password

privatekeystringIf the authtype return's value is key, the the private key file's path.A valid absolute file path./home/backups/key

Additional webdav returns

 Click to view...
ReturnTypeDescriptionPossible valuesExample
hoststring

The remote server's hostname.

A valid hostname.backups.example.com
portintegerThe remote server's FTP port.

A positive integer.

21
pathstring

The path to the remote server's backups directory.

A valid file path./backups
sslBooleanWhether the remote server uses SSL.
  • 1 — Use SSL.
  • 0 — Do not use SSL.
1
timeoutstringThe session timeout.A positive integer, in seconds.360
usernamestring

The remote server account's username.

A valid username.username

Additional custom returns  

 Click to view...
ReturnsTypeDescriptionPossible valuesExample
scriptstring

The name of the user-supplied transport solution script.

A valid absolute file path./home/backups/beammeupscotty.pl
hoststring

The remote server's hostname.

A valid hostname.backups.example.com
pathstring

The path to the remote server's backups directory.

A valid file path./backups
timeoutstringThe session timeout.A positive integer, in seconds.360
usernamestring

The remote server account's username.

A valid username.username

Additional AmazonS3 returns

 Click to view...

Note:

 The AmazonS3 type is available in cPanel & WHM version 11.42 and later.

ReturnTypeDescriptionPossible valuesExample
folderstringThe path to the backups directory.A valid file path, relative to the root directory.subfolder
bucketstring

The Amazon S3™ bucket.

A valid string.ChockFullOfNuts
aws_access_key_idstring

The Amazon S3 Access Key ID.

A valid string.123456789
timeoutstring

The session timeout.

A positive integer, in seconds.360