PHP code example of fdisotto / cac-api

1. Go to this page and download the library: Download fdisotto/cac-api 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/ */

    

fdisotto / cac-api example snippets


$cac = new \fdisotto\CACApi(array(
    'key' => 'YourApiKey',
    'login' => 'YourLoginEmail'
));

print_r($cac->getServers());

print_r($cac->getTemplates());

print_r($cac->getTasks());

$cac->powerOnServer($serverID);

$cac->powerOffServer($serverID);

$cac->resetServer($serverID);

$cac->getConsoleUrl($serverID);

$cac->renameServer($serverID, $newName);

$cac->reverseDNS($serverID, $hostname);

$cac->runMode($serverID, $runmode);