- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
API/WAPI network creation with extensible attributes
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 10:47 AM
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!
Solved! Go to Solution.
Re: API/WAPI network creation with extensible attributes
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2022 05:03 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2022 07:08 PM
Thank you Richard! will do tests based on your feedback
Re: API/WAPI network creation with extensible attributes
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2022 10:44 AM
It worked fine. Thank you again!