- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Looking for API info on adding "DHCP -> Shared Networks" and other Infoblox objects
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2023 10:06 AM
GitHub - infobloxopen/infoblox-client: Infoblox NIOS Python WAPI Client or
Primarily using Python but some JavaScript React.
Thanks in advance.
Re: Looking for API info on adding "DHCP -> Shared Networks" and other Infoblox objects
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 06:40 AM
The best way to create your own examples is to create something once in the GUI, and use WAPI to see what the JSON looks like. Turn it into a REST call, modify the JSON payload appropriately, and send the JSON as a new call.
In general, POST is for creating new stuff and PUT is for modifying existing stuff using the _ref.
Create a shared network, using the _ref for each network to be added:
curl -k1 -u admin:infoblox -X POST 'https://192.168.1.2/wapi/v2.11/sharednetwork' -H "Content-Type: application/json" -d \ '{ "name": "my_shared_network", "network_view": "default", "networks": [ { "_ref": "network/ZG5zLm5ldHdvcmskMTkyLjE2OC4xLjAvMjQvMA:192.168.1.0/24/default" }, { "_ref": "network/ZG5zLm5ldHdvcmskMTkyLjE2OC4yNTUuMC8yNC8w:192.168.255.0/24/default" } ] }'
returns the _ref of the shared network:
"sharednetwork/ZG5zLnNoYXJlZF9uZXR3b3JrJG15X3NoYXJlZF9uZXR3b3JrLjA:my_shared_network/default"
Define the DHCP options (lease tine & dns servers) on a shared network:
curl -k1 -u admin:infoblox -X PUT 'https://192.168.1.2/wapi/v2.11/sharednetwork/ZG5zLnNoYXJlZF9uZXR3b3JrJG15X3NoYXJlZF9uZXR3b3JrLjA:my_shared_network/default' -H "Content-Type: application/json" -d \ '{ "options": [ { "name": "dhcp-lease-time", "num": 51, "use_option": true, "value": "259200", "vendor_class": "DHCP" }, { "name": "domain-name-servers", "num": 6, "use_option": true, "value": "192.168.1.2,192.168.2.2", "vendor_class": "DHCP" } ] }'
returns the _ref of the shared network again:
"sharednetwork/ZG5zLnNoYXJlZF9uZXR3b3JrJG15X3NoYXJlZF9uZXR3b3JrLjA:my_shared_network/default"
Re: Looking for API info on adding "DHCP -> Shared Networks" and other Infoblox objects
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 06:57 AM
Thank you. This is helpful. I'm surprised there is not an infoblox-client built with JavaScript/Node.js.