open-consul/website/content/commands/peering/delete.mdx

51 lines
1.6 KiB
Plaintext
Raw Normal View History

---
layout: commands
page_title: 'Commands: Peering Delete'
description: Learn how to use the consul peering delete command to remove a peering connection between Consul clusters.
---
# Consul Peering Delete
Command: `consul peering delete`
Corresponding HTTP API Endpoint: [\[DELETE\] /v1/peering/:name](/api-docs/peering#delete-a-peering-connection)
The `peering delete` removes a peering connection with another cluster.
Consul deletes all data imported from the peer in the background.
The peering connection is removed after all associated data has been deleted.
Operators can still read the peering connections while the data is being removed.
The command adds a `DeletedAt` field to the peering connection object with the timestamp of when the peering was marked for deletion.
You can only use a peering token to establish the connection once. If you need to reestablish a peering connection, you must generate a new token.
The table below shows this command's [required ACLs](/api-docs#authentication).
| ACL Required |
| ------------ |
| `peering:write` |
## Usage
Usage: `consul peering delete [options] -name <peer name>`
#### Command Options
- `-name=<string>` - (Required) The name of the peer.
#### Enterprise Options
@include 'http_api_partition_options.mdx'
#### API Options
@include 'http_api_options_client.mdx'
## Examples
The following examples deletes a peering connection to a cluster locally referred to as "cluster-02":
```shell-session hideClipboard
$ consul peering delete -name cluster-02
Successfully submitted peering connection, cluster-02, for deletion
```