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

API provider microversion support #739

Closed

Conversation

gonzolino
Copy link
Contributor

This PR adds support to the APIProvider to create and maintain services in certain micro versions. This allows users to specify which micro version they want to use for their service.

It also contains the necessary code to use this with manila. SO users can specify their desired micro version like this:

ShareService shareService = os.share(new MicroVersion(2, 6));

Introduces an interface for services which support micro versions.
This is needed to access functionality like getting/setting the version
of a service by actors like the APIProvider which do not know the exact type of the
service class.
This extension of APIProvider allows to specify the micro version to use
when creating service objects which support micro versions.

This patch also includes changes in OSClient and ShareService (manila), so that users
can specify their desired micro version when using the manila API.
@gondor
Copy link
Member

gondor commented Jul 7, 2016

@gonzolino Thank you! Does change any behaviour to existing core services like Identity, Nova, etc? Would you also be able to provide me with a quick right up on usage so we can document this on OpenStack4j? Or even better your more than welcome to fork the openstack4j.com repo, add the change and submit a PR.

@gonzolino
Copy link
Contributor Author

@gondor At the moment this only affects manila. But it would be possible to add support for micro versions to nova using the mechanisms implemented here and in PR #705. I will have a look at the documentation and explain the usage of this feature there.

@auhlig is currently taking a look at my implementation to see if the creation of Service objects in DefaultAPIProvider can be done in a better way.

Currently objects are created with the default micro version (via newInstance()) and the desired micro version is set afterwards using a setter. In my opinion it would be better to to use the constructor which accepts the micro version as a parameter (getConstructor(MicroVersion.class).newInstance(version)) and remove the setter, but I could't find a way to do it.

So before merging we should wait if @auhlig comes up with a better way to implement this.

@gonzolino gonzolino closed this Apr 4, 2018
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.

2 participants