January 3, 2015

Get primary ip address record
For a given virtual guest id, retrieve the information concerning its primary ip address


/* You can use the getenv() module to pull your exported Username
and API key to keep from having to store them in your files */

require_once './vendor/autoload.php';
$apiUsername = getenv('SOFTLAYER_USERNAME');
$apiKey = getenv('SOFTLAYER_API_KEY');
$vsi_id = 22983449;

try {
  $client = \SoftLayer\SoapClient::getClient('SoftLayer_Virtual_Guest', $vsi_id, $apiUsername, $apiKey);
  $objectMask = new \SoftLayer\Common\ObjectMask();
  $guest = $client->getObject();

 } catch(Exception $e) {
     echo 'Cannot compute. Error is: ' . $e->getMessage();



We would love to hear it
Open an issue