Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

dkt26111
Copy link
Contributor

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

@coveralls
Copy link

coveralls commented Feb 27, 2020

Coverage Status

Coverage increased (+0.01%) to 77.223% when pulling 0a49e29 on dkt26111:placement_rp_usages into ab34fe0 on gophercloud:master.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Feb 27, 2020

Build succeeded.

@dkt26111
Copy link
Contributor Author

@jtopjian This is ready for review.

Copy link
Contributor

@jtopjian jtopjian left a 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"`
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Feb 28, 2020

Build succeeded.

Copy link
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thank you!

@jtopjian
Copy link
Contributor

Implemented in #1862

@jtopjian jtopjian closed this Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants