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: [email protected]<mailto:[email protected]>
From: Diego Bellini
Sent: 20 March 2017 17:43
To: '[email protected]' <[email protected]>
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
_______________________________________________
Pdns-users mailing list
[email protected]
https://mailman.powerdns.com/mailman/listinfo/pdns-users

Reply via email to