-
Notifications
You must be signed in to change notification settings - Fork 510
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
v2: Get by name or ID #2959
Comments
we have that sort of functionality in utils at the moment: https://github.com/gophercloud/utils/blob/master/openstack/compute/v2/servers/utils.go I would not be opposed to having some clever generic replacement for that in the main library. |
@pierreprinetti well, the solution is not that clever, just if something looks like the UUID, it's probably UUID. Comparing to IDsFromName that assumption saves us a call and useless unmarshal. How should we name that sort of functions? |
I would be opposed to adding to Gophercloud a function that accepts a string that can equally be uuid or name. I’d let that guesswork to the caller application |
@pierreprinetti and that guesswork already handled by my apps. Unfortunately i cannot expose my proprietary common code, but that's a pain, when i work with a things i'm allowed to opensource... |
On the other hand, goohercloud/utils was created specifically to host this kind of code 😁 |
Well, i actually tried to drop dependencies on utils... :) But can you please suggest me a name for that kind of functions? |
Pretty often i need similar to python library calls where you get resource by name or ID.
So i think it will be nice to upstream my utility helpers.
Unsure how good it fits gophercloud API though...
A code like that:
(well, i'm not proud of that UUID usage, but that good-enough ad-hoc solution...)
The text was updated successfully, but these errors were encountered: