Last active
January 4, 2016 20:59
-
-
Save ryanrhanson/8678097 to your computer and use it in GitHub Desktop.
Lists out all operating system reference codes available for ccis.
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 | |
// apiconfig.php needs to have apiUsername, apiKey, and the path to the SLApi file that used to be in this script. | |
require_once('configuration/apiconfig.php'); | |
$guestClient = SoftLayer_SoapClient::getClient('SoftLayer_Virtual_Guest', null, $apiUsername, $apiKey); | |
$objectMask = new SoftLayer_ObjectMask(); | |
$objectMask->operatingSystems->itemPrice; | |
$guestClient->setObjectMask($objectMask); | |
$hwlist = $guestClient->getCreateObjectOptions(); | |
foreach ($hwlist->operatingSystems as $oslist) { | |
echo "\n\r=====================================================================================================\n\r"; | |
echo "Operating System available: " . $oslist->itemPrice->item->description . ".\n\r"; | |
if (isset($oslist->itemPrice->hourlyRecurringFee)){ | |
echo "OS Hourly Cost: " . $oslist->itemPrice->hourlyRecurringFee . ".\n\r"; | |
} | |
echo "OS Monthly Cost: " . $oslist->itemPrice->recurringFee . ".\n\r"; | |
echo "Reference Code: " . $oslist->template->operatingSystemReferenceCode . ".\n\r"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment