Get host list

				
					StructHostList[] hostList(string idSession, array filters)
			

Returns a list of hosts corresponding to the filters

REQUIRED

  • idSession string (32)
    Session ID

 

OPTIONAL

  • filters array
    Search filters
  •  

    Available filter keys:

    • name (Host name)
    • ipv4 (IPv4 address)
    • ipv6 (IPv6 address)

    For more information on filters for list functions, please consult the corresponding page.

An Array of StructHostList

$clientSOAP = new SoapClient('https://URL.wsdl');

$filters = array(
  'name' => ['LIKE' => 'ns1.%'],
  'ipv4' => ['<>' => '1.1.1.1']
);

try {
  $idSession = $clientSOAP->sessionOpen('XX000', 'xxxxxxxx');
  $arrayHostList = $clientSOAP->hostList($idSession, $filters);
  print_r($arrayHostList);

} catch (SoapFault $fault) {
    echo 'Exception : ' . $fault->getMessage() . "\n";
}

if (isset($idSession)) {
    $clientSOAP->sessionClose($idSession);
}