Who Me Too'd this solution

Re: Get name/IP of grid master from WAPI
Moderator
Moderator
Posts: 315
This widget could not be displayed.
This widget could not be displayed.

Generally you need to know the gridmaster's name or IP address because that's where you need to send the HTTPS session for the WAPI call.  By default the gridmaster is the only appliance that can accept WAPI calls.  However it is possible to turn on WAPI access on other appliances.

 

If you're interested in finding out, in a generic way, such as for automation, you could ask for a list of all the appliances, and request the field "upgrade_group".  The active gridmaster will be the only appliance in the "Grid Master" upgrade group.

 

The upgrade_group field is not searchable so you would need to return all the appliances, and then parse the data to get the one you want.

 

The hostname is included by default.

 

There are potentially multiple IP addresses on any appliance.  Typically you would want the LAN1 or VIP address, which is stored in the "vip_setting" structure.

 

 

This call:

 

curl -k -u admin:infoblox -X GET 'https://10.100.42.6/wapi/v2.7/member?_return_fields%2b=upgrade_group,vip_setting'

would return a list like this:

 

[
    {
        "_ref": "member/b25lLnZpcnR1YWxfbm9kZSQw:gm.example.net",
        "config_addr_type": "BOTH",
        "host_name": "gm.example.net",
        "platform": "VNIOS",
        "service_type_configuration": "ALL_V4",
        "upgrade_group": "Grid Master",
        "vip_setting": {
            "address": "10.100.42.6",
            "dscp": 0,
            "gateway": "10.100.42.1",
            "primary": true,
            "subnet_mask": "255.255.255.0",
            "use_dscp": false
        }
    },
       {
        "_ref": "member/b25lLnZpcnR1YWxfbm9kZSQ3:gmc.example.net",
        "config_addr_type": "BOTH",
        "host_name": "gmc.example.net",
        "platform": "VNIOS",
        "service_type_configuration": "ALL_V4",
        "upgrade_group": "Default",
        "vip_setting": {
            "address": "10.100.42.7",
            "dscp": 0,
            "gateway": "10.100.42.1",
            "primary": true,
            "subnet_mask": "255.255.255.0",
            "use_dscp": false
        }
    }
]

View solution in original post

Who Me Too'd this solution