From b95327d07b83dc66a638ce2b9d56868687e94574 Mon Sep 17 00:00:00 2001 From: Nora Date: Mon, 9 Sep 2019 16:06:59 -0700 Subject: [PATCH] Move API calls to manage doc --- .../v2.0/security/secrets/manage-secrets.md | 64 +++++++++++++++++++ content/v2.0/security/secrets/use-vault.md | 4 +- 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 content/v2.0/security/secrets/manage-secrets.md diff --git a/content/v2.0/security/secrets/manage-secrets.md b/content/v2.0/security/secrets/manage-secrets.md new file mode 100644 index 000000000..053f69e45 --- /dev/null +++ b/content/v2.0/security/secrets/manage-secrets.md @@ -0,0 +1,64 @@ +--- +title: Manage secrets +description: Manage secrets in InfluxDB with the API. +v2.0/tags: [secrets, security] +menu: + v2_0: + parent: Store secrets +weight: 201 +--- + + +The following API calls allow you to manage secrets: + + +### Add secrets to an organization + +```sh +curl --request PATCH \ + --url http://localhost:9999/api/v2/orgs//secrets \ + --header 'authorization: Token YOURAUTHTOKEN' \ + --header 'content-type: application/json' \ + --data '{ + "foo": "bar", + "hello": "world" +}' + +# should return 204 no content +``` +### Retrieve an organization's secrets + +```sh +curl --request GET \ + --url http://localhost:9999/api/v2/orgs//secrets \ + --header 'authorization: Token YOURAUTHTOKEN' + +# should return +# { +# "links": { +# "org": "/api/v2/orgs/031c8cbefe101000", +# "secrets": "/api/v2/orgs/031c8cbefe101000/secrets" +# }, +# "secrets": [] +# } +``` + +### Retrieve the added secrets + +```bash +curl --request GET \ + --url http://localhost:9999/api/v2/orgs//secrets \ + --header 'authorization: Token YOURAUTHTOKEN' + +# should return +# { +# "links": { +# "org": "/api/v2/orgs/031c8cbefe101000", +# "secrets": "/api/v2/orgs/031c8cbefe101000/secrets" +# }, +# "secrets": [ +# "foo", +# "hello" +# ] +# } +``` diff --git a/content/v2.0/security/secrets/use-vault.md b/content/v2.0/security/secrets/use-vault.md index 36b42b372..7b6a74b60 100644 --- a/content/v2.0/security/secrets/use-vault.md +++ b/content/v2.0/security/secrets/use-vault.md @@ -1,7 +1,7 @@ --- title: Store secrets in Vault -description: Manage authentication tokens in InfluxDB using the InfluxDB UI or the influx CLI. -v2.0/tags: [tokens, security] +description: Manage secrets in InfluxDB using the InfluxDB UI or the influx CLI. +v2.0/tags: [secrets, security] menu: v2_0: parent: Store secrets