Skip to content

Dns Entries duplicated #258

@gtmanfred

Description

@gtmanfred

I am having a weird issue with when I do a
$client->dnsService()->domainList() and I get duplicate entries back.

$domains = $client->dnsService()->domainList();

while($domain = $domains->Next()) {
    printf("%s\n", $domain->Name());
}

This results in

$ php challenge3.php
gtmanfred.com
manfred.io
notapasteb.in
gtmanfred.com
manfred.io
notapasteb.in

When I filter it with part of the first to, it works correctly without
duplicates

$domains = $client->dnsService()->domainList(array("name" => "manfred"));

while($domain = $domains->Next()) {
    printf("%s\n", $domain->Name());
}

$ php challenge3.php
gtmanfred.com
manfred.io

And when I use the actual api, it only returns the 3 domains.

cat this.py

import json
import sys

infile = sys.stdin
outfile = sys.stdout
with infile:
    try:
        obj = json.load(infile)
    except ValueError as e:
        raise SystemExit(e)
with outfile:
    print("Total Entries: {}".format(obj['totalEntries']), file=outfile)
    outfile.write('\n')

$ curl -s -X GET -H 'Content-type: application/json' -H "X-Auth-Token: $token" $endpoint/domains | python -m this
Total Entries: 3

So I am kind of at a loss for why this is.

Thanks

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions