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

 

Description

This function lists the tasks in the restoration queue.

Examples 


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


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":{  
      "pending":[  
         {  
            "restore_point":"2016-05-24",
            "options":{  
               "subdomains":1,
               "mysql":1,
               "give_ip":0,
               "mail_config":1
            },
            "user":"user1"
         },
         {  
            "options":{  
               "mail_config":1,
               "mysql":1,
               "give_ip":0,
               "subdomains":1
            },
            "user":"user2",
            "restore_point":"2016-05-24"
         },
         {  
            "restore_point":"2016-05-24",
            "options":{  
               "give_ip":0,
               "mysql":1,
               "subdomains":1,
               "mail_config":1
            },
            "user":"user3"
         }
      ],
      "completed":[  
      ],
      "active":[  
      ],
      "is_active":false
   },
   "metadata":{  
      "result":1,
      "command":"restore_queue_state",
      "version":1,
      "reason":"OK"
   }
}
 Output (XML)
<result>
    <data>
        <is_active>false</is_active>
        <active></active>
        <pending>
            <restore_point>2016-05-24</restore_point>
            <options>
                <subdomains>1</subdomains>
                <mysql>1</mysql>
                <give_ip>0</give_ip>
                <mail_config>1</mail_config>
            </options>
            <user>user1</user>
        </pending>
        <pending>
            <restore_point>2016-05-24</restore_point>
            <options>
                <subdomains>1</subdomains>
                <mysql>1</mysql>
                <give_ip>0</give_ip>
                <mail_config>1</mail_config>
            </options>
            <user>user2</user>
        </pending>
        <pending>
            <restore_point>2016-05-24</restore_point>
            <options>
                <subdomains>0</subdomains>
                <mysql>1</mysql>
                <give_ip>1</give_ip>
                <mail_config>1</mail_config>
            </options>
            <user>user3</user>
        </pending>
        <complete></complete>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>restore_queue_states</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
is_activestringWhether the restoration queue is actively processing a task.
  • true
  • false
false
completedarray of hashesAn array of hashes of restoration queue items that the system has already processed.

Each hash contains the user and restore_point returns and the options hash.

Note:

For more information about these returns, see the Queued item information table below. 

 
activearray of hashesAn array of hashes of restoration queue items that the system is actively processing.

Each hash contains the user and restore_point returns and the options hash.

Note:

For more information about these returns, see the Queued item information table below.


 
pendingarray of hashesAn array of of hashes of restoration queue items that the system will process next.

Each hash contains the user and restore_point returns and the options hash.

Note:

For more information about these returns, see the Queued item information table below.


 

Queued item information

Note:

These returns may appear in the completed, active, or pending arrays of hashes. 

ReturnTypeDescriptionPossible valuesExample
userstringThe cPanel account's username.

A valid cPanel username.

user1
optionshashA hash of restoration options.This hash includes the mysql, subdomains, mail_config, and give_ip returns. 

subdomains

Boolean

Whether the restoration process will restore the account's subdomains.

The function returns this value in the options hash.

  • 1 — Will restore.
  • 0 — Will not restore.
1

mysql

Boolean

Whether the restoration process will restore the account's MySQL® databases.

The function returns this value in the options hash.

  • 1 — Will restore.
  • 0 — Will not restore.
1

give_ip

Boolean

Whether the restoration process will assign a dedicated IP address to the account.

The function returns this value in the options hash.

  • 1 — Will assign.
  • 0 — Will not assign.
0

mail_config

Boolean

Whether the restoration process will restore the account's email configuration.

The function returns this value in the options hash.

  • 1 — Will restore.
  • 0 — Will not restore.
1