pull/6325/merge
Copilot 2025-11-12 15:14:06 -05:00 committed by GitHub
commit 894ea365d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 30 additions and 12 deletions

View File

@ -496,12 +496,10 @@ influxdb3 create token --admin
{{% /code-tab-content %}} {{% /code-tab-content %}}
{{% code-tab-content %}} {{% code-tab-content %}}
{{% code-placeholders "CONTAINER_NAME" %}} ```bash { placeholders="CONTAINER_NAME" }
```bash
# With Docker — in a new terminal: # With Docker — in a new terminal:
docker exec -it CONTAINER_NAME influxdb3 create token --admin docker exec -it CONTAINER_NAME influxdb3 create token --admin
``` ```
{{% /code-placeholders %}}
Replace {{% code-placeholder-key %}}`CONTAINER_NAME`{{% /code-placeholder-key %}} with the name of your running Docker container. Replace {{% code-placeholder-key %}}`CONTAINER_NAME`{{% /code-placeholder-key %}} with the name of your running Docker container.
@ -537,34 +535,54 @@ In your command, replace {{% code-placeholder-key %}}`YOUR_AUTH_TOKEN`{{% /code-
Set the `INFLUXDB3_AUTH_TOKEN` environment variable to have the CLI use your Set the `INFLUXDB3_AUTH_TOKEN` environment variable to have the CLI use your
token automatically: token automatically:
{{% code-placeholders "YOUR_AUTH_TOKEN" %}} {{< tabs-wrapper >}}
```bash {{% tabs %}}
[macOS and Linux](#)
[PowerShell](#)
[CMD](#)
{{% /tabs %}}
{{% tab-content %}}
```bash { placeholders="YOUR_AUTH_TOKEN" }
export INFLUXDB3_AUTH_TOKEN=YOUR_AUTH_TOKEN export INFLUXDB3_AUTH_TOKEN=YOUR_AUTH_TOKEN
``` ```
{{% /code-placeholders %}}
{{% /tab-content %}}
{{% tab-content %}}
```powershell { placeholders="YOUR_AUTH_TOKEN" }
$env:INFLUXDB3_AUTH_TOKEN = "YOUR_AUTH_TOKEN"
```
{{% /tab-content %}}
{{% tab-content %}}
```cmd { placeholders="YOUR_AUTH_TOKEN" }
set INFLUXDB3_AUTH_TOKEN=YOUR_AUTH_TOKEN
# Make sure to include a space character at the end of this command.
```
{{% /tab-content %}}
{{< /tabs-wrapper >}}
{{% /tab-content %}} {{% /tab-content %}}
{{% tab-content %}} {{% tab-content %}}
Include the `--token` option with CLI commands: Include the `--token` option with CLI commands:
{{% code-placeholders "YOUR_AUTH_TOKEN" %}} ```bash { placeholders="YOUR_AUTH_TOKEN" }
```bash
influxdb3 show databases --token YOUR_AUTH_TOKEN influxdb3 show databases --token YOUR_AUTH_TOKEN
``` ```
{{% /code-placeholders %}}
{{% /tab-content %}} {{% /tab-content %}}
{{< /tabs-wrapper >}} {{< /tabs-wrapper >}}
For HTTP API requests, include your token in the `Authorization` header--for example: For HTTP API requests, include your token in the `Authorization` header--for example:
{{% code-placeholders "YOUR_AUTH_TOKEN" %}} ```bash { placeholders="YOUR_AUTH_TOKEN" }
```bash
curl "http://{{< influxdb/host >}}/api/v3/configure/database" \ curl "http://{{< influxdb/host >}}/api/v3/configure/database" \
--header "Authorization: Bearer YOUR_AUTH_TOKEN" --header "Authorization: Bearer YOUR_AUTH_TOKEN"
``` ```
{{% /code-placeholders %}}
#### Learn more about tokens and permissions #### Learn more about tokens and permissions