List the availability of a dedicated server by country and model.
{ }
Execution time: 00:00
require __DIR__ . '/vendor/autoload.php';
use \LGHOST\Api\ApiClient;
try {
$lghost = new ApiClient(
[ 'key' => '', 'secret' => '' ], // Optional - For calls that need authentication
'lghost-eu-v1', // Requires - Valid region
['debug' => false]); // Optional - Show debug messages
$result = $lghost->GET('/dedicated/server/availabilities', [
'country' => '' /** Country code */
'hardwareModel' => '' /** Hardware model/reference */
]);
// Optional - Here we can check return as array, just specify true
$object = $result->json(false);
// Optional - Here we can check for Code returned
if($object->Code === 200)
{
print_r($object->availabilities);
}
} catch (\LGHOST\Exceptions\InvalidParameterException $e) {
((PHP_SAPI == 'cli') ? print("Caught " . $e->getMessage() . "\r\n") : print("Caught " . $e->getMessage() . "
"));
} catch (\LGHOST\Exceptions\HttpException $e) {
((PHP_SAPI == 'cli') ? print("Caught " . $e->getMessage() . "\r\n") : print("Caught " . $e->getMessage() . "
"));
}
The SDK is being built, once published you will be able to use it with documentation provided by us.
The SDK is being built, once published you will be able to use it with documentation provided by us.
The SDK is being built, once published you will be able to use it with documentation provided by us.