summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-11-22 15:51:14 +0000
committerGerrit Code Review <review@openstack.org>2016-11-22 15:51:14 +0000
commit5f81231b86991d8c28451cebb4810cdc9ce9dcf2 (patch)
tree9aca86aa62d44f66ea638851ef3e6f163e77374b
parentaa13db6b4a45659ef4ccfa8721a20057bb1de25a (diff)
parent5e9d1900e0c37dd311d55001ec678637e3c82646 (diff)
downloadpython-barbicanclient-5f81231b86991d8c28451cebb4810cdc9ce9dcf2.tar.gz
Merge "Use 'code-block' for pieces of code"
-rw-r--r--doc/source/authentication.rst12
-rw-r--r--doc/source/usage.rst56
2 files changed, 51 insertions, 17 deletions
diff --git a/doc/source/authentication.rst b/doc/source/authentication.rst
index 1032553..3b59dd9 100644
--- a/doc/source/authentication.rst
+++ b/doc/source/authentication.rst
@@ -16,7 +16,9 @@ Keystone API Version 3 Authentication
Authentication using Keystone API Version 3 can be achieved using the
`keystoneauth1.identity.V3Password` auth plugin.
-Example::
+Example:
+
+ .. code-block:: python
from barbicanclient import client
from keystoneauth1 import identity
@@ -37,7 +39,9 @@ Keystone API Version 2 Authentication
Authentication using Keystone API Version 2 can be achieved using the
`keystoneauth1.identity.V2Password` auth plugin.
-Example::
+Example:
+
+ .. code-block:: python
from barbicanclient import client
from keystoneauth1 import identity
@@ -60,7 +64,9 @@ Barbican Service endpoint must be provided, in addition to the Project ID that
will be used for context (i.e. the project that owns the secrets you'll be
working with).
-Example::
+Example:
+
+ .. code-block:: python
from barbicanclient import client
diff --git a/doc/source/usage.rst b/doc/source/usage.rst
index 16a0744..c95cdb9 100644
--- a/doc/source/usage.rst
+++ b/doc/source/usage.rst
@@ -12,7 +12,9 @@ that session to the new Client.
See :doc:`authentication` for more details.
-Example::
+Example:
+
+ .. code-block:: python
from barbicanclient import client
@@ -31,7 +33,9 @@ you should use the different methods of the
:class:`barbicanclient.secrets.SecretManager` class that is exposed as the
`secrets` attribute of the Client.
-Example::
+Example:
+
+ .. code-block:: python
# Store a random text password in Barbican
@@ -57,7 +61,9 @@ The secret reference returned by
:meth:`barbicanclient.secrets.SecretManager.store` can later be used to
retrieve the secret data from barbican.
-Example::
+Example:
+
+ .. code-block:: python
# Retrieve Secret from secret reference
@@ -99,7 +105,9 @@ yourself. Orders should be created using the factory methods in the
:class:`barbicanclient.orders.OrderManager` instance in the `orders` attribute
of the `Client`.
-Example::
+Example:
+
+ .. code-block:: python
# Submit an order to generate a random encryption key
@@ -117,7 +125,9 @@ Example::
The order reference returned by :meth:`barbicanclient.orders.Order.submit` can
later be used to retrieve the order from Barbican.
-Example::
+Example:
+
+ .. code-block:: python
# Retrieve Order from order reference
@@ -127,7 +137,9 @@ Once your order has been processed by Barbican, the order status will be set to
`'ACTIVE'`. An active order will contain the reference to the requested
secret (or container).
-Example::
+Example:
+
+ .. code-block:: python
# Retrieve Encryption Key generated by the above KeyOrder
@@ -149,7 +161,9 @@ Containers should be managed using the
:class:`barbicanclient.containers.ContainerManager` instance in the
`containers` attribute of the `Client`
-Example::
+Example:
+
+ .. code-block:: python
# Add the Secrets created above to a container
@@ -164,7 +178,9 @@ The container reference returned by
:meth:`barbicanclient.containers.Container.store` can later be used to
retrieve the container from Barbican.
-Example::
+Example:
+
+ .. code-block:: python
# Retrieve container from Barbican
@@ -182,7 +198,9 @@ granted based on the roles a user has in that project.
ACLs should be managed using the :class:`barbicanclient.acls.ACLManager`
instance in the `acls` attribute of the `Client`.
-Example::
+Example:
+
+ .. code-block:: python
# Submits ACLs on an existing Secret with URI as 'secret_ref'
@@ -197,7 +215,9 @@ Returned value is instance of either :class:`barbicanclient.acls.SecretACL` or
:class:`barbicanclient.acls.ContainerACL`. Refer to respective class for its
available APIs.
-Example::
+Example:
+
+ .. code-block:: python
# Get ACL entity for a Secret
# Returned entity will be either SecretACL or ContainerACL.
@@ -212,7 +232,9 @@ ACLs setting can also be retrieved directly from secret or container entity.
Its data is lazy loaded i.e. related ACL settings are not read till `acls`
attribute is accessed on secret or container entity.
-Example::
+Example:
+
+ .. code-block:: python
# Get secret entity for a given ref
secret = barbican.secrets.get(secret_ref)
@@ -233,7 +255,9 @@ Example::
If need to add users to existing 'read' ACL settings on a secret or container,
above mentioned get and submit methods can be used.
-Example::
+Example:
+
+ .. code-block:: python
# Every Barbican secret and container has default ACL setting which
# reflects default project access behavior.
@@ -271,7 +295,9 @@ Example::
If need to remove some users from existing ACL settings on a secret or
container, similar approach can be used as mentioned above for `add` example.
-Example::
+Example:
+
+ .. code-block:: python
# provide users to be removed as list.
remove_users = ['user1', 'user2', 'users3']
@@ -319,7 +345,9 @@ If need to unset or delete ACL settings on a secret or container,
:meth:`barbicanclient.acls.SecretACL.remove` or
:meth:`barbicanclient.acls.ContainerACL.remove` can be used.
-Example::
+Example:
+
+ .. code-block:: python
# create ACL entity object with secret or container ref
blank_acl_entity = barbican.acls.create(entity_ref=secret_ref)