Merge pull request #1229 from influxdata/cli-telegrafs

Add new 'influx telegrafs` commands
pull/1237/head
Scott Anderson 2020-07-22 15:28:47 -06:00 committed by GitHub
commit dc1cf4078a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 178 additions and 0 deletions

View File

@ -0,0 +1,47 @@
---
title: influx telegrafs
description: >
The `influx telegrafs` command lists Telegraf configurations.
Subcommands manage Telegraf configurations.
menu:
v2_0_ref:
name: influx telegrafs
parent: influx
weight: 101
v2.0/tags: [telegraf]
---
The `influx telegrafs` command lists Telegraf configurations.
Subcommands manage Telegraf configurations.
## Usage
```sh
influx telegrafs [flags]
influx telegrafs [command]
```
## Subcommands
| Subcommand | Description |
|:---------- |:----------- |
| [create](/v2.0/reference/cli/influx/telegrafs/create) | Create a Telegraf configuration |
| [rm](/v2.0/reference/cli/influx/telegrafs/rm) | Remove a Telegraf configuration |
| [update](/v2.0/reference/cli/influx/telegrafs/update) | List Telegraf configurations |
## Flags
| Flag | | Description | Input type | {{< cli/mapped >}} |
|:---- |:--- |:----------- |:----------: |:------------------ |
| `-h` | `--help` | Help for the `telegrafs` command | | |
| | `--hide-headers` | Hide table headers | | `INFLUX_HIDE_HEADERS` |
| `-i` | `--id` | Telegraf configuration ID to retrieve | string | |
| | `--json` | Output data as JSON | | `INFLUX_OUTPUT_JSON` |
| `-o` | `--org` | Organization name | string | `INFLUX_ORG` |
| | `--org-id` | Organization ID | string | `INFLUX_ORG_ID` |
## Examples
```sh
# List all known Telegraf configurations
influx telegrafs
# List only a Telegraf configuration with the specified ID
influx telegrafs -i $ID
```

View File

@ -0,0 +1,46 @@
---
title: influx telegrafs create
description: >
The `influx telegrafs create` command creates a new Telegraf configuration in InfluxDB
using a provided Telegraf configuration file.
menu:
v2_0_ref:
name: influx telegrafs create
parent: influx telegrafs
weight: 201
---
The `influx telegrafs create` command creates a new Telegraf configuration in InfluxDB
using a provided Telegraf configuration file.
## Usage
```sh
influx telegrafs create [flags]
```
## Flags
| Flag | | Description | Input type | {{< cli/mapped >}} |
|:---- |:--- |:----------- |:----------: |:------------------ |
| `-d` | `--description` | Telegraf configuration description | string | |
| `-f` | `--file` | Path to Telegraf configuration | string | |
| `-h` | `--help` | Help for the `create` command | | |
| | `--hide-headers` | Hide table headers | | `INFLUX_HIDE_HEADERS` |
| | `--json` | Output data as JSON | | `INFLUX_OUTPUT_JSON` |
| `-n` | `--name` | Telegraf configuration name | string | |
| `-o` | `--org` | Organization name | string | `INFLUX_ORG` |
| | `--org-id` | Organization ID | string | `INFLUX_ORG_ID` |
## Examples
```sh
# Create a new Telegraf configuration
influx telegrafs create \
-n "Example configuration name" \
-d "Example Telegraf configuration description" \
-f /path/to/telegraf.conf
# Create a new Telegraf configuration with configuration settings
# provided via STDIN
cat /path/to/telegraf.conf | influx telegrafs create \
-n "Example configuration name" \
-d "Example Telegraf configuration description" \
```

View File

@ -0,0 +1,37 @@
---
title: influx telegrafs rm
description: >
The `influx telegrafs rm` command removes Telegraf configurations from InfluxDB.
menu:
v2_0_ref:
name: influx telegrafs rm
parent: influx telegrafs
weight: 201
---
The `influx telegrafs rm` command removes Telegraf configurations from InfluxDB.
## Usage
```sh
influx telegrafs rm [flags]
```
#### Aliases
`rm`, `remove`
## Flags
| Flag | | Description | Input type | {{< cli/mapped >}} |
|:---- |:--- |:----------- |:----------: |:------------------ |
| `-h` | `--help` | Help for the `rm` command | | |
| | `--hide-headers` | Hide the table headers | | `$INFLUX_HIDE_HEADERS` |
| `-i` | `--id` | Telegraf configuration ID to remove | strings | |
| | `--json` | Output data as json | | `$INFLUX_OUTPUT_JSON` |
## Examples
```sh
# Remove a single Telegraf configuration
influx telegrafs rm -i $ID
# Remove multiple Telegraf configurations
influx telegrafs rm -i $ID1 -i $ID2
```

View File

@ -0,0 +1,48 @@
---
title: influx telegrafs update
description: >
The `influx telegrafs update` command updates a Telegraf configuration to match the specified parameters.
If a name or description are not provided, they are set to an empty string.
menu:
v2_0_ref:
name: influx telegrafs update
parent: influx telegrafs
weight: 201
---
The `influx telegrafs update` command updates a Telegraf configuration to match the specified parameters.
If a name or description are not provided, they are set to an empty string.
## Usage
```sh
influx telegrafs update [flags]
```
## Flags
| Flag | | Description | Input type | {{< cli/mapped >}} |
|:---- |:--- |:----------- |:----------: |:------------------ |
| `-d` | `--description` | Telegraf configuration description | string | |
| `-f` | `--file` | Path to Telegraf configuration | string | |
| `-h` | `--help` | Help for the `update` command | | |
| | `--hide-headers` | Hide table headers | | `INFLUX_HIDE_HEADERS` |
| | `--json` | Output data as JSON | | `INFLUX_OUTPUT_JSON` |
| `-n` | `--name` | Telegraf configuration name | string | |
| `-o` | `--org` | Organization name | string | `INFLUX_ORG` |
| | `--org-id` | Organization ID | string | `INFLUX_ORG_ID` |
## Examples
```sh
# Update a Telegraf configuration
influx telegrafs update \
-i $ID \
-n "Example configuration name" \
-d "Example Telegraf configuration description" \
-f /path/to/telegraf.conf
# Update a Telegraf configuration with configuration settings
# provided via STDIN
cat /path/to/telegraf.conf | influx telegrafs update \
-i $ID \
-n "Example configuration name" \
-d "Example Telegraf configuration description" \
```