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

Description

This function lists the restoration queue's completed tasks.

Important:

This function's output varies dramatically. The method that added the restoration task determines this output. 


Note:

On servers that run CentOS 7, you may see a named warning about the absence of SPF resource records on DNS.

  • This warning is not relevant on CentOS 7 servers, because RFC 7208 deprecated SPF records. CentOS 7 servers use TXT records instead of SPF records.
  • Red Hat 7.1 and CentOS 7.1 both contain bind-9.9.4-23.el7, which is an updated version of BIND that complies with RFC 7208. To resolve this issue, update your operating system to a version that contains the updated version of BIND. For more information, read the Red Hat Bugzilla case about SPF record errors.

Examples 


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


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)
 Click to view an example for a task that the /scripts/restorepkg script added...
{  
   "data":{  
      "restore_job":[  
         {  
            "status_info":{  
               "log":"Extracting Domain....Done\n Done\n 
    \n 
     Restoring cpanel user config file    Done\n    \n 
     Restoring reseller packages and features (if any)       \n 
     Restoring reseller privs (if any)       \n 
     Restoring Locale Setting       \n 
     Restoring SSL keys and Certificates    Done\n 
    \n 
     Restoring frontpage (if installed)    Done\n    \n 
     Restoring access logs....     Done\n 
    \n 
     Restoring domain keys....     Done\n 
    \n 
     Restoring MySQL databases....     Database \"cptmpdb_azri8qf8_0KuzT3yEH7JFeeSi\" dropped Done\n 
 Successful creation of roundcube cp_schema_version table \n 
Initial run through schema migration: from '0.2b' to '0.8.4' \n 
Please ignore non-fatal warnings, such as duplicate keys, columns, indexes, or tables already existing. \n 
Successfully saved version 0.8.4 to cp_schema_version table \n 
DBD::mysql::st execute failed: Table 'cptmpdb_azri8qf8_7WIKvg175f2M02yn.users' doesn't exist at /usr/local/cpanel/Cpanel/Email/RoundCube/DBI.pm line 503,  line 1. DBD::mysql::st execute failed: Table 'cptmpdb_azri8qf8_7WIKvg175f2M02yn.users' doesn't exist at /usr/local/cpanel/Cpanel/Email/RoundCube/DBI.pm line 503,  line 1. Transfer failed from temp database to Roundcube database.\n Done\n Done    \n
     Restoring MySQL privs    Done\n    \n 
    Reloading MySQL    Done\n 
    \nRestoring PostgreSQL databases.... ERROR:  role \"azri8qf8\" already exists      Restoring PostgreSQL privs     Done\n
    \n 
     Restoring Mailman lists    Done\n 
    \n 
     Restoring Mailman Archives    Done\n 
    \n 
      Restoring shell    Current shell /usr/local/cpanel/bin/noshell is up to date. Done\n 
    \n 
     Restoring password    Password for azri8qf8 has been changed Done\n 
    \n 
     Restoring proftpd file    Done\n 
    \n 
     Resyncing FTP Passwords    Updating ftp passwords for azri8qf8Ftp password files updated.Ftp vhost passwords syncedDone\n
    \n 
     Linking old home directories       \n 
     Parsing Domain Databases    ...Subdomains......ParkedDomains......AddonDomains...   \n 
     Restoring Domains    \n 
    \n 
     Restoring Bandwidth Data    Done    \n 
     Restoring Counter Data       \n 
     Restoring Homedir....    Done\n    \n     Doing fileprotect conversion       \n 
     Restoring nobody owned files    Done\n    \n 
     Restoring Mail files    Done\n 
    \n 
     Restoring userdata....     Done\n    \n 
     Restoring custom virtualhost templates....        \n 
     Converting email to cPanel 5+ (if needed)    Done\n    \n 
     Cleaning up filters (if needed)    vfilter converter v3.0Updating vfilter files to latest format.Running for azri8qf8 only (force=0) (has_spam_acl=0)Processing azri8qf8......DoneDone\n
    \n 
     Fixing mail permissions    Done\n 
    \n 
     Restoring crontab    Done\n 
         Converting to maildir if needed    Done\n 
         Restoring Dns Zones    Restoring zone: 28-ps1n25d.test.db Zone updates: 28-ps1n25d.test    \n 
     Adding missing subdomain DNS entries (if needed)       \n 
     Update Proxy subomains    Adding proxy subdomains for domain 28-ps1n25d.test.28-ps1n25d.test                    [28-ps1n25d.test, 10.215.215.229, no changes needed]Done\n 
    \n 
     Updating SPF Records    Done\n    \n 
     Restoring quota    Done\n 
    \n 
   \n 
     Update mail routing    LOCAL MAIL EXCHANGER: This server will serve as a primary mail exchanger for 28-ps1n25d.test's mail.: This configuration has been manually selected. Done\n 
    \n 
     Rebuilding Apache Conf    Built /usr/local/apache/conf/httpd.conf OK   \n 
     Restore Complete    Account Restore Complete Unlocking password for user azri8qf8.passwd: Success.   \n",
               "started":"1355840811",
               "finished":"1355840823",
               "result":1
            },
            "restore_job":{  
               "restore_point":"YYYY-MM-DD",
               "options":{  
                  "give_ip":0,
                  "mysql":1,
                  "subdomains":1,
                  "mail_config":1
               },
               "user":"example"
            }
         },
         {  
            "status_info":{  
               "log":"",
               "started":"1355840823",
               "finished":"1355840823",
               "result":0
            },
            "restore_job":{  
               "restore_point":"YYYY-MM-DD",
               "options":{  
                  "give_ip":1,
                  "mysql":1,
                  "subdomains":0,
                  "mail_config":0
               },
               "user":"bcow"
            }
         }
      ]
   },
   "metadata":{  
      "version":1,
      "reason":"OK",
      "result":"1",
      "command":"restore_queue_list_completed"
   }
}
 Click to view an example for a task that the restore_queue_add_task function added...
{
   "data" : {
      "restore_job" : [
         {
            "restore_job" : {
               "options" : {
                  "give_ip" : 0,
                  "mail_config" : 0,
                  "mysql" : 0,
                  "subdomains" : 0
               },
               "restore_point" : "2014-12-04",
               "user" : "narf"
            },
            "status_info" : {
               "finished" : 1417706324,
               "log" : "OK",
               "result" : 1,
               "started" : 1417706298
            }
         },
         {
            "restore_job" : {
               "options" : {
                  "give_ip" : 0,
                  "mail_config" : 1,
                  "mysql" : 1,
                  "subdomains" : 1
               },
               "restore_point" : "2014-12-04",
               "user" : "narf"
            },
            "status_info" : {
               "finished" : 1417709351,
               "log" : "OK",
               "result" : 1,
               "started" : 1417709314
            }
         }
      ]
   },
   "metadata" : {
      "command" : "restore_queue_list_completed",
      "reason" : "OK",
      "result" : "1",
      "version" : 1
   }
} 
 Output (XML)
 Click to view an example for a task that the /scripts/restorepkg script added...
