Get all zones
getAllZones()
This should return all zones which are present in the dns integration.
Parameters
Type | Name | Description |
|---|---|---|
IpamRdnsHost | $ipamRdnsHost | The DNS host containing the credentials |
Response
Array of ZoneDetails() classes. Each class resembles a zone contains the following attributes: See Create zone
Example Code
public function getAllZones(IpamRdnsHost $ipamRdnsHost): array {
$return = [];
try {
$zoneResponse = $this->_sendRequest($ipamRdnsHost, "zones?per_page=50");
} catch (ClientException $e) {
throw new Exception($this->_getErrorMessage($e));
}
foreach ($zoneResponse->result as $zone) {
$return[] = new ZoneDetails(
$zone->id,
$zone->name,
null,
$zone->name_servers
);
}
return $return;
}Testing
You can test this function when opening the admin area. Settings > DNS Hosts > All zones. The requests is done sync.
Was this helpful?