diff --git a/doc/services/identity/v3/application-credentials.rst b/doc/services/identity/v3/application-credentials.rst index 4fd81e54..dd279983 100644 --- a/doc/services/identity/v3/application-credentials.rst +++ b/doc/services/identity/v3/application-credentials.rst @@ -9,7 +9,7 @@ they have on that project, and then stores the application credential identifier More information can be found in the `official documentation `_. -In order to work with application credentials you have to :doc:`create the service `_ first. +In order to work with application credentials you have to :doc:`create the service ` first. Create ------ diff --git a/doc/services/identity/v3/create.rst b/doc/services/identity/v3/create.rst index 110897e4..b94864db 100644 --- a/doc/services/identity/v3/create.rst +++ b/doc/services/identity/v3/create.rst @@ -1,12 +1,12 @@ Create Service ============== -Service can be created via ``identityV3()`` method of the ``OpenStack`` object: +In order to work with the service you have to :doc:`setup the client ` first. + +Service can be created via ``identityV3()`` method of the ``OpenStack`` object. .. sample:: Identity/v3/create.php A list of additional options can be passed to the method. For example, to change the region: .. sample:: Identity/v3/create_with_region.php - -See :doc:`/setup`_ for list of available authentication options. \ No newline at end of file diff --git a/doc/services/identity/v3/index.rst b/doc/services/identity/v3/index.rst index 1c89b2d7..20106b32 100644 --- a/doc/services/identity/v3/index.rst +++ b/doc/services/identity/v3/index.rst @@ -5,6 +5,11 @@ OpenStack Identity API v3. It is used to manage the `OpenStack Keystone service More information can be found in the `official documentation `_. +.. toctree:: + :maxdepth: 3 + + create + Resources ========= diff --git a/doc/setup.rst b/doc/setup.rst index a1b11135..267b2547 100644 --- a/doc/setup.rst +++ b/doc/setup.rst @@ -32,62 +32,17 @@ Authenticate application credential ID .. sample:: Setup/application_credential_id.php -Generate token from ID -~~~~~~~~~~~~~~~~~~~~~~ +Authenticate from ID +~~~~~~~~~~~~~~~~~~~~ .. sample:: Setup/from_id.php -Generate token scoped to project ID -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Scope to project ID +~~~~~~~~~~~~~~~~~~~ -.. sample:: Identity/v3/tokens/generate_token_scoped_to_project_id.php +.. sample:: Setup/scoped_to_project_id.php -Generate token scoped to project name -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Scope to project name +~~~~~~~~~~~~~~~~~~~~~ -.. sample:: Identity/v3/tokens/generate_token_scoped_to_project_name.php - - -Here is an example of how to create a client with a user id and password: - -.. code-block:: php - - $openstack = new OpenStack\OpenStack([ - 'authUrl' => '{authUrl}', - 'region' => '{region}', - 'user' => [ - 'id' => '{userId}', - 'password' => '{password}' - ], - ]); - -Here is an example of how to create a client with application credentials: - -.. code-block:: php - - $openstack = new OpenStack\OpenStack([ - 'authUrl' => '{authUrl}', - 'region' => '{region}', - 'application_credential' => [ - 'id' => '{applicationCredentialId}', - 'secret' => '{secret}' - ] - ]); - -You can specify the scope of the token: - -.. code-block:: php - - $openstack = new OpenStack\OpenStack([ - 'authUrl' => '{authUrl}', - 'region' => '{region}', - 'user' => [ - 'id' => '{userId}', - 'password' => '{password}' - ], - 'scope' => [ - 'project' => [ - 'id' => '{projectId}' - ], - ], - ]); +.. sample:: Setup/scoped_to_project_name.php \ No newline at end of file diff --git a/samples/Identity/v3/create.php b/samples/Identity/v3/create.php index 90da3ffb..276938ab 100644 --- a/samples/Identity/v3/create.php +++ b/samples/Identity/v3/create.php @@ -11,4 +11,4 @@ ], ]); -$identity = $openstack->identityV3(['region' => '{region}']); \ No newline at end of file +$identity = $openstack->identityV3(); \ No newline at end of file diff --git a/samples/Identity/v3/create_with_region.php b/samples/Identity/v3/create_with_region.php index 276938ab..90da3ffb 100644 --- a/samples/Identity/v3/create_with_region.php +++ b/samples/Identity/v3/create_with_region.php @@ -11,4 +11,4 @@ ], ]); -$identity = $openstack->identityV3(); \ No newline at end of file +$identity = $openstack->identityV3(['region' => '{region}']); \ No newline at end of file diff --git a/samples/Setup/user_id.php b/samples/Setup/user_id.php index 70e7dd64..53948b51 100644 --- a/samples/Setup/user_id.php +++ b/samples/Setup/user_id.php @@ -9,13 +9,4 @@ 'id' => '{userId}', 'password' => '{password}' ] -]); - -$identity = $openstack->identityV3(); - -$token = $identity->generateToken([ - 'user' => [ - 'id' => '{userId}', - 'password' => '{password}' - ] -]); +]); \ No newline at end of file