GetItemsFromDeviceListUsingMultipleFilters.php
GetItemsFromDeviceListUsingMultipleFilters.php
<?php
require_once ('C:\softlayer-api-php-client-master\src\SoapClient.php');
$apiUsername = 'set me ';
$apiKey = 'set me ';
$endpointUrl = 'https://api.softlayer.com/soap/v3.1/';
$serviceName = 'SoftLayer_Search';
$location = 'Dallas 6';
$privateIpAddress = '10.107.141.195';
$deviceName = 'ccnewtork3306vddal06.softlayer.local';
$client = \SoftLayer\SoapClient::getClient($serviceName, null, $apiUsername, $apiKey, $endpointUrl);
$filterData = 'networkGatewayMemberFlag:"1" '.
'& datacenter.longName:"'.$location .'"'.
'& primaryBackendIpAddress:'.$privateIpAddress.
'& fullyQualifiedDomainName:'. $deviceName.
'_objectType:SoftLayer_Hardware';
try {
$receipt = $client->advancedSearch($filterData);
print_r($receipt);
} catch (Exception $e) {
echo 'Unable to get the Gateways according to set of filters: ' . $e->getMessage();
}