1. Go to this page and download the library: Download dutchie027/vultr 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/ */
dutchie027 / vultr example snippets
composer
// uire_once ('vendor/autoload.php');
// make the connction to the API for use
// this will use "vultr.ini" with the KVPs created
// at composer load. As a minimum you need the API
$api = new dutchie027\Vultr\API();
...
// Ensure we have the composer libraries
dutchie027\Vultr\API();
// Ensure we have the composer libraries
dutchie027\Vultr\API();
// Lets get the account info and what else this API key can do
print_r(json_decode($api->account()->getAccountInfo(), true));
// Ensure we have the composer libraries
dutchie027\Vultr\API();
$config = [
'region' => 'ewr',
'size' => '10',
'label' => 'my first storage',
];
$json_return = $api->blockStorage()->createBlockStorage($config);
// Ensure we have the composer libraries
dutchie027\Vultr\API();
$config = [
'blockid' => '8692c434-08fa-4efb-a0fb-966a338aee07',
'size' => '40',
'label' => 'not my first rodeo',
];
$api->blockStorage()->updateBlockStorage($config);
// Ensure we have the composer libraries
dutchie027\Vultr\API();
$api->blockStorage()->deleteBlockStorage($blockid);
// Ensure we have the composer libraries
dutchie027\Vultr\API();
$json_return = $api->blockStorage()->getBlockStorage($blockid);
// Ensure we have the composer libraries
dutchie027\Vultr\API();
$config = [
'block_id' => '98772323-044a-4efb-a0fb-1234338abb07',
'instance' => '12345434-08fa-4efb-a0fb-966a338aee07',
'live' => false,
];
$api->blockStorage()->attachBlockStorage($config);
// Ensure we have the composer libraries
dutchie027\Vultr\API();
$config = [
'block_id' => '98772323-044a-4efb-a0fb-1234338abb07',
'live' => false,
];
$api->blockStorage()->detatchBlockStorage($config);
// Ensure we have the composer libraries
dutchie027\Vultr\API();
// Print various information about the Regions. All pretty self-explanatory
$api->regions()->listIds();
$api->regions()->listCities();
$api->regions()->listCountries();
$api->regions()->listContinents();
$api->regions()->listNames();
ini
# minimum vultr.ini
[api]
TOKEN='8675309TOMMY30918IN'
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.