<result>
   <data>
      <restore_job>
         <status_info>
            <log>
Extracting Domain....Done Done Restoring cpanel user config file Done Restoring reseller packages and features (if any) Restoring reseller privs (if any) Restoring Locale Setting Restoring SSL keys and Certificates Done Restoring frontpage (if installed) Done Restoring access logs.... Done Restoring domain keys.... Done Restoring MySQL databases.... Database "cptmpdb_azri8qf8_0KuzT3yEH7JFeeSi" dropped Done Successful creation of roundcube cp_schema_version table Initial run through schema migration: from '0.2b' to '0.8.4' Please ignore non-fatal warnings, such as duplicate keys, columns, indexes, or tables already existing. Successfully saved version 0.8.4 to cp_schema_version table DBD::mysql::st execute failed: Table 'cptmpdb_azri8qf8_7WIKvg175f2M02yn.users' doesn't exist at /usr/local/cpanel/Cpanel/Email/RoundCube/DBI.pm line 503, line 1. DBD::mysql::st execute failed: Table 'cptmpdb_azri8qf8_7WIKvg175f2M02yn.users' doesn't exist at /usr/local/cpanel/Cpanel/Email/RoundCube/DBI.pm line 503, line 1. Transfer failed from temp database to Roundcube database. Done Done Restoring MySQL privs Done Reloading MySQL Done Restoring PostgreSQL databases.... ERROR: role "azri8qf8" already exists Restoring PostgreSQL privs Done Restoring Mailman lists Done Restoring Mailman Archives Done Restoring shell Current shell /usr/local/cpanel/bin/noshell is up to date. Done Restoring password Password for azri8qf8 has been changed Done Restoring proftpd file Done Resyncing FTP Passwords Updating ftp passwords for azri8qf8Ftp password files updated.Ftp vhost passwords syncedDone Linking old home directories Parsing Domain Databases ...Subdomains......ParkedDomains......AddonDomains... Restoring Domains Restoring Bandwidth Data Done Restoring Counter Data Restoring Homedir.... Done Doing fileprotect conversion Restoring nobody owned files Done Restoring Mail files Done Restoring userdata.... Done Restoring custom virtualhost templates.... Converting email to cPanel 5+ (if needed) Done Cleaning up filters (if needed) vfilter converter v3.0Updating vfilter files to latest format.Running for azri8qf8 only (force=0) (has_spam_acl=0)Processing azri8qf8......DoneDone Fixing mail permissions Done Restoring crontab Done Converting to maildir if needed Done Restoring Dns Zones Restoring zone: 28-ps1n25d.test.db Zone updates: 28-ps1n25d.test Adding missing subdomain DNS entries (if needed) Update Proxy subomains Adding proxy subdomains for domain 28-ps1n25d.test.28-ps1n25d.test [28-ps1n25d.test, 10.215.215.229, no changes needed]Done Updating SPF Records Done Restoring quota Done Update mail routing LOCAL MAIL EXCHANGER: This server will serve as a primary mail exchanger for 28-ps1n25d.test's mail.: This configuration has been manually selected. Done Rebuilding Apache Conf Built /usr/local/apache/conf/httpd.conf OK Restore Complete Account Restore Complete Unlocking password for user azri8qf8.passwd: Success.
            </log>
            <started>1355840811</started>
            <finished>1355840823</finished>
            <result>1</result>
         </status_info>
         <restore_job>
            <restore_point>YYYY-MM-DD</restore_point>
            <options>
               <give_ip>0</give_ip>
               <mysql>1</mysql>
               <subdomains>1</subdomains>
               <mail_config>1</mail_config>
            </options>
            <user>example</user>
         </restore_job>
      </restore_job>
   <metadata>
      <version>1</version>
      <reason>OK</reason>
      <result>1</result>
      <command>restore_queue_list_finished</command>
   </metadata>
