Influxctl 2.0 (#5082)

* influxctl v2.0.0

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

* Apply suggestions from code review

* updated influxctl examples with code placeholders

* hide influxctl user commands

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>

---------

Co-authored-by: Jason Stirnaman <stirnamanj@gmail.com>
pull/5089/head
Scott Anderson 2023-08-14 15:00:42 -06:00 committed by GitHub
parent ded51cc323
commit 56316fcb6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 955 additions and 194 deletions

View File

@ -27,83 +27,87 @@ you need is in place.
- [Create a database token](#create-a-database-token)
- [Configure authentication credentials](#configure-authentication-credentials)
1. **Request an InfluxDB Cloud Dedicated cluster**.
<span id="request-an-influxdb-cloud-dedicated-cluster"></span>
## Request an InfluxDB Cloud Dedicated cluster
[Contact the InfluxData Sales team]({{< dedicated-link >}}) to request an
InfluxDB Cloud Dedicated cluster.
When your cluster is deployed, your InfluxData account representative provides
the following:
[Contact the InfluxData Sales team]({{< dedicated-link >}}) to request an
InfluxDB Cloud Dedicated cluster.
When your cluster is deployed, your InfluxData account representative provides
the following:
- An **Auth0 login** to authenticate access to your cluster
- Your InfluxDB Cloud Dedicated **account ID**
- Your InfluxDB Cloud Dedicated **cluster ID**
- Your InfluxDB Cloud Dedicated **cluster URL**
2. **Download, install, and configure the influxctl CLI**.
<span id="download-install-and-configure-the-influxctl-cli"></span>
- An **Auth0 login** to authenticate access to your cluster
- Your InfluxDB Cloud Dedicated **account ID**
- Your InfluxDB Cloud Dedicated **cluster ID**
- Your InfluxDB Cloud Dedicated **cluster URL**
## Download, install, and configure the influxctl CLI
The [`influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/)
provides a simple way to manage your InfluxDB Cloud Dedicated cluster from a
command line. It lets you perform administrative tasks such as managing
databases and tokens.
The [`influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/)
provides a simple way to manage your InfluxDB Cloud Dedicated cluster from a
command line. It lets you perform administrative tasks such as managing
databases and tokens.
1. **Download the `influxctl` CLI**.
1. [Download and install the `influxctl` CLI](/influxdb/cloud-dedicated/reference/cli/influxctl/#download-and-install-influxctl).
_Information about downloading and installing the `influxctl` CLI is
provided in your {{% cloud-name %}} welcome email._
2. **Create a connection profile and provide your InfluxDB Cloud Dedicated connection credentials**.
2. **Create a connection profile and provide your InfluxDB Cloud Dedicated connection credentials**.
The `influxctl` CLI uses [connection profiles](/influxdb/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles)
to connect to and authenticate with your InfluxDB Cloud Dedicated cluster.
The `influxctl` CLI uses [connection profiles](/influxdb/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles)
to connect to and authenticate with your InfluxDB Cloud Dedicated cluster.
Create a file named `config.toml` at the following location depending on
your operating system.
To create a connection profile, run `influxctl init` to start an interactive
prompt that creates and stores a connection profile.
```sh
influxctl init
```
Provide the following required credentials:
- Account ID
- Cluster ID
_For more information about `influxctl` profiles, see
[Configure connection profiles](/influxdb/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles)_.
3. **Create a database**.
<span id="create-a-database"></span>
Use the [`influxctl database create` command](/influxdb/cloud-dedicated/reference/cli/influxctl/database/create/)
to create a database. You can use an existing database or create a new one
specifically for this getting started tutorial.
_Examples in this getting started tutorial assume a database named **"get-started"**._
| Operating system | Default profile configuration file path |
| :--------------- | :---------------------------------------------------- |
| Linux | `~/.config/influxctl/config.toml` |
| macOS | `~/Library/Application Support/influxctl/config.toml` |
| Windows | `%APPDATA%\influxctl\config.toml` |
{{% note %}}
#### Authenticate with your cluster
The first time you run an `influxctl` CLI command, you are directed
to login to **Auth0**. Once logged in, Auth0 issues a short-lived (1 hour)
management token for the `influxctl` CLI that grants administrative access
to your InfluxDB Cloud Dedicated cluster.
If stored at a non-default location, include the `--config` flag with each
`influxctl` command and provide the path to your profile configuration file.
{{% /note %}}
Provide the following:
**Copy and paste the sample configuration profile code** into your `config.toml`
and replace the following with your {{< cloud-name >}} credentials:
- Database name.
- _Optional:_ Database [retention period](/influxdb/cloud-dedicated/admin/databases/#retention-periods)
as a duration value. If no retention period is specified, the default is infinite.
{{< code-tabs-wrapper >}}
{{% code-tab-content %}}
<!-- Using tabs-wrapper to preserve indent and prevent code-placeholders and code-callout shortcodes from breaking indent and adding terminating lines -->
- `ACCOUNT_ID`: Your account ID
- `CLUSTER_ID`: Your cluster ID
{{% code-placeholders "ACCOUNT_ID|CLUSTER_ID" %}}
```toml
[[profile]]
name = "default"
product = "dedicated"
account_id = "ACCOUNT_ID"
cluster_id = "CLUSTER_ID"
```
{{% /code-placeholders %}}
_For detailed information about `influxctl` profiles, see
[Configure connection profiles](/influxdb/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles)_.
## Create a database
Use the [`influxctl database create` command](/influxdb/cloud-dedicated/reference/cli/influxctl/database/create/)
to create a database. You can use an existing database or create a new one
specifically for this getting started tutorial.
_Examples in this getting started tutorial assume a database named **"get-started"**._
{{% note %}}
#### Authenticate with your cluster
The first time you run an `influxctl` CLI command, you are directed
to login to **Auth0**. Once logged in, Auth0 issues a short-lived (1 hour)
management token for the `influxctl` CLI that grants administrative access
to your InfluxDB Cloud Dedicated cluster.
{{% /note %}}
Provide the following:
- Database name.
- _Optional:_ Database [retention period](/influxdb/cloud-dedicated/admin/databases/#retention-periods)
as a duration value. If no retention period is specified, the default is infinite.
{{% code-placeholders "get-started|1y" %}}
```sh
@ -111,25 +115,17 @@ influxctl database create --retention-period 1y get-started
```
{{% /code-placeholders %}}
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
## Create a database token
Use the [`influxctl token create` command](/influxdb/cloud-dedicated/reference/cli/influxctl/token/create/)
to create a database token with read and write permissions for your database.
4. **Create a database token**. <span id="create-a-database-token"></span>
Provide the following:
Use the [`influxctl token create` command](/influxdb/cloud-dedicated/reference/cli/influxctl/token/create/)
to create a database token with read and write permissions for your database.
Provide the following:
- Permission grants
- `--read-database`: Grants read access to a database
- `--write-database` Grants write access to a database
- Token description
{{< code-tabs-wrapper >}}
{{% code-tab-content %}}
<!-- Using tabs-wrapper to preserve indent and prevent code-placeholders and code-callout shortcodes from breaking indent and adding terminating lines -->
- Permission grants
- `--read-database`: Grants read access to a database
- `--write-database` Grants write access to a database
- Token description
{{% code-placeholders "get-started" %}}
```sh
@ -140,29 +136,26 @@ influxctl token create \
```
{{% /code-placeholders %}}
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
The command returns the token ID and the token string.
Store the token string in a safe place.
You'll need it later.
**This is the only time the token string is available in plain text.**
The command returns the token ID and the token string.
Store the token string in a safe place.
You'll need it later.
**This is the only time the token string is available in plain text.**
{{% note %}}
{{% note %}}
#### Store secure tokens in a secret store
Token strings are returned _only_ on token creation.
We recommend storing database tokens in a **secure secret store**.
For example, see how to [authenticate Telegraf using tokens in your OS secret store](https://github.com/influxdata/telegraf/tree/master/plugins/secretstores/os).
{{% /note %}}
{{% /note %}}
5. **Configure authentication credentials**.
<span id="configure-authentication-credentials"></span>
## Configure authentication credentials
Code samples in later sections assume you assigned the token string to an
`INFLUX_TOKEN` environment variable--for example:
Code samples in later sections assume you assigned the token string to an
`INFLUX_TOKEN` environment variable--for example:
{{< tabs-wrapper >}}
{{< tabs-wrapper >}}
{{% tabs %}}
[MacOS and Linux](#)
[PowerShell](#)
@ -189,7 +182,6 @@ $env:INFLUX_TOKEN = "DATABASE_TOKEN"
```
{{% /code-placeholders %}}
<!-- END POWERSHELL -->
{{% /tab-content %}}
{{% tab-content %}}
@ -204,8 +196,8 @@ set INFLUX_TOKEN=DATABASE_TOKEN
<!-- END CMD -->
{{% /tab-content %}}
{{< /tabs-wrapper >}}
{{< /tabs-wrapper >}}
Replace `DATABASE_TOKEN` with your [database token](#create-a-database-token) string.
Replace `DATABASE_TOKEN` with your [database token](#create-a-database-token) string.
{{< page-nav prev="/influxdb/cloud-dedicated/get-started/" next="/influxdb/cloud-dedicated/get-started/write/" keepTab=true >}}

View File

@ -32,24 +32,216 @@ influxctl [flags] [command]
| Command | Description |
| :---------------------------------------------------------------------- | :------------------------------------- |
| [database](/influxdb/cloud-dedicated/reference/cli/influxctl/database/) | Manage InfluxDB databases |
| [token](/influxdb/cloud-dedicated/reference/cli/influxctl/token/) | Manage InfluxDB database tokens |
| [cluster](/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/) | List InfluxDB v3 cluster information |
| [database](/influxdb/cloud-dedicated/reference/cli/influxctl/database/) | Manage InfluxDB v3 databases |
| [token](/influxdb/cloud-dedicated/reference/cli/influxctl/token/) | Manage InfluxDB v3 database tokens |
| [version](/influxdb/cloud-dedicated/reference/cli/influxctl/version/) | Output the current `influxctl` version |
| [help](/influxdb/cloud-dedicated/reference/cli/influxctl/help/) | Output `influxctl` help information |
<!-- | [user](/influxdb/cloud-dedicated/reference/cli/influxctl/user/) | Manage InfluxDB v3 cluster users | -->
## Global flags
| Flag | Description |
| :---------- | :--------------------------------------------------------- |
| `--debug` | Enable debug logging |
| `--profile` | Specify a connection profile to use (default is `default`) |
| Flag | | Description |
| :--- | :---------- | :--------------------------------------------------------- |
| | `--debug` | Enable debug logging |
| | `--account` | Override account ID value in configuration file |
| | `--cluster` | Override cluster ID value in configuration file |
| | `--config` | Path to configuration file to use |
| | `--profile` | Specify a connection profile to use (default is `default`) |
| `-h` | `--help` | Show help |
---
## Download and install influxctl
_[Contact InfluxData Support](https://support.influxdata.com) for
information about downloading and installing the `influxctl` CLI._
{{< tabs-wrapper >}}
{{% tabs %}}
[macOS](#)
[Linux](#)
[Windows](#)
{{% /tabs %}}
<!---------------------------- BEGIN MACOS CONTENT ---------------------------->
{{% tab-content %}}
1. **Download the `influxctl` CLI package** appropriate for your CPU type.
Download the package from your browser or command line.
##### Browser {#macos-browser-download}
<a class="btn download" href="https://dl.influxdata.com/influxctl/releases/influxctl-v{{< latest-influxctl >}}-darwin-x86_64.zip" download>influxctl CLI v{{< latest-influxctl >}} (x86_64)</a>
<a class="btn download" href="https://dl.influxdata.com/influxctl/releases/influxctl-v{{< latest-influxctl >}}-darwin-arm64.zip" download>influxctl CLI v{{< latest-influxctl >}} (arm64)</a>
##### Command line {#macos-command-line-download}
```sh
# x86_64
curl -Oo ~/Downloads/ https://dl.influxdata.com/influxctl/releases/influxctl-v{{< latest-influxctl >}}-darwin-x86_64.zip
# arm64
curl -Oo ~/Downloads/ https://dl.influxdata.com/influxctl/releases/influxctl-v{{< latest-influxctl >}}-darwin-arm64.zip
```
2. **Unpackage the downloaded package**.
Do one of the following:
- In **Finder**, double-click the downloaded package file.
- From the command line, run the following command appropriate for your CPU type:
```sh
# x86_64
unzip ~/Downloads/influxctl-v{{< latest-influxctl >}}-darwin-x86_64.zip
# arm64
unzip ~/Downloads/influxctl-v{{< latest-influxctl >}}-darwin-arm64.zip
```
3. **_(Optional)_ Place the binary in your `$PATH`**.
```sh
# x86_64
sudo cp ~/Downloads/influxctl-v{{< latest-influxctl >}}-darwin-x86_64/influxctl /usr/local/bin/
# arm64
sudo cp ~/Downloads/influxctl-v{{< latest-influxctl >}}-darwin-arm64/influxctl /usr/local/bin/
```
4. [Create a connection profile](#configure-connection-profiles) that stores
connection credentials for your cluster.
{{% /tab-content %}}
<!----------------------------- END MACOS CONTENT ----------------------------->
<!---------------------------- BEGIN LINUX CONTENT ---------------------------->
{{% tab-content %}}
To download the Linux `influxctl` package, do one of the following:
- [Use a package manager](#use-a-package-manager)
- [Manually download the package](#manually-download-the-package)
### Use a package manager
{{< code-tabs-wrapper >}}
{{% code-tabs %}}
[Ubuntu & Debian (.deb)](#)
[Red Hat & CentOS (.rpm)](#)
{{% /code-tabs %}}
{{% code-tab-content %}}
```sh
# influxdata-archive_compat.key GPG fingerprint:
# 9D53 9D90 D332 8DC7 D6C8 D3B9 D8FF 8E1F 7DF8 B07E
wget -q https://repos.influxdata.com/influxdata-archive_compat.key
echo '393e8779c89ac8d958f81f942f9ad7fb82a25e133faddaf92e15b16e6ac9ce4c influxdata-archive_compat.key' | sha256sum -c && cat influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
sudo apt-get update && sudo apt-get install influxctl
```
{{% /code-tab-content %}}
{{% code-tab-content %}}
```sh
# influxdata-archive_compat.key GPG fingerprint:
# 9D53 9D90 D332 8DC7 D6C8 D3B9 D8FF 8E1F 7DF8 B07E
cat <<EOF | sudo tee /etc/yum.repos.d/influxdata.repo
[influxdata]
name = InfluxData Repository - Stable
baseurl = https://repos.influxdata.com/stable/\$basearch/main
enabled = 1
gpgcheck = 1
gpgkey = https://repos.influxdata.com/influxdata-archive_compat.key
EOF
sudo yum install influxctl
```
{{% /code-tab-content %}}
{{< /code-tabs-wrapper >}}
### Manually download the package
1. **Download the `influxctl` CLI package** appropriate for your CPU type.
Download the package from your browser or command line.
##### Browser {#linux-browser-download}
<a class="btn download" href="https://dl.influxdata.com/influxctl/releases/influxctl-v{{< latest-influxctl >}}-linux-x86_64.tar.gz" download>influxctl CLI v{{< latest-influxctl >}} (x86_64)</a>
<a class="btn download" href="https://dl.influxdata.com/influxctl/releases/influxctl-v{{< latest-influxctl >}}-linux-arm64.tar.gz" download>influxctl CLI v{{< latest-influxctl >}} (arm64)</a>
##### Command line {#linux-command-line-download}
```sh
# amd64
curl -O https://dl.influxdata.com/influxctl/releases/influxctl-v{{< latest-influxctl >}}-linux-x86_64.tar.gz
# arm64
curl -O https://dl.influxdata.com/influxctl/releases/influxctl-v{{< latest-influxctl >}}-linux-arm64.tar.gz
```
2. **Unpackage the downloaded package**.
```sh
# amd64
tar zxvf influxctl-v{{< latest-influxctl >}}-linux-x86_64.tar.gz
# arm64
tar zxvf influxctl-v{{< latest-influxctl >}}-linux-arm64.tar.gz
```
3. **_(Optional)_ Place the binary in your `$PATH`**.
```sh
# amd64
sudo cp influxctl-v{{< latest-influxctl >}}-darwin-x86_64/influxctl /usr/local/bin/
# arm64
sudo cp influxctl-v{{< latest-influxctl >}}-darwin-arm64/influxctl /usr/local/bin/
```
4. [Create a connection profile](#configure-connection-profiles) that stores
connection credentials for your cluster.
{{% /tab-content %}}
<!----------------------------- END LINUX CONTENT ----------------------------->
<!--------------------------- BEGIN WINDOWS CONTENT --------------------------->
{{% tab-content %}}
1. **Download the `influxctl` CLI package**.
<a class="btn download" href="https://dl.influxdata.com/influxctl/releases/influxctl-v{{< latest-influxctl >}}-windows-x86_64.zip" download>influxctl CLI v{{< latest-influxctl >}} (x86_64)</a>
2. **Expand the downloaded archive**.
Expand the downloaded archive into C:\Program Files\InfluxData\ and rename it if desired.
```powershell
Expand-Archive .\influxctl-v{{< latest-influxctl >}}-windows-x86_64.zip `
-DestinationPath 'C:\Program Files\InfluxData\'
mv 'C:\Program Files\InfluxData\influxctl-v{{< latest-influxctl >}}-windows-x86_64' `
'C:\Program Files\InfluxData\influxctl'
```
3. **Grant network access to the influx CLI**.
When using the `influxctl` CLI for the first time, Windows Defender displays
the following message:
> Windows Defender Firewall has blocked some features of this app.
To grant the `influxctl` CLI the required access, do the following:
Select **Private networks, such as my home or work network**.
Click **Allow access**.
4. [Create a connection profile](#configure-connection-profiles) that stores
connection credentials for your cluster.
{{% /tab-content %}}
<!---------------------------- END WINDOWS CONTENT ---------------------------->
{{< /tabs-wrapper >}}
---
## Configure connection profiles
@ -59,22 +251,83 @@ following credentials:
- InfluxDB Cloud Dedicated account ID
- InfluxDB Cloud Dedicated cluster ID
Use the [`influxctl init` command](/influxdb/cloud-dedicated/reference/cli/influxctl/init)
to start an interactive prompt that creates and stores the required credentials
as a **connection profile**.
### Create a configuration file
Create a `config.toml` that includes the necessary credentials.
If stored at the [default location](#default-connection-profile-store-location)
for your operating system, `influxctl` automatically detects and uses the connection
profile configurations.
If stored at a non-default location, include the `--config` flag with each
`influxctl` command and provide the path to your profile configuration file.
{{< expand-wrapper >}}
{{% expand "View sample `config.toml`" %}}
{{% code-placeholders "(PROFILE|ACCOUNT|CLUSTER)_(NAME|ID)" %}}
```toml
## influxctl - example configuration
[[profile]]
## Profile name
## Users can define multiple profile sections and reference them via the
## `--profile {name}` global option. By default, the profile named
## "default" is loaded and used.
name = "PROFILE_NAME"
## Product type
## Choose from "clustered" or "dedicated"
product = "dedicated"
### Clustered Specific Options ###
## Account ID and cluster ID
account_id = "ACCOUNT_ID"
cluster_id = "CLUSTER_ID"
### Dedicated Specific Options ###
## Host and port
## The hostname/IP address and port to connect to the dedicated instance
# host = ""
# port = ""
## Custom client-side TLS certs
## By default, the system certificates are used. If a custom certificate
## for connecting to InfluxDB is required, define it below.
# [profile.tls]
# cert = ""
# key = ""
# ca = ""
## OAuth2 client authorization settings
# [profile.auth.oauth2]
# client_id = ""
# client_secret = ""
# scopes = [""]
# parameters = { audience = "" }
# token_url = "https://indentityprovider/oauth2/v1/token"
# device_url = "https://indentityprovider/oauth2/v1/auth/device"
```sh
influxctl init
```
{{% /code-placeholders %}}
### Connection profile store location
Replace the following values in the sample:
The `influxctl` CLI stores connection profiles in a `config.toml` file at a specific
location based on your operating system:
- {{% code-placeholder-key %}}`PROFILE_NAME`{{% /code-placeholder-key %}}:
Use `default` for your default connection profile or a custom name for a
non-default profile.
- {{% code-placeholder-key %}}`ACCOUNT_ID`{{% /code-placeholder-key %}}:
InfluxDB Cloud Dedicated account ID
- {{% code-placeholder-key %}}`CLUSTER_ID`{{% /code-placeholder-key %}}:
InfluxDB Cloud Dedicated cluster ID
#### Profile configuration file locations
{{% /expand %}}
{{< /expand-wrapper >}}
| Operating system | Profile configuration path |
#### Default connection profile store location
The `influxctl` CLI checks for connection profiles in a `config.toml` file at a
default location based on your operating system:
| Operating system | Default profile configuration file path |
| :--------------- | :---------------------------------------------------- |
| Linux | `~/.config/influxctl/config.toml` |
| macOS | `~/Library/Application Support/influxctl/config.toml` |

View File

@ -0,0 +1,33 @@
---
title: influxctl cluster
description: >
The `influxctl cluster` command and its subcommands provide information about
InfluxDB Cloud Dedicated clusters.
menu:
influxdb_cloud_dedicated:
parent: influxctl
weight: 201
---
The `influxctl cluster` command and its subcommands provide information about
{{< cloud-name >}} clusters.
## Usage
```sh
influxctl cluster [subcommand] [subcommand options] [arguments...]
```
## Subcommands
| Subcommand | Description |
| :---------------------------------------------------------------------- | :------------------------------ |
| [get](/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/get/) | Get information about a cluster |
| [list](/influxdb/cloud-dedicated/reference/cli/influxctl/cluster/list/) | List all clusters |
| help, h | Output command help |
## Flags
| Flag | | Description |
| :--- | :------- | :------------------ |
| `-h` | `--help` | Output command help |

View File

@ -0,0 +1,44 @@
---
title: influxctl cluster get
description: >
The `influxctl cluster get` command returns information about an InfluxDB
Cloud Dedicated cluster.
menu:
influxdb_cloud_dedicated:
parent: influxctl cluster
weight: 301
---
The `influxctl cluster get` command returns information about an InfluxDB
Cloud Dedicated cluster.
The `--format` option lets you print the output in other formats.
By default, the 'table' format is used, but the 'json' format is
available for programmatic parsing by other tooling.
## Usage
```sh
influxctl cluster get <CLUSTER_ID>
```
## Arguments
| Argument | Description |
| :------------- | :----------------------- |
| **CLUSTER_ID** | ID of the cluster to get |
## Flags
| Flag | | Description |
| :--- | :--------- | :-------------------------------------------- |
| | `--format` | Output format (`table` _(default)_ or `json`) |
| `-h` | `--help` | Output command help |
## Examples
##### Return information about a cluster
```sh
influxctl cluster get 000xX0Xx-00xX-XXx0-x00X-00xxX0xXX00x
```

View File

@ -0,0 +1,30 @@
---
title: influxctl cluster list
description: >
The `influxctl cluster list` command information about all InfluxDB
Cloud Dedicated clusters associated with your account ID.
menu:
influxdb_cloud_dedicated:
parent: influxctl cluster
weight: 301
---
The `influxctl cluster list` command returns information about all InfluxDB
Cloud Dedicated clusters associated with your account ID.
The `--format` option lets you print the output in other formats.
By default, the 'table' format is used, but the 'json' format is
available for programmatic parsing by other tooling.
## Usage
```sh
influxctl cluster list
```
## Flags
| Flag | | Description |
| :--- | :--------- | :-------------------------------------------- |
| | `--format` | Output format (`table` _(default)_ or `json`) |
| `-h` | `--help` | Output command help |

View File

@ -20,11 +20,13 @@ influxctl database [subcommand] [flags]
## Subcommands
| Subcommand | Description |
| :--------------------------------------------------------------------------- | :---------------- |
| [create](/influxdb/cloud-dedicated/reference/cli/influxctl/database/create/) | Create a database |
| [list](/influxdb/cloud-dedicated/reference/cli/influxctl/database/list/) | List databases |
| [delete](/influxdb/cloud-dedicated/reference/cli/influxctl/database/delete/) | Delete a database |
| Subcommand | Description |
| :--------------------------------------------------------------------------- | :------------------ |
| [create](/influxdb/cloud-dedicated/reference/cli/influxctl/database/create/) | Create a database |
| [delete](/influxdb/cloud-dedicated/reference/cli/influxctl/database/delete/) | Delete a database |
| [list](/influxdb/cloud-dedicated/reference/cli/influxctl/database/list/) | List databases |
| [update](/influxdb/cloud-dedicated/reference/cli/influxctl/database/list/) | Update a database |
| help, h | Output command help |
## Flags

View File

@ -61,26 +61,38 @@ influxctl database create [--retention-period 0s] <DATABASE_NAME>
## Flags
| Flag | | Description |
| :--- | :------------------- | :---------------------------------------------------- |
| `-h` | `--help` | Output command help |
| | `--retention-period` | Database retention period (default is 0s or infinite) |
| Flag | | Description |
| :--- | :------------------- | :----------------------------------------------------------- |
| | `--retention-period` | Database retention period (default is 0s or infinite) |
| | `--max-tables` | Maximum tables per database (default is 500, 0 uses default) |
| | `--max-columns` | Maximum columns per table (default is 250, 0 uses default) |
| `-h` | `--help` | Output command help |
## Examples
- [Create a database with an infinite retention period](#create-a-database-with-an-infinite-retention-period)
- [Create a database with a 30 day retention period](#create-a-database-with-a-30-day-retention-period)
- [Create a database with a 30-day retention period](#create-a-database-with-a-30-day-retention-period)
- [Create a database with non-default table and column limits](#create-a-database-with-non-default-table-and-column-limits)
##### Create a database with an infinite retention period
### Create a database with an infinite retention period
```sh
influxctl database create mydb
```
##### Create a database with a 30 day retention period
### Create a database with a 30-day retention period
```sh
influxctl database create \
--retention-period 30d \
mydb
```
```
### Create a database with non-default table and column limits
```sh
influxctl database create \
--max-tables 200 \
--max-columns 150 \
mydb
```

View File

@ -6,7 +6,7 @@ description: >
menu:
influxdb_cloud_dedicated:
parent: influxctl database
weight: 302
weight: 301
---
The `influxctl database delete` command deletes a database from an InfluxDB
@ -15,7 +15,7 @@ Cloud Dedicated cluster.
## Usage
```sh
influxctl database delete <DATABASE_NAME>
influxctl database delete [command options] [--force] <DATABASE_NAME> [<DATABASE_NAME_N>...]
```
{{% warn %}}
@ -37,9 +37,10 @@ when creating a new database.
## Flags
| Flag | | Description |
| :--- | :------- | :------------------ |
| `-h` | `--help` | Output command help |
| Flag | | Description |
| :--- | :-------- | :---------------------------------------------------------- |
| | `--force` | Do not prompt for confirmation to delete (default is false) |
| `-h` | `--help` | Output command help |
## Examples
@ -47,4 +48,10 @@ when creating a new database.
```sh
influxctl database delete mydb
```
```
##### Delete multiple databases
```sh
influxctl database delete mydb1 mydb2
```

View File

@ -12,6 +12,10 @@ weight: 301
The `influxctl database list` command lists all databases in an InfluxDB Cloud
Dedicated cluster.
The `--format` option lets you print the output in other formats.
By default, the 'table' format is used, but the 'json' format is
available for programmatic parsing by other tooling.
## Usage
```sh
@ -20,7 +24,7 @@ influxctl database list [--format=table|json]
## Flags
| Flag | | Description |
| :--- | :--------- | :---------------------------------------------------- |
| | `--format` | Output format (`table` or `json`, default is `table`) |
| `-h` | `--help` | Output command help |
| Flag | | Description |
| :--- | :--------- | :-------------------------------------------- |
| | `--format` | Output format (`table` _(default)_ or `json`) |
| `-h` | `--help` | Output command help |

View File

@ -0,0 +1,86 @@
---
title: influxctl database update
description: >
The `influxctl database update` command updates a database's retention period,
tables, or columns.
menu:
influxdb_cloud_dedicated:
parent: influxctl database
weight: 301
---
The `influxctl database update` command updates a database's retention period,
table (measurement), or column limits in InfluxDB.
## Usage
```sh
influxctl database update <DATABASE_NAME> [flags]
```
## Arguments
| Argument | Description |
| :---------------- | :----------------------------- |
| **DATABASE_NAME** | Name of the database to update |
## Flags
| Flag | | Description |
| :--- | :------------------- | :----------------------------------------------------------- |
| | `--retention-period` | Database retention period (default is 0s or infinite) |
| | `--max-tables` | Maximum tables per database (default is 500, 0 uses default) |
| | `--max-columns` | Maximum columns per table (default is 250, 0 uses default) |
| `-h` | `--help` | Output command help |
## Examples
- [Update a database's retention period](#update-a-databases-retention-period)
- [Update a database's table limit](#update-a-databases-table-limit)
- [Update a database's column limit](#update-a-databases-column-limit)
### Update a database's retention period
```sh
influxctl database update mydb --retention-period 1mo
```
{{< flex >}}
{{% flex-content %}}
##### Valid durations units
- `m`: minute
- `h`: hour
- `d`: day
- `w`: week
- `mo`: month
- `y`: year
{{% /flex-content %}}
{{% flex-content %}}
##### Example retention period values
- `0d`: infinite/none
- `3d`: 3 days
- `6w`: 6 weeks
- `1mo`: 1 month (30 days)
- `1y`: 1 year
- `30d30d`: 60 days
- `2.5d`: 60 hours
{{% /flex-content %}}
{{< /flex >}}
### Update a database's table limit
```sh
influxctl database update mydb --max-tables 300
```
### Update a database's column limit
```sh
influxctl database update mydb --max-columns 200
```

View File

@ -1,25 +0,0 @@
---
title: influxctl init
description: >
The `influxctl init` command starts an interactive prompt to set up a
connection profile.
menu:
influxdb_cloud_dedicated:
parent: influxctl
weight: 202
---
The `influxctl init` command starts an interactive prompt to set up a
[connection profile](/influxdb/cloud-dedicated/reference/cli/influxctl/#configure-connection-profiles).
Provide the following for each profile:
- Profile name
- Account ID
- Cluster ID
## Usage
```sh
influxctl init
```

View File

@ -20,11 +20,14 @@ influxctl token [subcommand] [flags]
## Subcommands
| Subcommand | Description |
| :------------------------------------------------------------------------ | :---------------------- |
| [create](/influxdb/cloud-dedicated/reference/cli/influxctl/token/create/) | Create a database token |
| [list](/influxdb/cloud-dedicated/reference/cli/influxctl/token/list/) | List database tokens |
| [delete](/influxdb/cloud-dedicated/reference/cli/influxctl/token/delete/) | Delete a database token |
| Subcommand | Description |
| :------------------------------------------------------------------------ | :---------------------------- |
| [create](/influxdb/cloud-dedicated/reference/cli/influxctl/token/create/) | Create a database token |
| [delete](/influxdb/cloud-dedicated/reference/cli/influxctl/token/delete/) | Delete a database token |
| [get](/influxdb/cloud-dedicated/reference/cli/influxctl/token/get/) | Get information about a token |
| [list](/influxdb/cloud-dedicated/reference/cli/influxctl/token/list/) | List database tokens |
| [update](/influxdb/cloud-dedicated/reference/cli/influxctl/token/update/) | Update a database token |
| help, h | Output command help |
## Flags

View File

@ -37,11 +37,11 @@ influxctl token create \
## Flags
| Flag | | Description |
| :--- | :----------------- | :------------------------------------ |
| `-h` | `--help` | Output command help |
| | `--read-database` | Grant read permissions to a database. Repeatable. |
| | `--write-database` | Grant write permissions to a database. Repeatable. |
| Flag | | Description |
| :--- | :----------------- | :------------------------------------------------- |
| | `--read-database` | Grant read permissions to a database _(Repeatable)_ |
| | `--write-database` | Grant write permissions to a database _(Repeatable)_ |
| `-h` | `--help` | Output command help |
## Examples
@ -50,7 +50,13 @@ influxctl token create \
- [Create a token with read-only access to multiple databases](#create-a-token-with-read-only-access-to-multiple-databases)
- [Create a token with mixed permissions to multiple databases](#create-a-token-with-mixed-permissions-on-multiple-databases)
##### Create a token with read and write access to a database
In the examples below, replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% cloud-name %}} database name
- {{% code-placeholder-key %}}`DATABASE2_NAME`{{% /code-placeholder-key %}}: your second {{% cloud-name %}} database name
- {{% code-placeholder-key %}}`TOKEN_ID`{{% /code-placeholder-key %}}: token ID to update
### Create a token with read and write access to a database
{{% code-placeholders "DATABASE_NAME" %}}
```sh
@ -61,11 +67,7 @@ influxctl token create \
```
{{% /code-placeholders %}}
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% cloud-name %}} database
##### Create a token with read-only access to a database
### Create a token with read-only access to a database
{{% code-placeholders "DATABASE_NAME" %}}
```sh
@ -75,7 +77,7 @@ influxctl token create \
```
{{% /code-placeholders %}}
##### Create a token with read-only access to multiple databases
### Create a token with read-only access to multiple databases
{{% code-placeholders "DATABASE_NAME|DATABASE2_NAME" %}}
```sh
@ -86,12 +88,7 @@ influxctl token create \
```
{{% /code-placeholders %}}
Replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% cloud-name %}} database
- {{% code-placeholder-key %}}`DATABASE2_NAME`{{% /code-placeholder-key %}}: your {{% cloud-name %}} database
##### Create a token with mixed permissions to multiple databases
### Create a token with mixed permissions to multiple databases
{{% code-placeholders "DATABASE_NAME|DATABASE2_NAME" %}}
```sh

View File

@ -6,7 +6,7 @@ description: >
menu:
influxdb_cloud_dedicated:
parent: influxctl token
weight: 302
weight: 301
---
The `influxctl token delete` command deletes a database token from an InfluxDB
@ -15,7 +15,7 @@ Cloud Dedicated cluster and revokes all permissions associated with the token.
## Usage
```sh
influxctl token delete <TOKEN_ID>
influxctl token delete <TOKEN_ID> [<TOKEN_ID_N>...]
```
{{% warn %}}
@ -39,12 +39,32 @@ Cloud Dedicated cluster.
## Flags
| Flag | | Description |
| :--- | :------- | :------------------ |
| `-h` | `--help` | Output command help |
| Flag | | Description |
| :--- | :-------- | :---------------------------------------------------------- |
| | `--force` | Do not prompt for confirmation to delete (default is false) |
| `-h` | `--help` | Output command help |
## Examples
- [Delete a database token](#delete-a-database-token)
- [Delete multiple database tokens](#delete-multiple-database-tokens)
In the examples below, replace the following:
- {{% code-placeholder-key %}}`TOKEN_ID`{{% /code-placeholder-key %}}: token ID to delete
### Delete a database token
{{% code-placeholders "TOKEN_ID" %}}
```sh
influxctl token delete 000xX0Xx00xX
influxctl token delete TOKEN_ID
```
{{% /code-placeholders %}}
### Delete multiple database tokens
{{% code-placeholders "TOKEN_ID_\d{1}" %}}
```sh
influxctl token delete TOKEN_ID_1 TOKEN_ID_2
```
{{% /code-placeholders %}}

View File

@ -0,0 +1,42 @@
---
title: influxctl token get
description: >
The `influxctl token get` command returns information about a database token
in an InfluxDB Cloud Dedicated cluster.
menu:
influxdb_cloud_dedicated:
parent: influxctl token
weight: 301
---
The `influxctl token get` command returns information about a database token
in an InfluxDB Cloud Dedicated cluster.
The `--format` option lets you print the output in other formats.
By default, the 'table' format is used, but the 'json' format is
available for programmatic parsing by other tooling.
## Usage
```sh
influxctl token get [command options] <TOKEN_ID>
```
## Flags
| Flag | | Description |
| :--- | :--------- | :-------------------------------------------- |
| | `--format` | Output format (`table` _(default)_ or `json`) |
| `-h` | `--help` | Output command help |
## Examples
{{% code-placeholders "TOKEN_ID" %}}
```sh
influxctl token get TOKEN_ID
```
{{% /code-placeholders %}}
Replace the following:
- {{% code-placeholder-key %}}`TOKEN_ID`{{% /code-placeholder-key %}}: token ID to delete

View File

@ -12,6 +12,10 @@ weight: 301
The `influxctl token list` command lists all database tokens in an InfluxDB Cloud
Dedicated cluster.
The `--format` option lets you print the output in other formats.
By default, the 'table' format is used, but the 'json' format is
available for programmatic parsing by other tooling.
## Usage
```sh
@ -20,7 +24,7 @@ influxctl token list [--format=table|json]
## Flags
| Flag | | Description |
| :--- | :--------- | :---------------------------------------------------- |
| | `--format` | Output format (`table` or `json`, default is `table`) |
| `-h` | `--help` | Output command help |
| Flag | | Description |
| :--- | :--------- | :-------------------------------------------- |
| | `--format` | Output format (`table` _(default)_ or `json`) |
| `-h` | `--help` | Output command help |

View File

@ -0,0 +1,90 @@
---
title: influxctl token update
description: >
The `influxctl token update` command updates a database token with specified
permissions to resources in an InfluxDB Cloud Dedicated cluster.
menu:
influxdb_cloud_dedicated:
parent: influxctl token
weight: 301
---
The `influxctl token update` command updates a database token with specified
permissions to resources in an InfluxDB Cloud Dedicated cluster.
## Usage
```sh
influxctl token update \
[--read-database=<DATABASE_NAME>] \
[--write-database=<DATABASE_NAME>] \
<TOKEN_ID>
```
{{% note %}}
#### Existing permissions are replaced on update
When updating token permissions, the existing permissions are replaced by the
new permissions specified in the update command.
To retain existing permissions, include them in the update command.
{{% /note %}}
## Arguments
| Argument | Description |
| :----------- | :-------------------------- |
| **TOKEN_ID** | Database token ID to update |
## Flags
| Flag | | Description |
| :--- | :----------------- | :--------------------------------------------------- |
| | `--read-database` | Grant read permissions to a database _(Repeatable)_ |
| | `--write-database` | Grant write permissions to a database _(Repeatable)_ |
| `-h` | `--help` | Output command help |
## Examples
- [Update a token's permissions](#update-a-tokens-permissions)
- [Update a token with read-only access to multiple databases](#update-a-token-with-read-only-access-to-multiple-databases)
- [Update a token with mixed permissions to multiple databases](#update-a-token-with-mixed-permissions-to-multiple-databases)
In the examples below, replace the following:
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: your {{% cloud-name %}} database
- {{% code-placeholder-key %}}`DATABASE2_NAME`{{% /code-placeholder-key %}}: your {{% cloud-name %}} database
- {{% code-placeholder-key %}}`TOKEN_ID`{{% /code-placeholder-key %}}: token ID to update
### Update a token's permissions
{{% code-placeholders "DATABASE_NAME|TOKEN_ID" %}}
```sh
influxctl token update \
--read-database DATABASE_NAME \
--write-database DATABASE_NAME \
TOKEN_ID
```
{{% /code-placeholders %}}
### Update a token with read-only access to multiple databases
{{% code-placeholders "DATABASE_NAME|DATABASE2_NAME|TOKEN_ID" %}}
```sh
influxctl token update \
--read-database DATABASE_NAME \
--read-database DATABASE2_NAME \
TOKEN_ID
```
{{% /code-placeholders %}}
### Update a token with mixed permissions to multiple databases
{{% code-placeholders "DATABASE_NAME|DATABASE2_NAME|TOKEN_ID" %}}
```sh
influxctl token update \
--read-database DATABASE_NAME \
--read-database DATABASE2_NAME \
--write-database DATABASE2_NAME \
TOKEN_ID
```
{{% /code-placeholders %}}

View File

@ -0,0 +1,36 @@
---
title: influxctl user
description: >
The `influxctl user` command and its subcommands manage users in InfluxDB
Cloud Dedicated clusters.
menu:
influxdb_cloud_dedicated:
parent: influxctl
weight: 201
cascade:
draft: true
---
The `influxctl user` command and its subcommands manage users in
{{< cloud-name >}} clusters.
## Usage
```sh
influxctl user [subcommand] [subcommand options] [arguments...]
```
## Subcommands
| Subcommand | Description |
| :----------------------------------------------------------------------- | :------------------ |
| [delete](/influxdb/cloud-dedicated/reference/cli/influxctl/user/delete/) | Delete a user |
| [invite](/influxdb/cloud-dedicated/reference/cli/influxctl/user/invite/) | Invite a user |
| [list](/influxdb/cloud-dedicated/reference/cli/influxctl/user/list/) | List all users |
| help, h | Output command help |
## Flags
| Flag | | Description |
| :--- | :------- | :------------------ |
| `-h` | `--help` | Output command help |

View File

@ -0,0 +1,49 @@
---
title: influxctl user delete
description: >
The `influxctl user delete` command deletes a user from your InfluxDB Cloud Dedicated account.
menu:
influxdb_cloud_dedicated:
parent: influxctl user
weight: 301
---
The `influxctl user delete` command deletes a user from your {{< cloud-name >}}
account.
## Usage
```sh
influxctl user delete <USER_ID>
```
{{% warn %}}
#### Deleting a user is immediate and cannot be undone
Deleting a user is a destructive action that takes place immediately
and cannot be undone.
{{% /warn %}}
## Arguments
| Argument | Description |
| :---------- | :---------------- |
| **USER_ID** | User ID to delete |
## Flags
| Flag | | Description |
| :--- | :------- | :------------------ |
| `-h` | `--help` | Output command help |
## Examples
{{% code-placeholders "USER_ID" %}}
```sh
influxctl user delete USER_ID
```
{{% /code-placeholders %}}
Replace the following:
- {{% code-placeholder-key %}}`USER_ID`{{% /code-placeholder-key %}}: user ID to delete

View File

@ -0,0 +1,50 @@
---
title: influxctl user invite
description: >
The `influxctl user invite` command invites a user to your InfluxDB Cloud Dedicated
account.
menu:
influxdb_cloud_dedicated:
parent: influxctl user
weight: 301
---
The `influxctl user invite` command invites a user to your {{< cloud-name >}}
account.
## Usage
```sh
influxctl user invite [command options] <FIRST_NAME> <LAST_NAME> <EMAIL>
```
## Arguments
| Argument | Description |
| :------------- | :------------------- |
| **FIRST_NAME** | User's first name |
| **LAST_NAME** | User's last name |
| **EMAIL** | User's email address |
## Flags
| Flag | | Description |
| :--- | :------- | :------------------ |
| `-h` | `--help` | Output command help |
## Examples
{{% code-placeholders "(FIRST|LAST)_NAME|EMAIL" %}}
```sh
influxctl user invite FIRST_NAME LAST_NAME EMAIL
```
{{% /code-placeholders %}}
Replace the following:
- {{% code-placeholder-key %}}`FIRST_NAME`{{% /code-placeholder-key %}}:
User's first name
- {{% code-placeholder-key %}}`LAST_NAME`{{% /code-placeholder-key %}}:
User's last name
- {{% code-placeholder-key %}}`EMAIL`{{% /code-placeholder-key %}}:
User's email address

View File

@ -0,0 +1,30 @@
---
title: influxctl user list
description: >
The `influxctl user list` command lists all users associated with your InfluxDB
Cloud Dedicated account ID.
menu:
influxdb_cloud_dedicated:
parent: influxctl user
weight: 301
---
The `influxctl user list` command lists all users associated with your InfluxDB
Cloud Dedicated account ID.
The `--format` option lets you print the output in other formats.
By default, the 'table' format is used, but the 'json' format is
available for programmatic parsing by other tooling.
## Usage
```sh
influxctl user list [command options]
```
## Flags
| Flag | | Description |
| :--- | :--------- | :-------------------------------------------- |
| | `--format` | Output format (`table` _(default)_ or `json`) |
| `-h` | `--help` | Output command help |

View File

@ -71,6 +71,7 @@ influxdb_cloud_dedicated:
list_order: 3
latest: cloud-dedicated
link: "https://www.influxdata.com/contact-sales-form/"
latest_cli: 2.0.0
telegraf:
name: Telegraf

View File

@ -3,4 +3,4 @@
{{- $elReplace := print "<div class='code-placeholder-wrapper'><var title='Edit $0' class='code-placeholder " $color "' data-code-var='$0' data-code-var-value='$0'>$0<span class='code-placeholder-edit-icon cf-icon Pencil'></span></var></div>" -}}
{{- $code := .Inner | markdownify -}}
{{- $codeCallout := replaceRE $regex $elReplace $code -}}
{{ $codeCallout | safeHTML }}
{{ $codeCallout | safeHTML }}

View File

@ -0,0 +1 @@
{{ $.Site.Data.products.influxdb_cloud_dedicated.latest_cli }}