Repository: jclouds-site Updated Branches: refs/heads/master b558b9577 -> b0c4f8341
Promote the blog post in the home page Project: http://git-wip-us.apache.org/repos/asf/jclouds-site/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds-site/commit/acc37c55 Tree: http://git-wip-us.apache.org/repos/asf/jclouds-site/tree/acc37c55 Diff: http://git-wip-us.apache.org/repos/asf/jclouds-site/diff/acc37c55 Branch: refs/heads/master Commit: acc37c55e92b08c8f90e9da05dddb053451b90ec Parents: 11369d0 Author: Ignasi Barrera <[email protected]> Authored: Tue Jan 16 11:41:05 2018 +0100 Committer: Ignasi Barrera <[email protected]> Committed: Tue Jan 16 11:42:20 2018 +0100 ---------------------------------------------------------------------- _layouts/home.html | 4 ++ _posts/2018-01-11-keystone-v3.md | 84 ----------------------------------- _posts/2018-01-16-keystone-v3.md | 84 +++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 84 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds-site/blob/acc37c55/_layouts/home.html ---------------------------------------------------------------------- diff --git a/_layouts/home.html b/_layouts/home.html index 8183813..b9e6a1b 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -39,6 +39,10 @@ </div> </div> + <div id="keystonev3" class="alert alert-success"> + <p>If you are an OpenStack user, read our <a href="/blog/2018/01/16/keystone-v3/">last blog post</a> about the <strong>OpenStack Keystone V3</strong> integration that will be released in jclouds <strong>2.1.0</strong>!</p> + </div> + <div id="releasenews" class="alert alert-info"> <p>The <a href="/start/install/">latest version</a> is {{ site.latest_version }} released on {{ site.latest_version_date }}! Read the <a href="/releasenotes/{{ site.latest_version }}/">release notes</a>.</p> </div> http://git-wip-us.apache.org/repos/asf/jclouds-site/blob/acc37c55/_posts/2018-01-11-keystone-v3.md ---------------------------------------------------------------------- diff --git a/_posts/2018-01-11-keystone-v3.md b/_posts/2018-01-11-keystone-v3.md deleted file mode 100644 index 4bc1f57..0000000 --- a/_posts/2018-01-11-keystone-v3.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -author: <a href="https://twitter.com/IgnasiBarrera">Ignasi Barrera</a> -comments: true -date: 2018-01-11 07:00:00+00:00 -layout: post -slug: keystone-v3 -title: OpenStack Keystone V3 Support ---- - -In the last few months, the jclouds community has been working hard on adding support for **OpenStack Keystone V3**. This has not been easy, as all the existing OpenStack APIs depend on it and we try hard to keep our APIs backwards-compatible. We wanted a clean solution that allowed users to upgrade with minimal changes required to existing code. - -After lots of work, we're finally there and are very happy to announce that, starting from the upcoming `2.1.0`, jclouds will also support version 3 of the OpenStack Keystone API! -<!--more--> - -No new dependencies will be required to use the OpenStack Keystone V3 API: `openstack-keystone` contains the code for both V2 and V3, so all jclouds providers and APIs can support both versions. - -# Configuring OpenStack services to use Keystone V3 - -Configuring OpenStack services to use Keystone V3 is pretty straightforward. Just create your jclouds [context](/start/concepts/) with the following configuration property: - -{% highlight java %} -Properties overrides = new Properties(); -overrides.put(KeystoneProperties.KEYSTONE_VERSION, "3"); -{% endhighlight %} - -### Configuring authentication - -Keystone V3 supports several authentication mechanisms, which provide authentication tokens with different permissions. It is important to configure the correct authentication method, otherwise some operations offered by the Keystone API might not be available. - -By default, jclouds uses **password authentication with unscoped authorization**. Project or domain authorization scopes can be configured by setting the `KeystoneProperties.SCOPE` property when creating your jclouds context, for example: - -{% highlight java %} -Properties overrides = new Properties(); -// Project scoped authorization (can use the project name or the ID) -overrides.put(KeystoneProperties.SCOPE, "project:jclouds"); -overrides.put(KeystoneProperties.SCOPE, "projectId:2f9b30f706bc45d7923e055567be2e98"); -// Domain scoped authorization (can use the domain name or the ID) -overrides.put(KeystoneProperties.SCOPE, "domain:default"); -overrides.put(KeystoneProperties.SCOPE, "domainId:2f9b30f706bc45d7923e055567be2e98"); -{% endhighlight %} - -Credentials in Keystone V3 must include the `domain` name and the `username`, as shown above. - -# Using Keystone V3 APIs - -If you are using `openstack-nova` or other OpenStack APIs, configuring the properties above will suffice. This section describes changes needed only if you are using the Keystone API **directly**. - -In order to use the `openstack-keystone` API to connect to Keystone V3, use the `openstack-keystone-3` API ID when creating the context. For example: - -{% highlight java %} -KeystoneApi keystone = ContextBuilder.newBuilder("openstack-keystone-3") - .endpoint("http://openstack-keystone/identity/v3") - .credentials("domain:admin", "password") - .overrides(overrides) - .modules(ImmutableSet.of(new SLF4JLoggingModule())) - .buildApi(KeystoneApi.class); -{% endhighlight %} - -### Invoking Keystone API methods that use PATCH operations - -In the Keystone V3 API, most of the update operations are carried out by sending `PATCH` HTTP requests. The `PATCH` verb, however, is not supported by jclouds' default Java HTTP driver. If you plan to use such API methods, you will use an HTTP driver with support for `PATCH`, such as the [OkHttp](https://github.com/jclouds/jclouds/tree/master/drivers/okhttp) or [ApacheHC](https://github.com/jclouds/jclouds/tree/master/drivers/apachehc) drivers. - -To configure an HTTP driver, add the corresponding module to the list of modules passed to the `ContextBuilder` when creating your jclouds context. For example: - -{% highlight java %} -KeystoneApi keystone = ContextBuilder.newBuilder("openstack-keystone-3") - .endpoint("http://openstack-keystone/identity/v3") - .credentials("domain:admin", "password") - .overrides(overrides) - .modules(ImmutableSet.of(new SLF4JLoggingModule(), new OkHttpCommandExecutorServiceModule())) // use OkHttp driver - .buildApi(KeystoneApi.class); -{% endhighlight %} - -# Notes and breaking changes - -Supporting both the V2 and V3 Keystone APIs required a major refactor of the `openstack-keystone` API. Many packages and classes have been renamed, moved and deleted as a result. If your code uses constants or other global classes, you may need to update the following package references: - -* Class `KeystoneProperties` has been moved to `org.jclouds.openstack.keystone.config`. -* Class `CredentialTypes` has been moved to `org.jclouds.openstack.keystone.auth.config`. -* The `KeystoneAuthenticationModule` and the `AuthenticationApiModule` have been refactored and generalised into: - * `AuthenticationModule` - Providing authentication services to all OpenStack APIs and providers. - * `ServiceCatalogModule` - Providing endpoint resolution to all OpenStack APIs and providers. - -Use `AuthenticationModule` and `ServiceCatalogModule` when developing OpenStack APIs. http://git-wip-us.apache.org/repos/asf/jclouds-site/blob/acc37c55/_posts/2018-01-16-keystone-v3.md ---------------------------------------------------------------------- diff --git a/_posts/2018-01-16-keystone-v3.md b/_posts/2018-01-16-keystone-v3.md new file mode 100644 index 0000000..6f19160 --- /dev/null +++ b/_posts/2018-01-16-keystone-v3.md @@ -0,0 +1,84 @@ +--- +author: <a href="https://twitter.com/IgnasiBarrera">Ignasi Barrera</a> +comments: true +date: 2018-01-16 07:00:00+00:00 +layout: post +slug: keystone-v3 +title: OpenStack Keystone V3 Support +--- + +In the last few months, the jclouds community has been working hard on adding support for **OpenStack Keystone V3**. This has not been easy, as all the existing OpenStack APIs depend on it and we try hard to keep our APIs backwards-compatible. We wanted a clean solution that allowed users to upgrade with minimal changes required to existing code. + +After lots of work, we're finally there and are very happy to announce that, starting from the upcoming `2.1.0`, jclouds will also support version 3 of the OpenStack Keystone API! +<!--more--> + +No new dependencies will be required to use the OpenStack Keystone V3 API: `openstack-keystone` contains the code for both V2 and V3, so all jclouds providers and APIs can support both versions. + +# Configuring OpenStack services to use Keystone V3 + +Configuring OpenStack services to use Keystone V3 is pretty straightforward. Just create your jclouds [context](/start/concepts/) with the following configuration property: + +{% highlight java %} +Properties overrides = new Properties(); +overrides.put(KeystoneProperties.KEYSTONE_VERSION, "3"); +{% endhighlight %} + +### Configuring authentication + +Keystone V3 supports several authentication mechanisms, which provide authentication tokens with different permissions. It is important to configure the correct authentication method, otherwise some operations offered by the Keystone API might not be available. + +By default, jclouds uses **password authentication with unscoped authorization**. Project or domain authorization scopes can be configured by setting the `KeystoneProperties.SCOPE` property when creating your jclouds context, for example: + +{% highlight java %} +Properties overrides = new Properties(); +// Project scoped authorization (can use the project name or the ID) +overrides.put(KeystoneProperties.SCOPE, "project:jclouds"); +overrides.put(KeystoneProperties.SCOPE, "projectId:2f9b30f706bc45d7923e055567be2e98"); +// Domain scoped authorization (can use the domain name or the ID) +overrides.put(KeystoneProperties.SCOPE, "domain:default"); +overrides.put(KeystoneProperties.SCOPE, "domainId:2f9b30f706bc45d7923e055567be2e98"); +{% endhighlight %} + +Credentials in Keystone V3 must include the `domain` name and the `username`, as shown above. + +# Using Keystone V3 APIs + +If you are using `openstack-nova` or other OpenStack APIs, configuring the properties above will suffice. This section describes changes needed only if you are using the Keystone API **directly**. + +In order to use the `openstack-keystone` API to connect to Keystone V3, use the `openstack-keystone-3` API ID when creating the context. For example: + +{% highlight java %} +KeystoneApi keystone = ContextBuilder.newBuilder("openstack-keystone-3") + .endpoint("http://openstack-keystone/identity/v3") + .credentials("domain:admin", "password") + .overrides(overrides) + .modules(ImmutableSet.of(new SLF4JLoggingModule())) + .buildApi(KeystoneApi.class); +{% endhighlight %} + +### Invoking Keystone API methods that use PATCH operations + +In the Keystone V3 API, most of the update operations are carried out by sending `PATCH` HTTP requests. The `PATCH` verb, however, is not supported by jclouds' default Java HTTP driver. If you plan to use such API methods, you will use an HTTP driver with support for `PATCH`, such as the [OkHttp](https://github.com/jclouds/jclouds/tree/master/drivers/okhttp) or [ApacheHC](https://github.com/jclouds/jclouds/tree/master/drivers/apachehc) drivers. + +To configure an HTTP driver, add the corresponding module to the list of modules passed to the `ContextBuilder` when creating your jclouds context. For example: + +{% highlight java %} +KeystoneApi keystone = ContextBuilder.newBuilder("openstack-keystone-3") + .endpoint("http://openstack-keystone/identity/v3") + .credentials("domain:admin", "password") + .overrides(overrides) + .modules(ImmutableSet.of(new SLF4JLoggingModule(), new OkHttpCommandExecutorServiceModule())) // use OkHttp driver + .buildApi(KeystoneApi.class); +{% endhighlight %} + +# Notes and breaking changes + +Supporting both the V2 and V3 Keystone APIs required a major refactor of the `openstack-keystone` API. Many packages and classes have been renamed, moved and deleted as a result. If your code uses constants or other global classes, you may need to update the following package references: + +* Class `KeystoneProperties` has been moved to `org.jclouds.openstack.keystone.config`. +* Class `CredentialTypes` has been moved to `org.jclouds.openstack.keystone.auth.config`. +* The `KeystoneAuthenticationModule` and the `AuthenticationApiModule` have been refactored and generalised into: + * `AuthenticationModule` - Providing authentication services to all OpenStack APIs and providers. + * `ServiceCatalogModule` - Providing endpoint resolution to all OpenStack APIs and providers. + +Use `AuthenticationModule` and `ServiceCatalogModule` when developing OpenStack APIs.
