PHP code example of hsrtech / catc

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/ */

    

hsrtech / catc example snippets


$api = new \hsrtech\catc\Wrapper(
    [
        'email' => 'Registered Email',
        'api_key' => 'YourLoginEmail'
    ]
);

$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',
    ]
);

$api->deleteServer($Server_ID);

$api->getResources();

$api->results();

Name: CatC Wrapper
Author: Rishabh Jain
Website: https://www.hsrtech.net
Stable Version: 1.0
Minimum Requirement: PHP 5.6 with cURL extenssion