API & Integration

Reply
Accepted Solution

Pull Multiple Extensible Atrributes for Networks

jsnukis
Techie
Posts: 5
3481     0

Sorry if this has been covered elsewhere, but I'm new to this.

I'm trying to pull the discovered networks from IPAM with a list of specific extensible attributes and am having problems with the Syntax. The inital query works:

 

https://99.99.99.99/wapi/v1.0/network?_return_type=xml-pretty&_max_results=10000

 

But every time I've tried to add attrivutes to pull I'm getting a 400. I would need all the items in the previous query and the values for the rest, can someone show me the syntax? Thanks in advance.

Re: Pull Multiple Extensible Atrributes for Networks

GHorne Community Manager
Community Manager
Posts: 254
3481     0

/network?_return_type=xml-pretty&_max_results=10000&_return_fields%2B=extattrs

 

You can't put a '+' in a querystring, you have to URL encode it. (depending on your HTTP client)

Re: Pull Multiple Extensible Atrributes for Networks

jsnukis
Techie
Posts: 5
3481     0

I thought I had tried that one, but here's the one I just entered:

 

https://GRID/wapi/v1.0/network?_return_type=xml-pretty&_max_results=10000&_return_fields%2B=extattrs

 

This still gets a 400 error. This will eventually be called by curl in a script, is there a different syntax? I plugged this into a curl statement and got this:

 

using _return_fields+=extattrs

{ "Error": "AdmConProtoError: Illegal option modifier   : _return_fields =extattrs",
  "code": "Client.Ibap.Proto",
  "text": "Illegal option modifier   : _return_fields =extattrs"
}

 

Using _return_fields%2B=extattrs

{ "Error": "AdmConProtoError: Unknown argument/field: 'extattrs'",
  "code": "Client.Ibap.Proto",
  "text": "Unknown argument/field: 'extattrs'"
}

 

I'm not the one who set this up, but it's looking like the extattrs are not set.

 

Re: Pull Multiple Extensible Atrributes for Networks

Adviser
Posts: 43
3481     0

_return_fields+=extattrs requires WAPI 1.2 or higher.

 

Try

 

https://GRID/wapi/v1.2/network?_return_type=xml-pretty&_max_results=10000&_return_fields%2B=extattrs

Highlighted

Re: Pull Multiple Extensible Atrributes for Networks

jsnukis
Techie
Posts: 5
3481     0

It looks as if the WAPI version was the issue, I set it to 1.6 from 1.0 and it returned values.

Showing results for 
Search instead for 
Do you mean 

Recommended for You