Last active
October 13, 2015 23:18
-
-
Save underscorephil/4271461 to your computer and use it in GitHub Desktop.
SoftLayer_Virtual_Guest::createObject - PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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