Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add AdminOrgVdcStorageProfile for querying #375
Add AdminOrgVdcStorageProfile for querying #375
Changes from 2 commits
aae9fed
3b05bd9
da16b28
e917a0e
a709b44
1864309
5e4a541
5857089
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. Now just pardon, but I just tried to play with code and one thing hit me.
I think the signature could be:
That is - you don't need to return a slice of results because you are querying by ID which guarantees that there is either exactly one result, or not.
A slice could be if it was
QueryOrgVdcStorageProfile
which doesn't guarantee one object.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can i then rename this method to
GetAdminOrgVdcStorageProfileByID
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or implement
QueryOrgVdcStorageProfile
with params andGetAdminOrgVdcStorageProfileByID
that use previous?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetX
in this SDK usually mean that it is not an object from query endpoint, but from its legitimate endpoint (e.g.AdminOrg.GetVDCById
would not return aQuery
result, but the VDC struct itself. Query and object endpoints usually return different data that is why we try to keepQuery
andGet
(to differentiate these things). This is not 100% due to historic reasons, but that is a good thing to follow.Or - if you want to implement a function that returns all objects then it could be
QueryAdminOrgVdcStorageProfile
. But if you simply leave the code as it is (and not apply ID filter) you will hit a problem - by default it returns only the first page of data (which is usually up to 25 items). It is not easy to spot this on testing envs where not many resources exist, but we have already hit that and fixed some of the problems here. The trick here is to useclient.cumulativeQuery
internally which handles pagination and makes sure all pages are retrieved. (You could look through functions likeQueryEdgeGatewayList
orQueryAllVdcs
to see how it is implemented.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with you and changed signature.
About
QueryAdminOrgVdcStorageProfile
- i think we need separate issue for discuss.