</result>
 Click to view an example for a task that the restore_queue_add_task function added...
<result>
    <data>
        <restore_job>
            <status_info>
                <log>OK</log>
                <started>1417706298</started>
                <finished>1417706324</finished>
                <result>1</result>
            </status_info>
            <restore_job>
                <restore_point>2014-12-04</restore_point>
                <options>
                    <give_ip>0</give_ip>
                    <mysql>0</mysql>
                    <subdomains>0</subdomains>
                    <mail_config>0</mail_config>
                </options>
                <user>narf</user>
            </restore_job>
        </restore_job>
        <restore_job>
            <status_info>
                <log>OK</log>
                <started>1417709314</started>
                <finished>1417709351</finished>
                <result>1</result>
            </status_info>
            <restore_job>
                <restore_point>2014-12-04</restore_point>
                <options>
                    <give_ip>0</give_ip>
                    <mysql>1</mysql>
                    <subdomains>1</subdomains>
                    <mail_config>1</mail_config>
                </options>
                <user>narf</user>
            </restore_job>
        </restore_job>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>restore_queue_list_completed</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
restore_jobarray of hashesAn array of hashes that contain of information about a completed task in the restoration queue.

This array of hashes includes the status_info and restore_job hashes.

 

status_info

hash

A hash of information about the task's status.

The function returns this hash in the restore_job array.

This hash includes the log, started, finished, and result returns.

 

log

string

The task's log information.

The function returns this value in the status_info hash.

One or more log messages.

 Click to view...
