PHP code example of rumd3x / cloudcone-sdk
1. Go to this page and download the library: Download rumd3x/cloudcone-sdk 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/ */
rumd3x / cloudcone-sdk example snippets
use Rumd3x\CloudCone\Api\V1\Compute;
$compute = new Compute('Api-Key-Here', 'App-Hash-Here');
$instances = $compute->getInstances(); // Returns an iterable collection with your instances
echo $instances->count(); // Display number of instances
$firstInstance = $instances->first(); // Retrieves first instance on collection
$allInstances = $instances->all(); // Retrieves all instances
$instancesOnH15 = $instances->where('nomename', '=', 'H15')->all(); // Retrieves all instances on Node H15
$instancesArray = $instances->toArray(); // Converts the collection to array