Skip to content

Instantly share code, notes, and snippets.

@underscorephil
Created August 26, 2013 21:23
Show Gist options
  • Save underscorephil/6346821 to your computer and use it in GitHub Desktop.
Save underscorephil/6346821 to your computer and use it in GitHub Desktop.
$apiUser = '';
$apiKey = '';
$targetGlobalIp = '1.1.1.1';
$routeToIp = '1.1.1.2';
$accountClient = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $apiUser, $apiKey);
$objectMask = "mask.ipAddress";
$accountClient->setObjectMask($objectMask);
$globalIps = $accountClient->getGlobalIpRecords();
foreach ($globalIps as $globalIp) {
if ($globalIp->ipAddress->ipAddress == $targetGlobalIp) {
$targetGlobalId = $globalIp->id;
}
}
$globalIpClient = SoftLayer_SoapClient::getClient('SoftLayer_Network_Subnet_IpAddress_Global', $targetGlobalId, $apiUser, $apiKey);
$result = $globalIpClient->route($routeToIp);
print_r($result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment