Created
August 29, 2012 22:11
-
-
Save underscorephil/3519545 to your computer and use it in GitHub Desktop.
Cancel Multiple Servers
This file contains 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/SoapClient.class.php'); | |
/** | |
* Set your SoftLayer API username and key. | |
*/ | |
$apiUsername = ''; | |
$apiKey = ''; | |
$hardwareClient = SoftLayer_SoapClient::getClient('SoftLayer_Hardware', NULL, $apiUsername, $apiKey); | |
$ticketClient = SoftLayer_SoapClient::getClient('SoftLayer_Ticket', NULL, $apiUsername, $apiKey); | |
$ipsToCancel = array('1.1.1.1', '2.2.2.2', '3.3.3.3'); | |
foreach ($ipsToCancel as $ipToCancel) { | |
$server = $hardwareClient->findByIpaddress($ipToCancel); | |
$result = $ticketClient->createCancelServerTicket($server->id, "Because reasons", "Please cancel this server", TRUE, "HARDWARE"); | |
print($result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you provide one for canceling iSCSI storage