Cloudflare\Zone\Dns::list_records PHP Method

list_records() public method

List DNS Records (permission needed: #dns_records:read) List, search, sort, and filter a zones' DNS records.
public list_records ( string $zone_identifier, string | null $type = null, string | null $name = null, string | null $content = null, string | null $vanity_name_server_record = null, integer | null $page = null, integer | null $per_page = null, string | null $order = null, string | null $direction = null, string | null $match = null )
$zone_identifier string
$type string | null DNS record type (A, AAAA, CNAME, TXT, SRV, LOC, MX, NS, SPF)
$name string | null DNS record name
$content string | null DNS record content
$vanity_name_server_record string | null Flag for records that were created for the vanity name server feature (true, false)
$page integer | null Page number of paginated results
$per_page integer | null Number of DNS records per page
$order string | null Field to order records by (type, name, content, ttl, proxied)
$direction string | null Direction to order domains (asc, desc)
$match string | null Whether to match all search requirements or at least one (any) (any, all)
    public function list_records($zone_identifier, $type = null, $name = null, $content = null, $vanity_name_server_record = null, $page = null, $per_page = null, $order = null, $direction = null, $match = null)
    {
        $data = ['type' => $type, 'name' => $name, 'content' => $content, 'vanity_name_server_record' => $vanity_name_server_record, 'page' => $page, 'per_page' => $per_page, 'order' => $order, 'direction' => $direction, 'match' => $match];
        return $this->get('zones/' . $zone_identifier . '/dns_records', $data);
    }