summaryrefslogtreecommitdiffstats
path: root/onap-dcae-cbs-docker-client/example
diff options
context:
space:
mode:
authorTommy Carpenter <tommy@research.att.com>2019-06-24 15:52:59 +0000
committerTommy Carpenter <tommy@research.att.com>2019-06-24 17:22:59 +0000
commit1474cbb0aec7a0636d4d53ad09eba501d9c75458 (patch)
treeb24ac03546c2ddf352b29a4ac4a60363a808edbf /onap-dcae-cbs-docker-client/example
parent6778c62c6f9bfb7f6dc0123f268eb3f4e960b847 (diff)
Add CBS https/tls support
Issue-ID: DCAEGEN2-1551 Change-Id: I657d13ec87e051bd4836bd4c42385a580eaebe01 Signed-off-by: Tommy Carpenter <tommy@research.att.com>
Diffstat (limited to 'onap-dcae-cbs-docker-client/example')
-rw-r--r--onap-dcae-cbs-docker-client/example/README.md21
-rw-r--r--onap-dcae-cbs-docker-client/example/testclient.py5
2 files changed, 26 insertions, 0 deletions
diff --git a/onap-dcae-cbs-docker-client/example/README.md b/onap-dcae-cbs-docker-client/example/README.md
new file mode 100644
index 0000000..64f1b71
--- /dev/null
+++ b/onap-dcae-cbs-docker-client/example/README.md
@@ -0,0 +1,21 @@
+# Example
+Shows example usage
+
+(`set -x` is fish's notation for bash's `export`)
+
+## No https
+Example:
+
+ set -x HOSTNAME <<yourhostname>>; set -x CONFIG_BINDING_SERVICE <<cbshost>>; python testclient.py
+
+## Https
+The value of the environment variable `DCAE_CA_CERTPATH` must be a path to a cacert file to verify the running CBS.
+The following excerpt is from the curl manpage:
+
+ --cacert <file>
+ (TLS) Tells curl to use the specified certificate file to verify the peer.
+ The file may contain multiple CA certificates.
+
+Example:
+
+ set -x HOSTNAME <<yourhostname>>; set -x CONFIG_BINDING_SERVICE <<cbshost>>; set -x DCAE_CA_CERTPATH /opt/onapcacert.pem; python testclient.py
diff --git a/onap-dcae-cbs-docker-client/example/testclient.py b/onap-dcae-cbs-docker-client/example/testclient.py
new file mode 100644
index 0000000..91eb7a2
--- /dev/null
+++ b/onap-dcae-cbs-docker-client/example/testclient.py
@@ -0,0 +1,5 @@
+from onap_dcae_cbs_docker_client import client
+
+client.get_config()
+
+client.get_all()