[Pdns-users] Question on APIs

Diego Bellini Diego.Bellini at Exponential-e.com
Wed Mar 22 09:56:39 UTC 2017


Hi,

I could make it work using something similar to

http://localhost:8081/api/v1/servers/localhost/search-data?q="content=1.1.1.1<http://localhost:8081/api/v1/servers/localhost/search-data?q=%22content=1.1.1.1>"

If I understood correctly, this will look for any 1.1.1.1 in "zones, records and comments"

If I run this on my test environment I get

[
  {
    "zone_id": "test100.com.",
    "zone": "test100.com.",
    "type": "A",
    "ttl": 300,
    "object_type": "record",
    "name": "test1.test100.com.",
    "disabled": false,
    "content": "1.1.1.1"
  },
  {
    "zone_id": "cpe.test200.net.",
    "zone": "cpe.test200.net.",
    "type": "A",
    "ttl": 300,
    "object_type": "record",
    "name": "diego.cpe.test200.net.",
    "disabled": false,
    "content": "1.1.1.1"
  }
]
Is there a way with the API "search-data" to look only for "1.1.1.1" under the zone "cpe.test200.net" so that I can get only 1 result?
I am not sure if this can be done or not

Any suggestion?


Thanks,
Diego Bellini
________________________________
Exponential-e Limited
t: 020 7096 4084
e: Diego.Bellini at Exponential-e.com<mailto:Diego.Bellini at Exponential-e.com>
From: Diego Bellini
Sent: 20 March 2017 17:43
To: 'pdns-users at mailman.powerdns.com' <pdns-users at mailman.powerdns.com>
Subject: Question on APIs

Hi all,
I have started to read documentation and play with power dns API

However I can find any help on internet on how to do the following action (if it is possible of course)

Let say I have some A records  under the zone example.org

1) I would like to find all the A records whose name contain a fixed-string
2) I would like to find all the A records whose content is a fixed-string (in case of A record, this means to look for all the A records that have the same IP)

I know that maybe I could use
URL: /api/v1/servers/localhost/search-data?q=:search_term&max=:max_results

But I can't work out how to make it working

Could anyone give me an example or a link where I could find them?
Or If you have any other idea on how to do the above via api, I would love some suggestions

Thanks,
Diego
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20170322/9e6f2c12/attachment-0001.html>


More information about the Pdns-users mailing list