Reply
Accepted Solution

Using regex in object body request search for IP Address fields

Dale
Techie
Posts: 1
2381     0

 

 

{
    "data": {
        "address~": "10.0.1"
    },
    "method": "GET",
    "object": "lease"
}

 

 

when using a address search in an object body request search above I get the following 

 

 

Error:"AdmConDataError: Unexpected address syntax"

the documentation for lease states that the address is searchable by regex.

 

addressStringNYY! < = > ~

 

 

What is the correct syntax for this case?

 

Thanks

Dale

Re: Using regex in object body request search for IP Address fields

Moderator BRampling
Moderator
Posts: 69
2382     0

Which WAPI version are you using? It may be a bug. It's working fine for me on WAPI 2.5 and 2.7. Here is the curl command I used to test it, it gives me a list of all the leases matching that address regex:

 

curl -k1 -u admin:infoblox -H "Content-Type: application/json" -X POST https://10.60.27.4/wapi/v2.7/request -d '{"data":{"address~":"10.0.0"},"method":"GET","object":"lease"}'

Re: Using regex in object body request search for IP Address fields

Dale
Techie
Posts: 1
2382     0

Sorry my bad. I had multiple GET calls in one /request but missed a tilde on one if them which quite rightly returned an error.

 

    push @request, {
        "data" => {
            "address~" => $value
         },
        "method" => "GET",
        "object" => "lease",
        "args"   => {
            "_return_fields+" => "hardware,binding_state"
        }
    };
    

    push @request, {
        "data" => {
            "ipv4addr" => $value
        },
        "method" => "GET",
        "object" => "record:host",
        "args"   => {
            "_return_fields+" => "aliases"
        }
    };

Thanks for the help

Showing results for 
Search instead for 
Do you mean 

Recommended for You