-
Notifications
You must be signed in to change notification settings - Fork 84
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
"Field is not searchable" when getting record with EA #48
Comments
You'll have to use 'eaSearch' while creating RecordA object |
Can you provide an example? I'm not sure what you mean. |
If you're referring to setting the obj.eaSearch to something, the field is not exported, so I don't have access to setting the variable. |
I'll raise a PR soon Corresponding WAPI URL would look like :
|
Thanks. I did try to adjust the URL to have the EAKey and EAvalue in it (similar to how you mentioned), but it returned every object with the EA, and seemed to ignore the http body which had the details about the specific object I wanted. In this case I then had to loop through all those objects until I got the one that I cared about. |
PR Raised #49 |
In briefly glancing at the code, I see a few things.
Ideally I would like to be able to construct an A/CNAME record like the one above, and call GetObject and just get that object, or I could also construct an object like this:
and get all A records in the "default" view with my EA, by using GetObject on that. This is the current way of getting objects without specifying an EA. |
It returns all A records with the associated EA tag. You just have to pass it to the GetRecordA method, if not it will return all the A records |
Right, I meant it returns all A records with the EA. What I would like is to simply call GetObject with an A/CNAME record that has an EA in its spec (along with other fields), and just get that single object back. That way I don't need to parse through all the returned objects to try and find the one that I wanted. Also, if I wanted to, I could create some generic A record like the one in my last comment, still use GetObject on it, and that would return me multiple A records. That is how I am currently using GetObject, it simply returns any objects that match the constructed object I passed in. |
@chinmayb , have you tried implementing GetRecordA() in a similar fashion as GetNetwork()? i.e. allow GetRecordA() to pass in commonly used search parameters such as netview, name, ipaddr etc, in addition to EA? |
Ideally what I would prefer is to continue using GetObject. It is convenient in that I can construct any record (A or CNAME), with whatever fields I want, and it will return to me any objects (or a single object) that match my passed in record. The enhancement that I'm asking for is to also be able to provide an EA |
@sjberman Yes, that would be the way to do it. I haven't been working on this code for a while, so @chinmayb please see what the implication is. So, basically, what we can do is, instead of doing, for example, the following in the GetNetwork() method:
move that functionality into the GetObject() method. |
For some objects EA field wouldnt be there. I feel why not use SetEaSearch field (which i included in the latest PR) explicitly to set the EAs ? |
Based on the comment #48 (comment), the expectation is to be able to construct an object with the desired search fields, and pass that to GetObject() to perform search accordingly. If EA field is set, the GetObject() method should recognize it and set |
I'm attempting to get a record (either A or CNAME, using GetObject), by specifying an object like this:
The body of the HTTP request that gets constructed looks like this;
However, I'm getting this error:
The extattrs are not searchable. I need them to be, as all of the objects I create will have "My-EA", and at a certain point I'll have a general GetObject call to get all objects that I've created (by using the EA as my search pattern), and nothing more. Is this possible?
The text was updated successfully, but these errors were encountered: