Skip to content

Instantly share code, notes, and snippets.

@underscorephil
Created February 19, 2013 21:26
Show Gist options
  • Save underscorephil/4990107 to your computer and use it in GitHub Desktop.
Save underscorephil/4990107 to your computer and use it in GitHub Desktop.
<?php
require_once './softlayer-api-php-client/SoftLayer/SoapClient.class.php';
$apiUsername = '';
$apiKey = '';
$accountClient = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $apiUsername, $apiKey);
$hardwareClient = SoftLayer_SoapClient::getClient('SoftLayer_Hardware_Server', null, $apiUsername, $apiKey);
$cciClient = SoftLayer_SoapClient::getClient('SoftLayer_Virtual_Guest', null, $apiUsername, $apiKey);\
$objectMask = "mask[hardware,virtualGuests]";
$accountClient->setObjectMask($objectMask);
$servers = $accountClient->getObject();
foreach ($servers->hardware as $server) {
$hardwareClient->setInitParameter($server->id);
print_r($hardwareClient->shutdownPublicPort());
}
foreach ($servers->virtualGuests as $server) {
$cciClient->setInitParameter($server->id);
print_r($cciClient->shutdownPublicPort());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment