- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
host query and subnet as part of response
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 06:25 AM
Hello.
I am doing a simple query to get a host record and it works fine. Here's what body looks like:
[{
"method": "GET",
"object": "record:host",
"data": {"name": "abc.com",
"network_view": "default"},
"args": { }
}]
and it responds me with answer:
Is there a way we can get 3400:7211:4234::abf1/122 as a resonse to a get query?
Re: host query and subnet as part of response
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2020 08:55 PM - edited 01-16-2020 08:56 PM
I think the best you could do is get the address, and separately get the network in CIDR format. But only if DHCP is checked on that host address. If DHCP is not checked, the address is not linked to a DHCP network.
[{
"method": "GET",
"object": "record:host",
"data": {"name": "abc.com",
"network_view": "default"},
"args": {
"_return_fields+":"ipv6addrs.ipv6addr,ipv6addrs.network" }
}]
'
which returns something like this:
[ [ { "_ref": "record:host/RECORD:abc.com/default", "ipv6addrs": [ { "_ref": "record:host_ipv6addr/RECORDADDR/abc.com/default", "configure_for_dhcp": true, "duid": "ab:cd", "host": "abc.com", "ipv6addr": "2603:abcd:1234:1002::9", "network": "2603:abcd:1234:1002::/64" } ], "name": "abc.com", "view": "default" } ] ]