Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

API Examples

Reply
Highlighted
Accepted Solution

nextavailablenetwork with IPv6

Posts: 3
404     0

Hello,

 

 

can anyone tell me the correct Syntax for nextavailablenetwork from an IPv6 Container?

 

if i use following syntax with ipv4, i receive a network:

data = '{"network": "func:nextavailablenetwork:192.168.0.0/16,XXX,24", "network_view": "XXX", "comment": "Used"}'

 

 

But if i use the same Syntax for IPv6:

 

 

data = '{"network": "func:nextavailablenetwork:aaaa:bbbb:0000:0000:0000:0000:0000:0000/48,XXX,64", "network_view": "XXX", "comment": "Used"}'

 

i get following error message:

 

{ "Error": "AdmConProtoError: Invalid CIDR specified in network (aaaa:bbbb:0000:0000:0000:0000:0000:0000/48,XXX64)", 

  "code": "Client.Ibap.Proto", 

  "text": "Invalid CIDR specified in network (aaaa:bbbb:0000:0000:0000:0000:0000:0000/48,XXX,64)"

}

I tried also the short form of the IPv6 Prefix, bute the error message was the same:

 "Error": "AdmConProtoError: Invalid CIDR specified in network (aaaa:bbbb::/48,XXX,64)", 

  "code": "Client.Ibap.Proto", 

  "text": "Invalid CIDR specified in network (aaaa:bbbb::/48,XXX,64)"

}

 

 

 

thanks

thomas

Highlighted

Re: nextavailablenetwork with IPv6

Adviser
Posts: 431
404     0

Change this:

 

data = '{"network": "func:nextavailablenetwork:aaaa:bbbb:0000:0000:0000:0000:0000:0000/48,XXX,64", "network_view": "XXX", "comment": "Used"}'

 

 

To this:

 

data = '{"ipv6network": "func:nextavailablenetwork:aaaa:bbbb:0000:0000:0000:0000:0000:0000/48,XXX,64", "network_view": "XXX", "comment": "Used"}'

 

"ipv6network/ZG5zLm5ldHdvcmskMjAwMTpkYjg6Oi82NC8w:2001%3Adb8%3A%3A/64/default"
Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

www.sifbaksh.com
Highlighted

Re: nextavailablenetwork with IPv6

Posts: 3
404     0

Hi SBaksh,

 

do i need a special Version for the command?

 

i changed:

    data = '{"network":"

to 

   data = '{"ipv6network":"   

 

But than i get following error:

{ "Error": "AdmConProtoError: field for create missing: network", 

  "code": "Client.Ibap.Proto", 

  "text": "field for create missing: network"

}

 

I am using Api version 2.9 and infoblox Version: 8.4.3-383835.

 

 

Could it be that i also need to change the URL?

I use following Url:

https://x.x.x.x/wapi/v2.9/network'

 

Thanks thomas

 

Highlighted

Re: nextavailablenetwork with IPv6

Adviser
Posts: 431
404     0

Here is a CURL Example

 

curl --location --request POST 'https://gm/wapi/v2.7/ipv6network' \
--header 'Content-Type: application/json'
--data-raw '{
"network": "func:nextavailablenetwork:2001:db8::/48,default,64"
}

'
Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

www.sifbaksh.com
Highlighted

Re: nextavailablenetwork with IPv6

Posts: 3
404     0

Hi Sbaksh,

 

thanks now it is working.

 

 

If anyone needs a python ipv6network example:

 

#!/usr/bin/env python3 

import requests

 

 

headers = {

    'content-type': 'application/json',

}

 

params = (

    ('_return_fields+', 'network,comment'),

    ('_return_as_object', '1'),

)

 

data = '{"network": "func:nextavailablenetwork:aaaa:bbbb::0/48,YOURVIEW,64", "network_view": "YOURVIEW", "comment": "Used"}'

 

response = requests.post('https://YOURHOST/wapi/v2.9/ipv6network', headers=headers, params=params, data=data, verify=False, auth=('USER', 'PASSWORD'))

 

 

 

Showing results for 
Search instead for 
Do you mean 

Recommended for You