Reply
Accepted Solution

add network - json format

Authority
Posts: 31
3931     0

 

 

I realized after several months that my 'add network' code isn't working. The JSON I'm passing checks out, but I get a "bad value for network" no matter what I do.

 

 

$ curl -k --netrc-file creds -H "Content-Type: application/json" -X POST https://ipamhost/wapi/v2.3.1/network -d '{"network":{"value":"66.18.54.96\/27"},"extattrs":{"Circuit_id":{"value":752370},"Description":{"value":"BUS-Internet"},"Group":{"value":"STATIC_SUBNET"}},"name":{"value":"66.18.54.96"}}'
{ "Error": "AdmConProtoError: Bad value for network: '{u'value': u'66.18.54.96/27'}'",
  "code": "Client.Ibap.Proto",
  "text": "Bad value for network: '{u'value': u'66.18.54.96/27'}'"

 I've tried many permutations, including changing the position of the network tag within the larger JSON, removing the CIDR, removing the delimiting \ before the CIDR, removing all the other EAs, etc.  I still come up with 'bad value for network'. 

 

If I just have the below snippet for the payload, it works, but I can't add EAs that way...not to mention, in the long run I'll be calling this from php and it will be using a JSON payload.

-d network=66.18.54.96/27

 

What am I missing?  Any help is appreciated!

 

Thanks!

Blair

Re: add network - json format

enawilliam
Techie
Posts: 2
3931     0

Hello

i am new here

 

_______________

kerela tour packages for couple

[url=https://holidayhai.com/holidays/kerala-honeymoon-package]kerela tour packages for couple[/url]

Re: add network - json format

enawilliam
Techie
Posts: 2
3931     0

hello

I am new here

 

___________________

kerela tour packages for couple

[url=https://holidayhai.com/holidays/kerala-honeymoon-package]kerela tour packages for couple[/url]

Re: add network - json format

Adviser
Posts: 96
3931     0

Try this:

 

 

curl -k -u admin:infoblox -H "Content-Type: application/json" -X POST https://192.168.32.10/wapi/v2.5/network -d '{"network":"192.168.51.0/24","comment":"test"}'
Highlighted

Re: add network - json format

Authority
Posts: 31
3931     0

Thank you!  That worked!  Apparently I just need to be sure to put only true extattrs in that array.

Showing results for 
Search instead for 
Do you mean 

Recommended for You