How to PAPI session->search in WAPI?

Posts: 7
2218     0

Here's an edited excerpt of some working PAPI code that I'm trying to mimic with WAPI in Firefox RESTclient.  The function below is passed the FQDN entered by the user, to confirm it's an actual valid domain in IB.

Bottom line:  How do I do session->search in WAPI with the object being "Infoblox:Smiley Very HappyNS::Zone"???  What can I plug into RESTclient to perform the equivalent function.  Want to understand the WAPI piece before I start to attempt to write any program code.

Thanks.  The code follows below...

# Example valid domains:
#   function called with $fqdn = '' returns False
#   function called with $fqdn = '' returns name
# -------------------------------------------------------------
if ($fqdn eq False) # Check if domain exists in infoblox from FindFQDN results
    $status="Domain Name Not Found";

sub FindFQDN

    @ipam_objects = $session->search
        'object'        => 'Infoblox:Smiley Very HappyNS::Zone',
        'name'            => '^'.$fqdn,
        'views'            => "default"
    if ($session->status_detail() ne "Operation succeeded")
# -------------------------------------------------------------


Re: How to PAPI session->search in WAPI?

Posts: 18
2219     0

Hi TKalbas, I'm not sure if this is still relevant, but you can search the WAPI by making sending a GET request, where the URL starts with the type of object you are looking for, and contains the regular expression operator (~=) to match the search string.


You can paste the following example in a browser substituting the correct FQDN/IP address for your Grid Master and WAPI version, to find all DNS zones matching "":




There are more examples of WAPI operations (including searches) in the WAPI documentation section of the Grid Master:




Hope this helps.

Showing results for 
Search instead for 
Do you mean 

Recommended for You