Introducing SOC Insights for BloxOne Threat Defense: Boost your SOC efficiency with AI-driven insights to eliminate manual work and accelerate investigation and response times. Read the blog announcement here.

API & Integration, DevOps,NetOps,SecOps

Reply

API/WAPI network creation with extensible attributes

New Member
Posts: 3
1809     0

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

Moderator
Moderator
Posts: 287
1810     0

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

New Member
Posts: 3
1810     0

Thank you Richard! will do tests based on your feedback

Re: API/WAPI network creation with extensible attributes

New Member
Posts: 3
1810     0

It worked fine. Thank you again!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You