-
Notifications
You must be signed in to change notification settings - Fork 4
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
DE24092: exposing volume export count #132
Conversation
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.
Looks good to me. Deferring for approval from Mike and Denis.
Just for the context - Right now BMaaS UI is using the VolumeAttachment (not 100% sure) API to show number of exports for a given volume under volume page (as export count is not available as an attribute in project API response). This works well for the Metal managed volumes but not for imported volumes. Addition of this new attribute will eliminate the usage of VolumeAttachment API to get the number of exports on a volume and will help to show export count in case of imported volumes. |
required: | ||
- ActiveSite | ||
- Capacity | ||
- CapacityUsed | ||
- CreatedSite | ||
- Description | ||
- ExportCount |
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.
why ExportCount is mandatory for unexported volumes?
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.
As this schema is only used for response not any request,
We will get this value (populated or 0 initialized value) from server. I though it was okay to add it as a req field.
Will remove this as required field
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.
If we expect this attribute to always be sent from backend it needs to be marked as required
@@ -55,4 +55,6 @@ type Volume struct { | |||
ActiveSite string `json:"ActiveSite"` | |||
// The site where the volume was originally created. | |||
CreatedSite string `json:"CreatedSite"` | |||
// The number of active exports for this volume | |||
ExportCount int32 `json:"ExportCount"` |
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.
Is there any reason not consistent with naming convention as in portal API model?
https://github.com/hpe-hcss/quake/blob/dd3d55c5afc9a4a7bb76f56daded9e0c3dd135cc/model/volume.go#L170
In portal api models, field name is like this:
json:"export_cnt"
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.
Yes, but as this will be exposed to end-users.
I thought it is better not to name the variable in short form.
let me know if you want me to change it from ExportCount
-> ExportCnt
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.
Hello @harinathakotha, AFAIK the only convention we have for Project API is camel case. Both ExportCount
and ExportCnt
are fine.
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.
LGTM
required: | ||
- ActiveSite | ||
- Capacity | ||
- CapacityUsed | ||
- CreatedSite | ||
- Description | ||
- ExportCount |
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.
If we expect this attribute to always be sent from backend it needs to be marked as required
Description:
ExportCount
under volume schema.Testing: