From 22bf68bae8244a10b545c0d71aa0ddc9292d879b Mon Sep 17 00:00:00 2001 From: Ryan Selden Date: Fri, 22 Jul 2016 18:45:10 +0000 Subject: [PATCH] Fix deprecated auth options in quickstart As noted in the bug below, the quickstart guide references the deprecated OS_TENANT_NAME option. This patch replaces it with OS_PROJECT_ID and explains how to get said id. Change-Id: I51d5b9c7a8e2e2bcaa540e3d709f2a9e795d5848 Closes-Bug: #1600536 --- api-quick-start/source/api-quick-start.rst | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/api-quick-start/source/api-quick-start.rst b/api-quick-start/source/api-quick-start.rst index 2fdeee9bd..fcb7641a9 100644 --- a/api-quick-start/source/api-quick-start.rst +++ b/api-quick-start/source/api-quick-start.rst @@ -81,7 +81,7 @@ The payload of credentials to authenticate contains these parameters: In a typical OpenStack deployment that runs Identity, you can specify your tenant name, and user name and password credentials to authenticate. -First, export your tenant name to the `OS_TENANT_NAME` environment variable, +First, export your tenant name to the `OS_PROJECT_NAME` environment variable, your user name to the `OS_USERNAME` environment variable, and your password to the `OS_PASSWORD` environment variable. The example below uses a TryStack endpoint but you can also use `$OS_IDENTITYENDPOINT` as an environment variable as needed. @@ -90,9 +90,9 @@ Then, run this cURL command to request a token: .. code-block:: console - $ curl -s -X POST http://128.136.179.2:5000/v2.0/tokens \ + $ curl -s -X POST $OS_AUTH_URL/tokens \ -H "Content-Type: application/json" \ - -d '{"auth": {"tenantName": "'"$OS_TENANT_NAME"'", "passwordCredentials": {"username": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"}}}' \ + -d '{"auth": {"tenantName": "'"$OS_PROJECT_NAME"'", "passwordCredentials": {"username": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"}}}' \ | python -m json.tool If the request succeeds, it returns the ``OK (200)`` response code followed by a @@ -106,7 +106,7 @@ expiration date and time in the form ``"expires":"datetime"``. .. code-block:: console - $ curl -s -X POST http://128.136.179.2:5000/v2.0/tokens \ + $ curl -s -X POST $OS_AUTH_URL/tokens \ -H "Content-Type: application/json" \ -d '{"auth": {"tenantName": "", "passwordCredentials": {"username": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"}}}' \ | python -m json.tool @@ -350,18 +350,19 @@ Export the token ID to the ``OS_TOKEN`` environment variable. For example: The token expires every 24 hours. -Export the tenant name to the ``OS_TENANT_NAME`` environment variable. For example: +Export the tenant name to the ``OS_PROJECT_NAME`` environment variable. For example: .. code-block:: console - export OS_TENANT_NAME=demo + export OS_PROJECT_NAME=demo -Then, use the Compute API to list flavors: +Then, use the Compute API to list flavors, substituting the Compute API endpoint with +one containing your project ID below: .. code-block:: console $ curl -s -H "X-Auth-Token: $OS_TOKEN" \ - http://128.136.179.2:8774/v2/$OS_TENANT_NAME/flavors \ + $OS_COMPUTE_API/flavors \ | python -m json.tool .. code-block:: json @@ -441,12 +442,13 @@ Then, use the Compute API to list flavors: ] } -Use the Compute API to list images: +Export the $OS_PROJECT_ID from the token call, and then +use the Compute API to list images: .. code-block:: console $ curl -s -H "X-Auth-Token: $OS_TOKEN" \ - http://8.21.28.222:8774/v2/$OS_TENANT_NAME/images \ + http://8.21.28.222:8774/v2/$OS_PROJECT_ID/images \ | python -m json.tool .. code-block:: json @@ -551,12 +553,13 @@ Use the Compute API to list images: ] } -Use the Compute API to list servers: +Export the $OS_PROJECT_ID from the token call, and then +use the Compute API to list servers: .. code-block:: console $ curl -s -H "X-Auth-Token: $OS_TOKEN" \ - http://8.21.28.222:8774/v2/$OS_TENANT_NAME/servers \ + http://8.21.28.222:8774/v2/$OS_PROJECT_ID/servers \ | python -m json.tool .. code-block:: json