-
Notifications
You must be signed in to change notification settings - Fork 522
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 resource provider usages API for placement #1861
Conversation
Build succeeded.
|
@jtopjian This is ready for review. |
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.
@dkt26111 Thanks! I have a comment about the Usages
result.
|
||
type ResourceProviderUsage struct { | ||
ResourceProviderGeneration int `json:"resource_provider_generation"` | ||
Usages Usage `json:"usages"` |
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.
I'm thinking this should be map[string]int
?
I don't see any reference to DISK_GB
etc in the placement code and the API docs mention:
The value is a dictionary of resource classes paired with the sum of the allocations of that resource class for this resource provider.
Given it's possible to create arbitrary resource classes, I think the result of Usages
is going to be highly dynamic.
Thoughts?
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.
Sounds good to me. I'll make the change.
Build succeeded.
|
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 - thank you!
Implemented in #1862 |
For #526
Links to the line numbers/files in the OpenStack source code that support the
code in this PR:
API doc:
https://docs.openstack.org/api-ref/placement/#list-resource-provider-usages
API code:
https://github.com/openstack/placement/blob/master/placement/handlers/usage.py#L38