How to list all IPv4 DHCP Failover Associations via API?

I want to list all Pv4 DHCP Failover Associations via API, but unfortunately I was not able to find any documentations about it. Is there a way to list all the failover associations via API?

Tagged:

Answers

  • You can actually do this through WAPI using the dhcpfailover object.

    To list all IPv4 DHCP Failover Associations:

    GET https://<grid-master>/wapi/v2.13/dhcpfailover
    

    By default this only returns the name. To get useful info like primary/secondary members and their states, add _return_fields+:

    GET https://<grid-master>/wapi/v2.13/dhcpfailover?_return_fields+=primary,secondary,primary_state,secondary_state,comment,association_type
    

    One thing to be aware of — primary_state and secondary_state require the call to be made against the GM not the GMC. The GMC's readonly api doesn't have the live monitoring data needed to return those fields correctly.

    You can also browse the full object documentation directly: https://<grid-master>/wapidoc/objects/dhcpfailover.html

  • Thank you so much Ingmar for these information. I am able to pull the list. I appreciate the documentation as well :D