Reply
Highlighted

Combining search GET

banne
Techie
Posts: 2
2272     0

We are questioning our infobox for special extensible attributes. Is there a way of combining searches for network as well as network_containers. I tried this one but doesn't work: 

 

curl -k1 -u userSmiley Tongueassword -X GET https://grid/wapi/v2.1/networkcontainer -d _return_fields%2B=extattrs -d *Kunde~:=name&network -d _return_fields%2B=extattrs -d *Kunde~:=_*

 

Goal is to get one output by questioning network as well as network containers in parralel.

 

Thanks in advance!

Re: Combining search GET

GHorne Community Manager
Community Manager
Posts: 254
2273     0

You can't search across multiple objects, but you can bundle multiple searches into a single call using the '/request' path.

 

e.g this will search networks and containers and return you 2 arrays with the results

(you get one array per request object)

 

POST /wapi/v2.3/request HTTP/1.1
Host: xxx
Authorization: Basic ---
Content-Type: application/json

[
{
   "method": "GET",
   "object": "network",
   "data": {
        "network": "10.0.0.0/24"
    }
},
{
   "method": "GET",
   "object": "networkcontainer",
   "data": {
        "network": "10.0.0.0/8"
        }
}]

 

 

Re: Combining search GET

banne
Techie
Posts: 2
2273     0

Thanks for your reply! Can the /request path be used within one curl call and how could this look like (syntax)? I did not find specific information therefore. If this is not working with curl how would a alternative way look like?

THANKS!

Showing results for 
Search instead for 
Do you mean 

Recommended for You

Demo: Infoblox IPAM plug-in integration with OpenStack Newton