Merge pull request #862 from influxdata/cli/delete-bucket

Delete buckets by name
pull/871/head
Scott Anderson 2020-03-25 12:30:47 -06:00 committed by GitHub
commit 28f35f7190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 7 deletions

View File

@ -25,11 +25,29 @@ to delete a bucket.
## Delete a bucket using the influx CLI
Use the [`influx bucket delete` command](/v2.0/reference/cli/influx/bucket/delete)
to delete a bucket. Deleting a bucket requires the following:
to delete a bucket a bucket by name or ID.
- The bucket ID _(provided in the output of `influx bucket list`)_
- The name or ID of the organization to which the bucket belongs
### Delete a bucket by name
**To delete a bucket by name, you need:**
- Bucket name
- Bucket's organization name or ID
<!-- -->
```sh
# Syntax
influx bucket delete -n <bucket-name> -o <org-name>
# Example
influx bucket delete -n my-bucket -o my-org
```
### Delete a bucket by ID
**To delete a bucket by ID, you need:**
- Bucket ID _(provided in the output of `influx bucket list`)_
<!-- -->
```sh
# Syntax
influx bucket delete -i <bucket-id>

View File

@ -6,6 +6,8 @@ menu:
name: influx bucket delete
parent: influx bucket
weight: 201
related:
- /v2.0/organizations/buckets/delete-bucket/
---
The `influx bucket delete` command deletes a bucket from InfluxDB and all the data it contains.
@ -16,9 +18,12 @@ influx bucket delete [flags]
```
## Flags
| Flag | Description | Input type |
|:---- |:----------- |:----------: |
| `-h`, `--help` | Help for the `delete` command | |
| `-i`, `--id` | **(Required)** Bucket ID | string |
| Flag | Description | Input type | {{< cli/mapped >}} |
|:---- |:----------- |:----------: |:------------------ |
| `-h`, `--help` | Help for the `delete` command | | |
| `-i`, `--id` | Bucket ID _(required if no `--name`)_ | string | |
| `-n`, `--name` | Bucket name _(requires `--org` or `org-id`)_ | string | |
| `-o`, `--org` | Organization name | string | `$INFLUX_ORG` |
| `--org-id` | Organization ID | string | `$INFLUX_ORG_ID` |
{{% cli/influx-global-flags %}}