Reply
Highlighted

How to search via WAPI

yardenbar
Techie
Posts: 8
5003     0

Hi all,

I'm trying to search of a 'zone_auth' object that I've just created.

I know its restricted for Global search (searches via the search object)

 

How can I list all zone_auth that exist?

 

Generic info about searching object-refs using WAPI will also be much appreciated Smiley Happy

 

Best,

Yarden

Re: How to search via WAPI

Adviser
Posts: 70
5004     0

Hi Yarden,

 

To search for all zone_auth objects using WAPI you can make a GET call as below.

 

 

 

curl -k -u admin:infoblox -X GET https://10.192.32.240/wapi/v2.5/zone_auth

 

 

To search for a particular zone such as sample.com, use a call like either of the ones below.

 

 

1)   curl -k -u admin:infoblox -X GET https://10.192.32.240/wapi/v2.5/zone_auth?fqdn=sample.com

 

2) curl -k -u admin:infoblox -H "Content-type: application/json" -X GET https://10.192.32.240/wapi/v2.5/zone_auth -d '{ "fqdn": "sample.com" }'

 

 

A good starting point on searching objects in wapi would be using the schema.

 

Below is the sample call to GET the whole schema.

 

https://10.192.32.240/wapi/v2.5/?_schema

 

Below is a the sample call to GET the schema of a particular object (like zone_auth).

 

https://10.192.32.240/wapi/v2.5/zone_auth?_schema

 

Here are some youtube videos that would be helpful when working with Infoblox WAPI.

 

https://www.youtube.com/watch?v=Ppd_9Owukc0&list=PLRASOKPhqoBwVEk8SKOnInzn0n9xSi-0M

 

Finally, the WAPI reference guide available in the Infoblox Support site would also be very helpful.

 

 

Cheers,

Sandeep

Re: How to search via WAPI

yardenbar
Techie
Posts: 8
5004     0

Hello Sandeep,

Thank you for the detailed reply. The _schema paramter is very useful.

 

I'm using v2.6 of the API.

 

Initially, zone 'somesite.com' was created.
Then I created a sub-zone 'myfoo.somesite.com'. -> this is the one I'm searching for.

 

I was able to use the 'fqdn' request parameter to retrieve the 'somesite.com' zone, butnot the myfoo zone.

 

In the web UI, 'myfoo' zone has the follwoing attributes:

- Cloud Usage: Cloud from adapter

- Owned by: Cloud Adapter

 

What am I missing?

Re: How to search via WAPI

yardenbar
Techie
Posts: 8
5004     0

Hi again,
I tried my luck with record:a object type.

Creation was pretty smooth.

 

Searching for the records didn't yeild any result. tried using 'name' and 'ipv4addr' request parameter, returned ampty results.

Re: How to search via WAPI

Adviser
Posts: 70
5004     0

Hi Yarden,

 

I was able to pull up A records with "zone"

 

Please see the calls and outputs below.

 

sandeep@jarvis ~ $ curl -k -u srenjith:Test123% -H "Content-type: application/json" -X GET https://10.192.33.240/wapi/v2.5/record:a -d '{"zone": "abc.com" }'
[
    {
        "_ref": "record:a/ZG5zLmJpbmRfYSQuX2RlZmF1bHQuY29tLmFiYyxhYWEsMS4xLjEuMQ:aaa.abc.com/default",
        "ipv4addr": "1.1.1.1",
        "name": "aaa.abc.com",
        "view": "default"
    },
    {
        "_ref": "record:a/ZG5zLmJpbmRfYSQuX2RlZmF1bHQuY29tLmFiYyxoZWxsbywxMC4xOTIuMzIuNTk:hello.abc.com/default",
        "ipv4addr": "10.192.32.59",
        "name": "hello.abc.com",
        "view": "default"
    }
]sandeep@jarvis ~ $ curl -k -u srenjith:Test123% -H "Content-type: application/json" -X GET https://10.192.33.240/wapi/v2.5/record:a -d '{"name": "hello.abc.com" }'
[
    {
        "_ref": "record:a/ZG5zLmJpbmRfYSQuX2RlZmF1bHQuY29tLmFiYyxoZWxsbywxMC4xOTIuMzIuNTk:hello.abc.com/default",
        "ipv4addr": "10.192.32.59",
        "name": "hello.abc.com",
        "view": "default"
    }
]sandeep@jarvis ~ $ curl -k -u srenjith:Test123% -H "Content-type: application/json" -X GET https://10.192.33.240/wapi/v2.5/record:a -d '{"ipv4addr": "10.192.32.59" }'
[
    {
        "_ref": "record:a/ZG5zLmJpbmRfYSQuX2RlZmF1bHQuY29tLmFiYyxoZWxsbywxMC4xOTIuMzIuNTk:hello.abc.com/default",
        "ipv4addr": "10.192.32.59",
        "name": "hello.abc.com",
        "view": "default"
    }
]

 

Regarding the subzone, is it delegated to a cloud platform member? If so does it have only the CP member as a nameserver?

 

I am doing a little bit of testing on this. Will get back to you in some time on this.

 

Regards,

Sandeep

Re: How to search via WAPI

Adviser
Posts: 70
5004     0

Hi Yarden,

 

Regarding the subzone, I tested a few scenarios and was able to GET the zone with FQDN in all scenarios.

 

I would suggest opening a case with support at this point, so that troubleshooting can be done according to the specifics of your environment.

 

Regards,

Sandeep

Re: How to search via WAPI

yardenbar
Techie
Posts: 8
5004     0

Thank you Sandeep for your efforts.

Showing results for 
Search instead for 
Do you mean 

Recommended for You

Demo: Infoblox IPAM plug-in integration with OpenStack Newton