Extracting Domain....Done Done Restoring cpanel user config file Done Restoring reseller packages and features (if any) Restoring reseller privs (if any) Restoring Locale Setting Restoring SSL keys and Certificates Done Restoring frontpage (if installed) Done Restoring access logs.... Done Restoring domain keys.... Done Restoring MySQL databases.... Database "cptmpdb_azri8qf8_0KuzT3yEH7JFeeSi" dropped Done Successful creation of roundcube cp_schema_version table Initial run through schema migration: from '0.2b' to '0.8.4' Please ignore non-fatal warnings, such as duplicate keys, columns, indexes, or tables already existing. Successfully saved version 0.8.4 to cp_schema_version table DBD::mysql::st execute failed: Table 'cptmpdb_azri8qf8_7WIKvg175f2M02yn.users' doesn't exist at /usr/local/cpanel/Cpanel/Email/RoundCube/DBI.pm line 503, line 1. DBD::mysql::st execute failed: Table 'cptmpdb_azri8qf8_7WIKvg175f2M02yn.users' doesn't exist at /usr/local/cpanel/Cpanel/Email/RoundCube/DBI.pm line 503, line 1. Transfer failed from temp database to Roundcube database. Done Done Restoring MySQL privs Done Reloading MySQL Done Restoring PostgreSQL databases.... ERROR: role "azri8qf8" already exists Restoring PostgreSQL privs Done Restoring Mailman lists Done Restoring Mailman Archives Done Restoring shell Current shell /usr/local/cpanel/bin/noshell is up to date. Done Restoring password Password for azri8qf8 has been changed Done Restoring proftpd file Done Resyncing FTP Passwords Updating ftp passwords for azri8qf8Ftp password files updated.Ftp vhost passwords syncedDone Linking old home directories Parsing Domain Databases ...Subdomains......ParkedDomains......AddonDomains... Restoring Domains Restoring Bandwidth Data Done Restoring Counter Data Restoring Homedir.... Done Doing fileprotect conversion Restoring nobody owned files Done Restoring Mail files Done Restoring userdata.... Done Restoring custom virtualhost templates.... Converting email to cPanel 5+ (if needed) Done Cleaning up filters (if needed) vfilter converter v3.0Updating vfilter files to latest format.Running for azri8qf8 only (force=0) (has_spam_acl=0)Processing azri8qf8......DoneDone Fixing mail permissions Done Restoring crontab Done Converting to maildir if needed Done Restoring Dns Zones Restoring zone: 28-ps1n25d.test.db Zone updates: 28-ps1n25d.test Adding missing subdomain DNS entries (if needed) Update Proxy subomains Adding proxy subdomains for domain 28-ps1n25d.test.28-ps1n25d.test [28-ps1n25d.test, 10.215.215.229, no changes needed]Done Updating SPF Records Done Restoring quota Done Update mail routing LOCAL MAIL EXCHANGER: This server will serve as a primary mail exchanger for 28-ps1n25d.test's mail.: This configuration has been manually selected. Done Rebuilding Apache Conf Built /usr/local/apache/conf/httpd.conf OK Restore Complete Account Restore Complete Unlocking password for user azri8qf8.passwd: Success.

started

integer

The restoration process's start time for this task.

The function returns this value in the status_info hash.

A date in Unix time format.

1355840811

finished

integer

The restoration process's finish time for this task.

The function returns this value in the status_info hash.

A date in Unix time format.

1355840823

result

Boolean

Whether the task completed successfully.

The function returns this value in the status_info hash.

  • 1 — Success.
  • 0 — Failure.
1

restore_job

hash

A hash of the task's settings.

The function returns this hash in the restore_job array.

This hash includes the restore_point and user returns and the options hash.

 

options

hash

A hash of information about the task's options.

The function returns this hash in the restore_job hash.

This hash includes the give_ip, mysql, subdomains, and mail_config returns.

 

give_ip

Boolean

Whether the task assigned the account a dedicated IP address.

The function returns this value in the options hash.

  • 1 — Assigned.
  • 0 — Did not assign.
1

mysql

Boolean

Whether the task restored the account's MySQL® databases.

The function returns this value in the options hash.

  • 1 — Restored.
  • 0 — Did not restore.
1

subdomains

Boolean

Whether the function restored the account's subdomains.

The function returns this value in the options hash.

  • 1 — Restored.
  • 0 — Did not restore.
1

mail_config

Boolean

Whether the function restored the account's email configuration.

The function returns this value in the options hash.

  • 1 — Restored.
  • 0 — Did not restore.
1

user

string

The cPanel account's username.

The function returns this hash in the restore_job hash.

A valid cPanel username.username

restore_point

string

The date of the backup that the task used.

The function returns this hash in the restore_job hash.

A backup creation date, where:

  • YYYY represents the year.
  • MM represents the month.
  • DD represents the date.
2015-10-21