Skip to content

Instantly share code, notes, and snippets.

@underscorephil
Created August 29, 2012 22:11
Show Gist options
  • Select an option

  • Save underscorephil/3519545 to your computer and use it in GitHub Desktop.

Select an option

Save underscorephil/3519545 to your computer and use it in GitHub Desktop.
Cancel Multiple Servers
<?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);
}
@amol
Copy link
Copy Markdown

amol commented Nov 15, 2013

Can you provide one for canceling iSCSI storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment