Child pages
  • UAPI Functions - WordPressRestore::any_running
Skip to end of metadata
Go to start of metadata

Description

This function returns whether a WordPress® site backup restoration is in progress.

Note:

You must install the WordPress Manager cPanel plugin to access this API function.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/WordPressRestore/any_running


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Check for a WordPress site backup restoration in progress.
 $instances = $cpanel->uapi(
    'WordPressRestore', 'any_running'
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Check for a WordPress site backup restoration in progress
my $instances = $cpliveapi->uapi(
    'WordPressRestore', 'any_running'
);


Note:

For more information, read our Guide to the LiveAPI System.

 Command Line
uapi --user=username WordPressRestore any_running


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)

Restore not in progress

{  
   "metadata":{  

   },
   "data":{  
      "sites":[  

      ],
      "last_outcome":{  
         "error":"",
         "site":"example.com",
         "status":"success",
         "have_outcome":1
      },
      "any_running":0
   },
   "messages":null,
   "errors":null,
   "status":1,
   "warnings":null
}

Restore in progress

{  
   "data":{  
      "any_running":1,
      "sites":[  
         {  
            "id":null,
            "site":"example.com",
            "type":"restore"
         }
      ]
   },
   "metadata":{  

   },
   "warnings":null,
   "messages":null,
   "errors":null,
   "status":1
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample
any_runningBooleanWhether the system is processing a backup restoration.
  • 1 — Restoration in progress.
  • 0 — No restoration in progress.
0
last_outcomehash

This hash contains the status of the last backup restoration.

Note:

The function only returns this hash if the system is not processing a WordPress site restore.

This hash contains the have_outcome, site, status, and error returns.


have_outcome

Boolean

Whether the restoration log shows a successful attempt previously occurred, successfully or unsuccessfully.

The function returns this value in the last_outcome hash.

  • 1 — Restoration attempt occurred.
  • 0 — No restoration attempt occurred.
1

site

string

The WordPress site's URL.

The function returns this value in the last_outcome hash.

A URL without the protocol prefix.example.com

status

string

The previous restoration attempt's result.

The function returns this value in the last_outcome hash.

  • success — Successful restoration.
  • error — The attempted restoration resulted in an error.
  • terminated — The system stopped the restoration process.
  • timeout — The restoration process exceeded the allowed time limit.
  • low-disk — The server's disk space was insufficient to complete the restoration.
  • low-quotaThe cPanel account's quota was insufficient to complete the restoration.


1

error

string

Where the system encountered an error during the last backup restoration.

The function returns this value in the last_outcome hash.

  • The error message from the restoration log database.
  • null — No occur occurred.
null
sitesarray

This array contains information about the site that the system is actively restoring.

Note:

The function only returns this array if the system is processing a restore.

This array contains the id, site, and type returns.

Note:

We have not implemented this return.


id

string

The restore process's unique ID.

The function returns this value in the sites array.

nullnull is the only possible value.null

site

string

The WordPress site's URL.

The function returns this value in the sites array.

A URL without the protocol prefix.example.com

type

string

The active process type.

The function returns this value in the sites array.

restore — The function only returns this value.

restore