PHP code example of corbpie / vultr-api-v2

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

    

corbpie / vultr-api-v2 example snippets



Corbpie\VultrAPIv2\VultrAPI;

$vultr = new VultrAPI();

echo $vultr->listServers();//Lists all server instances for account

$vultr->listServers();

$vultr->serverCreateDC(19);//Sydney Australia location
$vultr->serverCreatePlan(202);//(2048 MB RAM,55 GB SSD,2.00 TB BW)
$vultr->serverCreateType('ISO', 146817);//Deploy with my custom ISO id:146817
$vultr->serverCreateLabel('Created with API');//label instance as "Created with API"
echo $vultr->serverCreate();//Creates instance/server with parameters set above (returns subid)
example.php