summaryrefslogtreecommitdiffstats
path: root/onap-dcae-cbs-docker-client/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'onap-dcae-cbs-docker-client/README.md')
-rw-r--r--onap-dcae-cbs-docker-client/README.md38
1 files changed, 27 insertions, 11 deletions
diff --git a/onap-dcae-cbs-docker-client/README.md b/onap-dcae-cbs-docker-client/README.md
index 8466e50..5c5c986 100644
--- a/onap-dcae-cbs-docker-client/README.md
+++ b/onap-dcae-cbs-docker-client/README.md
@@ -1,21 +1,30 @@
# Python CBS Docker Client
-Used for DCAE Dockerized microservices written in Python. Pulls your configuration from the config_binding_service. Expects that CONSUL_HOST, HOSTNAME, CONFIG_BINDING_SERVICE are set as env variables, which is true in DCAE.
+Used for DCAE Dockerized microservices written in Python. Pulls your configuration from the Config Binding Service
# Client Usage
-## Development outside of Docker
-To test your raw code without Docker, you will need to set the env variables CONSUL_HOST and HOSTNAME (name of your key to pull from) that are set in DCAEs Docker environment.
-1. `CONSUL_HOST` is the hostname only of the Consul instance you are talking to
-2. `HOSTNAME` is the name of your component in Consul
-3. `CONFIG_BINDING_SERVICE` is the name under which the CBS is registered in Consul
+The environment that this client runs in, whether it be in Docker or "natievely", needs to have the following env variables:
+1. `HOSTNAME` is the name of your component in Consul
+2. `CONFIG_BINDING_SERVICE` a resolvable hostname to the CBS
## Usage in your code
-```
->>> from onap_dcae_cbs_docker_client import client
->>> client.get_config()
->>> client.get_all()
-```
+
+ >>> from onap_dcae_cbs_docker_client import client
+ >>> client.get_config()
+ >>> client.get_all()
+
+
+If the CBS is reachable, but your configuration key is not there, you will get a CantGetConfig exception:
+
+ onap_dcae_cbs_docker_client.exceptions.CantGetConfig
+
+You can access the original HTTP status code and text via the `code` and `text` attributes.
+
+If the CBS is unreachable, you will get an exception:
+
+ onap_dcae_cbs_docker_client.exceptions.CBSUnreachable
+
# Installation
@@ -28,3 +37,10 @@ pip install onap-dcae-cbs-docker-client
```
tox
```
+
+# Version Changes
+When changes are made, the versions to be bumped are in:
+
+1. setup.py
+2. Changelog.md
+3. pom.xml