$instance
$instance : mixed
Public static variable to hold the single instance of the class.
Class Api_Backups_3rd_Party
This class is responsible for handling the 3rd party API requests for each available backup provider.
instance() : \MainWP\Dashboard\Module\ApiBackups\Api_Backups_3rd_Party
Method instance()
Create a public static instance.
call_cloudways_api(string $method, string $url, string $accessToken, array $post = array()) : object
Call Cloudways API, Authenticate & perform given method.
Use this function to contact CW API We use OAuth, an open standard for authorization. Here are the steps involved:
string | $method | GET|POST|PUT|DELETE. |
string | $url | relative URL for the call. |
string | $accessToken | Access token generated using OAuth Call. |
array | $post | Optional post data for the call. |
Output from CW API.
ajax_cloudways_action_update_ids()
Ajax.
Save the server & app ID to that Child Site's options table.
Compare connected Child Sites against connected Cloudways account. Automatically check for Child Sites domain name in server list & save. that app's Server ID & App ID to that Child Site's options table.
cloudways_action_update_ids()
Save the server & app ID to that Child Site's options table.
Compare connected Child Sites against connected Cloudways account. Automatically check for Child Sites domain name in server list & save. that app's Server ID & App ID to that Child Site's options table.
call_vultr_api(string $method, string $url, string $accessToken, string $data = null, boolean $die_error = true) : array
Call Vultr API, Authenticate & perform given method.
Use this function to contact Vultr API We use OAuth, an open standard for authorization. Here are the steps involved:
string | $method | GET|POST|PUT|DELETE. |
string | $url | relative URL for the call. |
string | $accessToken | Access token generated using OAuth Call. |
string | $data | Json encoded array - Optional post data for the call. |
boolean | $die_error | die when error. |
Response from Vultr API.
ajax_vultr_action_individual_create_snapshot() : void
Ajax.
Vultr: action create snapshot.
Create a snapshot on the selected Vultr server.
This function is also called before any update. During this time a backup will be. Created but no updates will be made this time around. A new update will need to be manually triggered.
ajax_vultr_action_create_snapshot() : void
Ajax.
Vultr: action create snapshot.
Create a snapshot on the selected Vultr server.
This function is also called before any update. During this time a backup will be. Created but no updates will be made this time around. A new update will need to be manually triggered.
vultr_action_create_snapshot(integer $website_id = '', string $backup_api = '', boolean $ret_val = false) : mixed
Vultr: action create snapshot.
Create a snapshot on the selected Vultr server.
This function is also called before any update. During this time a backup will be Created but no updates will be made this time around. A new update will need to be manually triggered.
integer | $website_id | Website ID. |
string | $backup_api | Backup api. |
boolean | $ret_val | Return output or not. |
call_gridpane_api(string $method, string $url, string $accessToken, mixed $backup_data = array()) : string
Call GridPane API, Authenticate & perform given method.
Use this function to contact GridPane API We use OAuth, an open standard for authorization. Here are the steps involved:
string | $method | GET|POST|PUT|DELETE. |
string | $url | relative URL for the call. |
string | $accessToken | Access token generated using OAuth Call. |
mixed | $backup_data | Json encoded array - Optional post data for the call. |
Output from GridPane API.
ajax_gridpane_action_update_ids() : void
Ajax.
Assign Server:Apps to Child Sites options table.
Compare connected Child Sites against connected GridPane account. Automatically check for Child Sites domain name in server list & save that app's Server ID & App ID to that Child Site's options table.
gridpane_action_update_ids() : void
Assign Server:Apps to Child Sites options table.
Compare connected Child Sites against connected GridPane account. Automatically check for Child Sites domain name in server list & save that app's Server ID & App ID to that Child Site's options table.
call_linode_api(string $method, string $url, string $accessToken, mixed $backup_data = array()) : string
Call Linode API, Authenticate & perform given method.
Use this function to contact Linode API We use OAuth, an open standard for authorization. Here are the steps involved:
string | $method | GET|POST|PUT|DELETE. |
string | $url | relative URL for the call. |
string | $accessToken | Access token generated using OAuth Call. |
mixed | $backup_data | Json encoded array - Optional post data for the call. |
Output from GridPane API.
call_digitalocean_api(string $method, string $url, string $accessToken, mixed $backup_data = array()) : array
Call DigitalOcean API, Authenticate & perform given method.
string | $method | GET|POST|PUT|DELETE. |
string | $url | relative URL for the call. |
string | $accessToken | Access token generated using OAuth Call. |
mixed | $backup_data | Json encoded array - Optional post data for the call. |
Output from DigitalOcean API.
call_plesk_api(string $method, string $url, string $baseurl, string $api_key, mixed $backup_data = array()) : array
Call Plesk API, Authenticate & perform given method.
string | $method | GET|POST|PUT|DELETE. |
string | $url | API endpoint for the call. |
string | $baseurl | Base url. |
string | $api_key | Plesk API Key. |
mixed | $backup_data | Json encoded array - Optional post data for the call. |
Output from cPanel API.
call_cpanel_api(string $method, string $url, string $baseurl, string $username, string $password, mixed $backup_data = array()) : array
Call cPanel API, Authenticate & perform given method.
string | $method | GET|POST|PUT|DELETE. |
string | $url | API endpoint for the call. |
string | $baseurl | Baseurl. |
string | $username | cPanel account username. |
string | $password | cPanel account password. |
mixed | $backup_data | Json encoded array - Optional post data for the call. |
Output from cPanel API.
call_cpanel_api_json(string $method, string $url, string $baseurl, string $username, string $password, mixed $backup_data = array()) : array
Call cPanel API, Authenticate & perform given method.
string | $method | GET|POST|PUT|DELETE. |
string | $url | API endpoint for the call. |
string | $baseurl | base url. |
string | $username | cPanel account username. |
string | $password | cPanel account password. |
mixed | $backup_data | Json encoded array - Optional post data for the call. |
Output from cPanel API.
get_cpanel_authentication_credentials(integer $website_id = '') : array
CPanel: Authentication.
Grab needed authentication credentials for cPanel API - either from global settings or individual settings.
integer | $website_id | Website ID. |
get_cpanel_manual_database_backups(integer $website_id = '') : false|string
Get cPanel manual database backups.
Create manual database backup via mysqldump.
Backups will be stored within /uploads/mainwp/api_db_backups
directory.
integer | $website_id | Website ID. |
cPanel account backups
ajax_cpanel_action_create_database_backup(boolean $ret_val = false, integer $website_id = null) : mixed
CPanel: action create database backup.
Create database backup for the selected cPanel server.
boolean | $ret_val | Return output or not. |
integer | $website_id | Website ID. |