Reply
Accepted Solution

How to split/join via infoblox-client python WAPI client?

pgreenan
Techie
Posts: 3
2365     0

Does the python WAPI have an equivalent way to do the functions of the IPAM split and join buttons on the web browser client? I'm still fairly new to using the WAPI so I'm assuming that I'm overlooking it.

Re: How to split/join via infoblox-client python WAPI client?

Moderator BRampling
Moderator
Posts: 69
2365     0

Split/join aren't implemented in the infoblox-client Python module. You need to do this via the WAPI network object and the expand_network, resize, and split_network function calls.

Highlighted

Re: How to split/join via infoblox-client python WAPI client?

pgreenan
Techie
Posts: 3
2365     0

Could you give me a link to the documentation for these functions?

Re: How to split/join via infoblox-client python WAPI client?

Adviser
Posts: 70
2366     0

Hi,

 

Documentation regarding expand_network and split_network functions is available in the WAPI reference guide available under "Tech docs" in the support site.

 

Example scripts below.

 

Please note that the reference URIs for the networks need to be used.

 

Expand

 

 

#!/usr/bin/python
import requests
from requests.auth import HTTPBasicAuth
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

username = "admin"
password = "jarvis"
url = "https://10.192.33.12/wapi/v2.7/"
net = "network/ZG5zLm5ldHdvcmskMTAuMS4yLjQvMzAvMA:10.1.2.4/30/default"
func = "?_function=expand_network&prefix=24"


req = requests.post(url+net+func,auth=(username,password),verify=False)

print req.text

 

 

Split

 

#!/usr/bin/python
import requests
from requests.auth import HTTPBasicAuth
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

username = "admin"
password = "jarvis"
url = "https://10.192.33.12/wapi/v2.7/"
net = "network/ZG5zLm5ldHdvcmskMTAuMS4yLjAvMjQvMA:10.1.2.0/24/default"
func = "?_function=split_network&prefix=28&add_all_subnetworks=True"


req = requests.post(url+net+func,auth=(username,password),verify=False)

print req.text

 

Regards,

Sandeep

 

Re: How to split/join via infoblox-client python WAPI client?

pgreenan
Techie
Posts: 3
2366     0

Thanks Sandeep for both the sample code and pointing me to the WAPI reference guide on the support site.

Showing results for 
Search instead for 
Do you mean 

Recommended for You