PHP Classes

Cloudways API Class: Manage servers and applications with CloudWays API

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 65 All time: 10,380 This week: 455Up
Version License PHP version Categories
cloudwaysapiclass 1.0.0MIT/X Consortium ...5.6PHP 5, Hosting


This class can manage servers and applications with CloudWays API.

It can send HTTP requests to the CloudWays API Web server to perform several operations with servers hosted via the CloudWays platform.

Currently it can get all the servers of an account, delete a server, get and set the settings of a server, get server applications, add or delete an application.

Innovation Award
PHP Programming Innovation award nominee
May 2017
Number 7
Cloud hosting services are often used by Web applications that need to be able to quickly scale the number of servers used to handle the current load of a Web application.

Cloudways is one provider that can manage servers and installed applications of cloud hosting services. This class provides means to control those servers using Cloudways API.

Manuel Lemos
Picture of Shahroze Nawaz
  Performance   Level  
Name: Shahroze Nawaz <contact>
Classes: 1 package by
Country: Pakistan Pakistan
Age: ???
All time rank: 447358 in Pakistan Pakistan
Week rank: 185 Up4 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 1x


include 'CloudwaysApi.php';
$api_key = 'Your_api_key';
$email = 'Your_Cloud_email';
$cw_api = new CloudwaysAPI($email,$api_key);
$servers = $cw_api->getServers();
$settings = $cw_api->getServerSettings($serverId);
$applications = $cw_api->getApplications();
$addapp= $cw_api->addApplication($serverid, $application, $app_version, $app_name);
$delapp= $cw_api->deleteApplication($serverid, $applicationid);
$delserver = $cw_api->deleteServer($serverId);


//for updating server settings

foreach($servers->servers as $serverinfo){}
$server_settings = $cw_api->get_servers_settings($serverinfo->id);
$success = null;
$server_id = $_POST['server_id'];
$date_timezone = $_POST['date_timezone'];
$display_errors = $_POST['display_errors'];
$apc_shm_size = $_POST['apc_shm_size'];
$execution_limit = $_POST['execution_limit'];
$memory_limit = $_POST['memory_limit'];
$max_input_vars = $_POST['max_input_vars'];
$max_input_time = $_POST['max_input_time'];
$mod_xdebug = $_POST['mod_xdebug'];
$upload_size = $_POST['upload_size'];
$error = null;
$result = $cw_api->set_servers_settings($server_id,$date_timezone,$display_errors,$apc_shm_size,$execution_limit,$memory_limit,$max_input_vars,$max_input_time,$mod_xdebug,$upload_size);
$result == [])
$success["message"] = "Settings has been saved!";
$success["message"] = "Kindly correct the above errors.";
$Message = urlencode($success["message"]);

  Files folder image Files  
File Role Description
Plain text file CloudwaysApi.php Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file index.php Example Example script

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,380
This week:455Up