2022-08-31 16:58:41 +00:00
|
|
|
---
|
|
|
|
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`
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
Corresponding HTTP API Endpoint: [\[DELETE\] /v1/peering/:name](/consul/api-docs/peering#delete-a-peering-connection)
|
2022-08-31 16:58:41 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2023-01-25 16:52:43 +00:00
|
|
|
The table below shows this command's [required ACLs](/consul/api-docs/api-structure#authentication).
|
2022-08-31 16:58:41 +00:00
|
|
|
|
|
|
|
| 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
|
|
|
|
```
|
|
|
|
|