tree: fdb809d71f4482706c947bef81abd660e417a092 [path history] [tgz]
  1. cbs_docker_client/
  2. .gitignore
  3. MANIFEST.in
  4. pom.xml
  5. README.md
  6. requirements.txt
  7. setup.py
python-cbs-docker-client/README.md

Python CBS Docker Client

Used for DCAE Dockerized microservices written in Python. Pulls your configuration from the config_binding_service. Expects that CONSUL_HOST and HOSTNAME are set as env variables, which is true in DCAE.

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 enviornment.

  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

Usage in your code

>>> from cbs_docker_client import client
>>> client.get_config()

Installation

Via pip

pip install --extra-index-url https://YOUR_NEXUS_PYPI_SERVER/simple cbs-docker-client

Via requirements.txt

Add the following to your requirements.txt file

--extra-index-url https://YOUR_NEXUS_PYPI_SERVER/simple
cbs-docker-client==0.0.1