Expose generalized configuration API

This exposes a generalized configuration API base on dividing the
configuration space up into subsystems.  Within a given subsystem,
the configuration is read/written in one json blob.

This also does some slight tweaks to the logging subsystem based on this
new API structure.
This commit is contained in:
Daniel Hiltgen 2015-11-23 15:33:38 -08:00 committed by Joao Fernandes
parent f460e1c390
commit 2f3f331c5f
1 changed files with 10 additions and 10 deletions

View File

@ -1,17 +1,18 @@
# Remote logging configuration # Remote logging configuration
To setup remote logging in Orca you must edit the KV store directly. To setup remote logging in Orca you must edit the API directly.
You'll need to run explicit curl commands described below. This You'll need to run explicit curl commands described below. This
assumes you've already set up your environment per the [KV Store assumes you've already set up your environment with a downloaded
instructions](kv_store.md) bundle.
## Display the current settings ## Display the current settings
```sh ```sh
export ORCA_URL="https://$(echo $DOCKER_HOST | cut -f3 -d/ )"
curl -s \ curl -s \
--cert ${DOCKER_CERT_PATH}/cert.pem \ --cert ${DOCKER_CERT_PATH}/cert.pem \
--key ${DOCKER_CERT_PATH}/key.pem \ --key ${DOCKER_CERT_PATH}/key.pem \
--cacert ${DOCKER_CERT_PATH}/ca.pem \ --cacert ${DOCKER_CERT_PATH}/ca.pem \
${KV_URL}/v2/keys/orca/v1/config/logging | jq "." ${ORCA_URL}/api/config/logging | jq "."
``` ```
## Setup remote logging ## Setup remote logging
@ -20,22 +21,21 @@ curl -s \
--cert ${DOCKER_CERT_PATH}/cert.pem \ --cert ${DOCKER_CERT_PATH}/cert.pem \
--key ${DOCKER_CERT_PATH}/key.pem \ --key ${DOCKER_CERT_PATH}/key.pem \
--cacert ${DOCKER_CERT_PATH}/ca.pem \ --cacert ${DOCKER_CERT_PATH}/ca.pem \
-XPUT -d value='{"host":"mylogger:514","protocol":"tcp","level":"INFO"}' \ -XPOST -d '{"host":"mylogger:514","protocol":"tcp","level":"INFO"}' \
${KV_URL}/v2/keys/orca/v1/config/logging | jq "." ${ORCA_URL}/api/config/logging | jq "."
``` ```
## Stopping remote logging ## Stopping remote logging
If you're simply changing the target, use the "set" example above with a new host. If you no longer want to send logging If you set the host to an empty string, remote logging will be disabled.
to any remote syslogger, use the following:
```sh ```sh
curl -s \ curl -s \
--cert ${DOCKER_CERT_PATH}/cert.pem \ --cert ${DOCKER_CERT_PATH}/cert.pem \
--key ${DOCKER_CERT_PATH}/key.pem \ --key ${DOCKER_CERT_PATH}/key.pem \
--cacert ${DOCKER_CERT_PATH}/ca.pem \ --cacert ${DOCKER_CERT_PATH}/ca.pem \
-XDELETE ${KV_URL}/v2/keys/orca/v1/config/logging | jq "." -XPOST -d '{"host":"","level":"DEBUG"}' \
${ORCA_URL}/api/config/logging | jq "."
``` ```
# Setting up an ELK stack # Setting up an ELK stack