Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dns Entries duplicated #258

Closed
gtmanfred opened this issue Jan 2, 2014 · 2 comments
Closed

Dns Entries duplicated #258

gtmanfred opened this issue Jan 2, 2014 · 2 comments
Assignees

Comments

@gtmanfred
Copy link

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

@gtmanfred
Copy link
Author

@jamiehannaford
Copy link
Contributor

@gtmanfred Hey Daniel, I can confirm that this is indeed a bug - but only with this particular feature. For some reason, the DNS API handles paginated collections differently than other APIs - so the limit and marker query parameters have no real effect (resulting in the same data being returned multiple times).

I'm working on a fix now - should be live either over the weekend on by Monday. I'll keep you updated. Thanks for the catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants