1. Go to this page and download the library: Download hsrtech/catc library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$api = new \hsrtech\catc\Wrapper(
[
'email' => 'Registered Email',
'api_key' => 'YourLoginEmail'
],
[
'link' => 'The Base link for the api', // Default: https://panel.cloudatcost.com/api
'api_version' => 'the version of API to use', // Default = 'v1'
]
);
$api->getServers();
$api->getTemplates();
$api->getTasks();
$api->powerOnServer($Server_ID);
$api->powerOffServer($Server_ID);
$api->rebootServer($Server_ID);
$api->getConsole($Server_ID);
$api->renameServer($Server_ID, $Name);
$api->setRDNS($Server_ID, $rdns);
$api->runMode($Server_ID, $runmode);
$api->buildServer(
[
'cpu' => 'Amount of CPU cores for server',
'ram' => 'Amount of Ram for the server',
'storage' => 'Storage space alloted to the server',
'os' => 'Valid Operating System ID',
]
);