Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
WAPI Body Request to obtain all lease data for a network when you only have the FQDN
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2021 10:36 AM
1287     0
I'm trying to retrieve all lease data for a pool of information. I only have a FQDN, i.e. device.sitenum.domain.com. I'm trying to daisy chain the following requests to get where I need to go:
1. Get host_record by FQDN to obtian IPv4Addr
2. Use IPv4Add4 to obtain network
3. Use network to obtain lease data.
So far, I can use FQDN to obtain IPV4addr, but storing it with STATE:ASSIGN gives me back an ipv4addr object like this, which I cannot extract the IP address from, to ask for the ipv4addr object, which would give me the network I want lease from:
[
{
"host_name": "hostname.sitenumber.domain.com",
"myREF": [
{
"_ref": "record:host_ipv4addr/ZG5zLasfasfdasdfasfdafdafdsda:1.2.3.4/hostname.sitenumber.domain.com/default",
"configure_for_dhcp": false,
"host": "hotsname.sitenumber.domain.com",
"ipv4addr": "10.220.101.250"
}
]
}
]
My assign which gave me all that was:
"assign_state" : {
"myREF" : "ipv4addrs"
},
However, that does not give me the individual ipv4address so I can get it's network, so I can use that to pull leases to review state.....
Does anyone have any thoughts on how to go from a hostname to getting all lease in that hostname's subnet, all via 1 WAPI Body Request?
thank you for any ideas, answers
David