You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace {{% code-placeholder-key %}}`CONTAINER_NAME`{{% /code-placeholder-key %}} with the name of your running Docker container.
309
+
310
+
{{% /code-tab-content %}}
311
+
312
+
{{< /code-tabs-wrapper >}}
293
313
294
314
The command returns a token string that you can use to authenticate CLI commands and API requests.
295
315
@@ -316,6 +336,7 @@ To create a database token, use the `influxdb3 create token` subcommand and pass
316
336
The following example shows how to create a database token that expires in 90 days and has read and write permissions for all databases on the server:
317
337
318
338
{{% code-placeholders "ADMIN_TOKEN" %}}
339
+
319
340
```bash
320
341
influxdb3 create token \
321
342
--permission \
@@ -327,8 +348,7 @@ influxdb3 create token \
327
348
```
328
349
{{% /code-placeholders %}}
329
350
330
-
In your command, replace {{% code-placeholder-key %}} `ADMIN_TOKEN`{{% /code-placeholder-key %}}
331
-
with the admin token you created earlier.
351
+
In your command, replace {{% code-placeholder-key %}} `ADMIN_TOKEN`{{% /code-placeholder-key %}} with the admin token you created earlier.
332
352
333
353
#### Create a system token
334
354
@@ -355,6 +375,8 @@ To create a system token, use the `influxdb3 create token` subcommand and pass t
355
375
356
376
The following example shows how to create a system token that expires in 1 year and has read permissions for all system endpoints on the server:
357
377
378
+
{{% code-placeholders "ADMIN_TOKEN" %}}
379
+
358
380
```bash
359
381
influxdb3 create token \
360
382
--permission \
@@ -364,6 +386,9 @@ influxdb3 create token \
364
386
--name "all system endpoints" \
365
387
"system:*:read"
366
388
```
389
+
{{% /code-placeholders %}}
390
+
391
+
In your command, replace {{% code-placeholder-key %}} `ADMIN_TOKEN`{{% /code-placeholder-key %}} with the admin token you created earlier.
367
392
368
393
For more information, see how to [Manage resource tokens](/influxdb3/version/admin/tokens/resource/).
369
394
@@ -372,14 +397,18 @@ For more information, see how to [Manage resource tokens](/influxdb3/version/adm
372
397
- To authenticate `influxdb3` CLI commands, use the `--token` option or assign your
373
398
token to the `INFLUXDB3_AUTH_TOKEN` environment variable for `influxdb3` to use it automatically.
374
399
- To authenticate HTTP API requests, include `Bearer <TOKEN>` in the `Authorization` header value--for example:
375
-
400
+
401
+
{{% code-placeholders "SYSTEM_TOKEN" %}}
402
+
376
403
```bash
377
404
curl "http://{{< influxdb/host >}}/health" \
378
405
--header "Authorization: Bearer SYSTEM_TOKEN"
379
406
```
407
+
{{% /code-placeholders %}}
408
+
409
+
Replace the following:
380
410
381
-
In your request, replace
382
-
{{% code-placeholder-key %}}`SYSTEM_TOKEN`{{% /code-placeholder-key %}} with the system token you created earlier.
411
+
In your command, replace {{% code-placeholder-key %}}`SYSTEM_TOKEN`{{% /code-placeholder-key %}}: System token that grants access to system endpoints (`/health`, `/metrics`, etc.)
0 commit comments