Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

API & Integration, DevOps,NetOps,SecOps

Reply

API/WAPI network creation with extensible attributes

Posts: 3
475     1

Hi all,

 

Is there a way to do a API/WAPI call to create a network along with the parameters which contains the extensible attributes associated to it? (I'm not looking for the next available network function, but defining the network I want to create by myself)

 

I've looked for examples but so far haven't found references. Thank you for your assistance!

Re: API/WAPI network creation with extensible attributes

Community Manager
Community Manager
Posts: 178
475     1

These are both acceptable.  In both examples, The same JSON data could be sent with any API.  I like using curl for examples.

 

The first one is more simple, it simply posts the network using the network URL.

 

 

curl -k1 -u admin:infoblox -X POST 'https://192.168.1.2/wapi/v2.10/network' -H "Content-Type: application/json" -d \
'{
	"network": "172.16.105.0/24", 
	"network_view": "default",
	"comment": "Honolulu Datacenter", 
	"extattrs": {
		"Data Center": {
			"value": "Honolulu"
		}, 
		"Network Type": {
			"value": "Data Center"
		}
	}
}'

 

 

This second example is a "request" style, sent to the request URL.  This method is more consistent as it can be used for any type of work because the request type and action are described in the call instead of in the URL.

 

 

curl -k1 -u admin:infoblox -X POST 'https://192.168.1.2/wapi/v2.10/request' -H "Content-Type: application/json" -d \
'[{
    "method":"POST",
    "object":"network",
    "data": {
        "network": "172.16.104.0/24", 
        "network_view": "default",
        "comment": "Honolulu Datacenter", 
        "extattrs": {
            "Data Center": {
                "value": "Honolulu"
            }, 
            "Network Type": {
                "value": "Data Center"
            }
        }
    }
}]'

 

 

Re: API/WAPI network creation with extensible attributes

Posts: 3
476     1

Thank you Richard! will do tests based on your feedback

Re: API/WAPI network creation with extensible attributes

Posts: 3
476     1

It worked fine. Thank you again!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You