diff --git a/content/v2.0/reference/cli/influx/apply/_index.md b/content/v2.0/reference/cli/influx/apply/_index.md index 2d35e4d7f..1ac0e76cc 100644 --- a/content/v2.0/reference/cli/influx/apply/_index.md +++ b/content/v2.0/reference/cli/influx/apply/_index.md @@ -30,7 +30,8 @@ influx apply [flags] | | `--disable-table-borders` | Disable table borders | | | | `-e` | `--encoding` | Encoding of the input stream | string | | | | `--env-ref` | Environment references to provide with the template (format: `--env-ref=REF_KEY=REF_VALUE`) | string | | -| `-f` | `--file` | Path to template file | string | | +| `-f` | `--file` | Path to template file (supports HTTP(S) URLs or file paths) | string | | +| | `--filter` | Resources to skip when applying the template (filter by `kind` or `resource`) | string | | | | `--force` | Ignore warnings about destructive changes | | | | `-h` | `--help` | Help for the `apply` command | | | | | `--json` | Output data as JSON | | `INFLUX_OUTPUT_JSON` | @@ -40,7 +41,6 @@ influx apply [flags] | `-R` | `--recurse` | Recurse through files in the directory specified in `-f`, `--file` | | | | | `--secret` | Secrets to provide with the template (format: `--secret=SECRET_KEY=SECRET_VALUE`) | string | | | | `--stack-id` | Stack ID to associate when applying the template | string | | -| `-u` | `--template-url` | URL of template file | string | | {{% cli/influx-global-flags %}} @@ -49,6 +49,9 @@ influx apply [flags] # Apply a template from a file. influx apply -f path/to/template.json +# Apply a template from a URL. +influx apply -f https://raw.githubusercontent.com/influxdata/community-templates/master/docker/docker.yml + # Apply a stack that has associated templates. influx apply --stack-id $STACK_ID @@ -61,9 +64,6 @@ influx apply \ -f path/to/template_1.json \ -f path/to/template_2.yml -# Apply a template from a URL. -influx apply -u https://raw.githubusercontent.com/influxdata/community-templates/master/docker/docker.yml - # Apply a template from STDIN. cat template.json | influx apply --encoding json @@ -78,4 +78,16 @@ influx apply \ -f path/to/template.yml -f path/to/templates_directory -u https://example.com/template.json + +# Apply a template, but skip resources. The following example skips all buckets +# and the dashboard whose metadata.name field matches "example-dashboard". + +# Filter format: +# --filter=kind=Bucket +# --filter=resource=Label:$Label_TMPL_NAME + +influx apply \ + -f path/to/template.yml \ + --filter kind=Bucket \ + --filter resource=Dashboard:example-dashboard ``` diff --git a/content/v2.0/reference/cli/influx/config/_index.md b/content/v2.0/reference/cli/influx/config/_index.md index 474f8ed56..eb3bab994 100644 --- a/content/v2.0/reference/cli/influx/config/_index.md +++ b/content/v2.0/reference/cli/influx/config/_index.md @@ -9,8 +9,8 @@ weight: 101 v2.0/tags: [config] --- -The `influx config` command manages multiple InfluxDB connection configurations -file (by default, stored at `~/.influxdbv2/configs`). +The `influx config` command displays the active InfluxDB connection configuration +and manages multiple connection configurations stored, by default, in `~/.influxdbv2/configs`. Each connection includes a URL, token, associated organization, and active setting. InfluxDB reads the token from the active connection configuration, so you don't have to manually enter a token to log into InfluxDB. @@ -19,6 +19,7 @@ have to manually enter a token to log into InfluxDB. ``` influx config [flags] influx config [command] +influx config ``` ##### Quickly switch between configurations @@ -36,6 +37,15 @@ To quickly switch back to the previous configuration, use the following command: influx config - ``` +## Examples +```sh +# Show the active connection configuration +influx config + +# Set a connection configuration as active +influx config local-config +``` + ## Subcommands | Subcommand | Description | |:---- |:----------- | diff --git a/content/v2.0/reference/cli/influx/config/create.md b/content/v2.0/reference/cli/influx/config/create.md index 236a5d4cf..17e12861f 100644 --- a/content/v2.0/reference/cli/influx/config/create.md +++ b/content/v2.0/reference/cli/influx/config/create.md @@ -28,3 +28,20 @@ influx config create [flags] | `-u` | `--url` | (**Required**) Connection URL for the new configuration. | string | | {{% cli/influx-global-flags %}} + +## Examples +```sh +# Create a connection configuration and set it active +influx config create --active \ + -n config-name \ + -u http://localhost:9999 \ + -t mySuP3rS3cr3tT0keN \ + -o example-org + +# Create a connection configuration without setting it active +influx config create \ + -n config-name \ + -u http://localhost:9999 \ + -t mySuP3rS3cr3tT0keN \ + -o example-org +``` diff --git a/content/v2.0/reference/cli/influx/config/delete.md b/content/v2.0/reference/cli/influx/config/rm.md similarity index 62% rename from content/v2.0/reference/cli/influx/config/delete.md rename to content/v2.0/reference/cli/influx/config/rm.md index 3252ec54c..b8ac7d50b 100644 --- a/content/v2.0/reference/cli/influx/config/delete.md +++ b/content/v2.0/reference/cli/influx/config/rm.md @@ -1,27 +1,41 @@ --- -title: influx config delete -description: The 'influx config delete' command deletes an InfluxDB connection configuration. +title: influx config rm +description: The 'influx config rm' command removes an InfluxDB connection configuration. menu: v2_0_ref: - name: influx config delete + name: influx config rm parent: influx config weight: 201 +aliases: + - /v2.0/reference/cli/influx/config/delete/ --- -The `influx config delete` command deletes an InfluxDB connection configuration +The `influx config rm` command removes an InfluxDB connection configuration from the `configs` file (by default, stored at `~/.influxdbv2/configs`). ## Usage ``` -influx config delete [flags] +influx config rm [flags] ``` +#### Aliases +`rm`, `remove`, `delete` + + ## Flags | Flag | | Description | Input type | {{< cli/mapped >}} | |:---- |:--- |:----------- |:----------: |:------------------ | | `-h` | `--help` | Help for the `delete` command | | | | | `--hide-headers` | Hide table headers (default `false`) | | `INFLUX_HIDE_HEADERS` | | | `--json` | Output data as JSON (default `false`) | | `INFLUX_OUTPUT_JSON` | -| `-n` | `--name` | (**Required**) Name of InfluxDB connection configuration to delete | string | | {{% cli/influx-global-flags %}} + +## Examples +```sh +# Delete a connection configuration +influx config rm local-config + +# Delete multiple connection configurations +influx config rm config-1 config-2 +``` diff --git a/content/v2.0/reference/cli/influx/config/set.md b/content/v2.0/reference/cli/influx/config/set.md index c4ec715f8..2089d06bc 100644 --- a/content/v2.0/reference/cli/influx/config/set.md +++ b/content/v2.0/reference/cli/influx/config/set.md @@ -20,14 +20,29 @@ influx config set [flags] `set` , `update` ## Flags -| Flag | | Description | Input type | {{< cli/mapped >}} | -|:---- |:--- |:----------- |:----------: |:------------------ | -| `-a` | --active` | Set the specified connection to active | | | -| `-h` | --help` | Help for the `set` command | | | -| | `--hide-headers` | Hide table headers (default `false`) | | `INFLUX_HIDE_HEADERS` | -| | `--json` | Output data as JSON (default `false`) | | `INFLUX_OUTPUT_JSON` | -| `-n` | --name` | Name for the InfluxDB connection configuration to set or update | string | | -| `-o` | `--org` | Organization name for the connection configuration | string | | -| `-u` | --url` | (**Required**) URL for InfluxDB connection configuration to set or update | string | | +| Flag | | Description | Input type | {{< cli/mapped >}} | +|:---- |:--- |:----------- |:----------: |:------------------ | +| `-a` | --active` | Set the specified connection to active | | | +| `-h` | --help` | Help for the `set` command | | | +| | `--hide-headers` | Hide table headers (default `false`) | | `INFLUX_HIDE_HEADERS` | +| | `--json` | Output data as JSON (default `false`) | | `INFLUX_OUTPUT_JSON` | +| `-n` | --name` | Name for the InfluxDB connection configuration to set or update | string | | +| `-o` | `--org` | Organization name for the connection configuration | string | | +| `-u` | --url` | URL for InfluxDB connection configuration to set or update | string | | {{% cli/influx-global-flags %}} + +## Examples +```sh +# Update a connection configuration and set it to active +influx config set --active \ + -n config-name \ + -t mySuP3rS3cr3tT0keN \ + -o example-org + +# Update a connection configuration and do not set it to active +influx config set \ + -n config-name \ + -t mySuP3rS3cr3tT0keN \ + -o example-org +``` diff --git a/content/v2.0/reference/cli/influx/template/_index.md b/content/v2.0/reference/cli/influx/template/_index.md index 20b13f840..64287b63c 100644 --- a/content/v2.0/reference/cli/influx/template/_index.md +++ b/content/v2.0/reference/cli/influx/template/_index.md @@ -30,10 +30,9 @@ influx template [command] | `-c` | `--disable-color` | Disable color in output | | | | | `--disable-table-borders` | Disable table borders | | | | `-e` | `--encoding` | Encoding of the input stream | string | | -| `-f` | `--file` | Template file to summarize | string | | +| `-f` | `--file` | Path to template file (supports HTTP(S) URLs or file paths) | string | | | `-h` | `--help` | Help for the `template` command | | | | | `--json` | Output data as JSON (default `false`) | | `INFLUX_OUTPUT_JSON` | | `-R` | `--recurse` | Recurse through files in the directory specified in `-f`, `--file` | | | -| `-u` | `--template-url` | URL of template file to summarize | string | | {{% cli/influx-global-flags %}} diff --git a/content/v2.0/reference/cli/influx/template/validate.md b/content/v2.0/reference/cli/influx/template/validate.md index 18b40c46b..15f9d48ab 100644 --- a/content/v2.0/reference/cli/influx/template/validate.md +++ b/content/v2.0/reference/cli/influx/template/validate.md @@ -22,7 +22,7 @@ influx template validate [flags] | Flag | | Description | Input Type | |:---- |:--- |:----------- |:---------- | | `-e` | `--encoding` | Encoding of the input stream | string | -| `-f` | `--file` | Template file to validate | string | +| `-f` | `--file` | Path to template file (supports HTTP(S) URLs or file paths) | string | | `-h` | `--help` | Help for the `validate` command | | | `-R` | `--recurse` | Recurse through files in the directory specified in `-f`, `--file` | | | `-u` | `--template-url` | URL of template file to validate | string | diff --git a/layouts/shortcodes/cli/influx-global-flags.md b/layouts/shortcodes/cli/influx-global-flags.md index 67d852cbf..1d5288352 100644 --- a/layouts/shortcodes/cli/influx-global-flags.md +++ b/layouts/shortcodes/cli/influx-global-flags.md @@ -3,9 +3,8 @@ ## Global Flags -| Flag | | Description | Input type | Maps to ? | -|:---- |:--- |:----------- |:----------:|:---------------------------------------------------- | -| | `--host` | HTTP address of InfluxDB (default `http://localhost:9999`) | string | `INFLUX_HOST` | -| | `--local` | Run commands against the local filesystem | | | -| | `--skip-verify` | Skip certificate verification (use when connecting over TLS with a self-signed certificate) | | | -| `-t` | `--token` | API token to use in client calls | string | `INFLUX_TOKEN` | +| Flag | | Description | Input type | Maps to ? | +|:---- |:--- |:----------- |:----------:|:---------------------------------------------------- | +| | `--host` | HTTP address of InfluxDB (default `http://localhost:9999`) | string | `INFLUX_HOST` | +| | `--skip-verify` | Skip TLS certificate verification | | | +| `-t` | `--token` | API token to use in client calls | string | `INFLUX_TOKEN` |