summaryrefslogtreecommitdiffstats
path: root/onap-dcae-cbs-docker-client/README.md
diff options
context:
space:
mode:
authorTommy Carpenter <tommy@research.att.com>2019-06-19 14:54:53 +0000
committerTommy Carpenter <tommy@research.att.com>2019-06-21 14:07:29 -0400
commit6778c62c6f9bfb7f6dc0123f268eb3f4e960b847 (patch)
treeee5403fca9adac71741c1c05ea1817f34f91e567 /onap-dcae-cbs-docker-client/README.md
parent4952f1f70ec234b4a0e053e5bb0cf940d10687e5 (diff)
Move to k8s service names, exceptions
Issue-ID: DCAEGEN2-1537 Change-Id: Ibb7bd0233b5de9eb853f3516ba0907e148eae21d Signed-off-by: Tommy Carpenter <tommy@research.att.com>
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