Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

searching for records using regex #188

Open
fawaf opened this issue Oct 7, 2022 · 12 comments
Open

searching for records using regex #188

fawaf opened this issue Oct 7, 2022 · 12 comments

Comments

@fawaf
Copy link

fawaf commented Oct 7, 2022

the sdk does not seem to support searching by name/regex as detailed in the api documenation https://www.infoblox.com/wp-content/uploads/infoblox-deployment-infoblox-rest-api.pdf. is that the case, or am i missing something?

e.g. curl -k -u admin:infoblox -X GET "https://grid-master/wapi/v2.12/record:a?name~=host1.info.com&_return_as_object=1"
image

@fawaf
Copy link
Author

fawaf commented Oct 18, 2022

poke @skudriavtsev

@hemanthKa677
Copy link
Collaborator

Hi @fawaf , Please try with command with syntax below, it is working for fetching/searching records.
With record fqdn:
curl -k1 -u admin:infoblox -X GET "https://grid-master/wapi/v2.11/record:a?name~=infoblox.test.com&_return_fields=name&_return_as_object=1"

With record zone name:
curl -k1 -u admin:infoblox -X GET "https://grid-master/wapi/v2.11/record:a?name~=test.com&_return_fields=name&_return_as_object=1"

@fawaf
Copy link
Author

fawaf commented Dec 13, 2022

Hi @fawaf , Please try with command with syntax below, it is working for fetching/searching records. With record fqdn: curl -k1 -u admin:infoblox -X GET "grid-master/wapi/v2.11/record:a?name~=infoblox.test.com&_return_fields=name&_return_as_object=1"

With record zone name: curl -k1 -u admin:infoblox -X GET "grid-master/wapi/v2.11/record:a?name~=test.com&_return_fields=name&_return_as_object=1"

i know the api supports this. this issue is for the go sdk/client, not for the api itself.

@hemanthKa677
Copy link
Collaborator

Hi @fawaf , In the infoblox-go-client, there is function with GetARecord to which DNSView , recordName and ipv4addr is mandatory to pass as arguments, this function works fine for searching the record

@fawaf
Copy link
Author

fawaf commented Dec 14, 2022

sure, but we want to search for a fqdn (or substring of an fqdn) and get the result from that instead of having to pass in the exact record name and ip address, which defeats the point of searching right? the ~= query does exactly that, but the go sdk doesn't seem to support that api call.

@hemanthKa677
Copy link
Collaborator

Hi @fawaf , there is an go client generator which will add the function that supports this searching for records feature which is under review, so once that gets into the go client, then this function will work as per wapi api documentation.

@fawaf
Copy link
Author

fawaf commented Feb 3, 2023

any updates yet @hemanthKa677

@hemanthKa677
Copy link
Collaborator

Hi @fawaf , I am writing a code for this, just with zone name passed, will return the existing a records belong to the zone, in a day or two. I will create a PR, try to merge it asap.

@hemanthKa677
Copy link
Collaborator

Hi @fawaf , here is PR below for this issue ,
https://github.com/infobloxopen/infoblox-go-client/pull/201

I guess this will solve the get a records with passing just zone name returns list of a records

@fawaf
Copy link
Author

fawaf commented Feb 14, 2023

the pr isn't supporting the "contains" method that the infoblox api supports afaict, which is what the screenshot in the original issue above shows. it looks like it is just listing all A records specified by a specified zone? basically, i'm still not seeing a way to do substring records searching in the sdk.

@fawaf fawaf changed the title searching for records searching for records using regex May 30, 2023
@fawaf
Copy link
Author

fawaf commented May 30, 2023

@hemanthKa677 any updates?

@hemanthKa677
Copy link
Collaborator

Hi @fawaf , I will try to fix this issue in couple of weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants