PHP code example of feldsam-inc / one-php

1. Go to this page and download the library: Download feldsam-inc/one-php 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/ */

    

feldsam-inc / one-php example snippets


$vms = $response->get('VM');

echo "Total number of VMs is " , $vms->count() , "\n";

foreach($vms->all() as $vm) {
    if (!$vm->isEmpty('USER_TEMPLATE.LABELS')) {
        echo "VM ID ", $vm->get('ID'), " has label(s): ", $vm->get('USER_TEMPLATE.LABELS'), "\n";
    } else {
        echo "VM ID ", $vm->get('ID'), " doesn't have any labels.\n";
    }
}

$vms = $response->getIndexedBy('ID', 'VM');
// get VM with ID 2403
$vm = $vms->get(2403);