Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SoftLayer_Virtual_Guest::createObject - PHP
<?php
require_once('softlayer-api-php-client/SoftLayer/SoapClient.class.php');
$apiUsername = '';
$apiKey = '';
$client = Softlayer_SoapClient::getClient('SoftLayer_Virtual_Guest', null, $apiUsername, $apiKey);
try {
$templateObject = new stdClass();
$templateObject->hostname = 'test1';
$templateObject->domain = 'example.com';
$templateObject->startCpus = 1;
$templateObject->maxMemory = 1024;
$templateObject->hourlyBillingFlag = true;
$templateObject->operatingSystemReferenceCode = 'UBUNTU_LATEST';
$templateObject->localDiskFlag = false;
$templateObject->datacenter = new stdClass();
$templateObject->datacenter->name = 'dal05';
$result = $client->createObject($templateObject);
print_r($result);
} catch ( Exception $e) {
die( $e->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.