# Peerings

## List VPC Peerings

**get** `/projects/{project_id}/vpcs/{vpc_id}/peerings`

Retrieves a list of all VPC peering connections for a given VPC.

### Path Parameters

- `project_id: string`

- `vpc_id: string`

### Returns

- `id: string`

  The unique identifier for the peering connection.

- `peer_account_id: string`

  The cloud account ID of the peer VPC.

- `peer_region_code: string`

  The cloud region of the peer VPC.

- `peer_vpc_id: string`

  The ID of the peer VPC.

- `status: "PENDING" or "TIMEOUT" or "APPROVED" or 5 more`

  The current status of a VPC peering connection:

  - PENDING: the peering request has been made and is awaiting action
  - TIMEOUT: the peering request timed out before being resolved
  - APPROVED: the peering request has been approved
  - ACTIVE: the peering connection is active
  - DISABLED: the peering connection has been disabled
  - DELETING: the peering connection is being deleted
  - INVALID: the peering request is invalid
  - UNKNOWN: an unrecognized state

  - `"PENDING"`

  - `"TIMEOUT"`

  - `"APPROVED"`

  - `"ACTIVE"`

  - `"DISABLED"`

  - `"DELETING"`

  - `"INVALID"`

  - `"UNKNOWN"`

- `created: optional string`

  Creation timestamp.

- `error_message: optional string`

  A human-readable error message when the peering connection failed.

- `provisioned_id: optional string`

  The provider-assigned identifier for the provisioned peering.

### Example

```http
curl https://console.cloud.tigerdata.com/public/api/v1/projects/$PROJECT_ID/vpcs/$VPC_ID/peerings \
    -H "Authorization: Bearer $TIGER_CLOUD_API_KEY"
```

#### Response

```json
[
  {
    "id": "1234567890",
    "peer_account_id": "acc-12345",
    "peer_region_code": "us-east-1",
    "peer_vpc_id": "1234567890",
    "status": "ACTIVE",
    "created": "2025-01-15T09:30:00Z",
    "error_message": "VPC not found",
    "provisioned_id": "pcx-0123456789abcdef0"
  }
]
```

## Create a VPC Peering

**post** `/projects/{project_id}/vpcs/{vpc_id}/peerings`

Creates a new VPC peering connection. This is an asynchronous operation.

### Path Parameters

- `project_id: string`

- `vpc_id: string`

### Body Parameters

- `peer_account_id: string`

  The cloud account ID of the peer VPC.

- `peer_region_code: string`

  The cloud region of the peer VPC.

- `peer_vpc_id: string`

  The ID of the peer VPC.

### Returns

- `Peering object { id, peer_account_id, peer_region_code, 5 more }`

  A VPC peering connection to an external cloud account.

  - `id: string`

    The unique identifier for the peering connection.

  - `peer_account_id: string`

    The cloud account ID of the peer VPC.

  - `peer_region_code: string`

    The cloud region of the peer VPC.

  - `peer_vpc_id: string`

    The ID of the peer VPC.

  - `status: "PENDING" or "TIMEOUT" or "APPROVED" or 5 more`

    The current status of a VPC peering connection:

    - PENDING: the peering request has been made and is awaiting action
    - TIMEOUT: the peering request timed out before being resolved
    - APPROVED: the peering request has been approved
    - ACTIVE: the peering connection is active
    - DISABLED: the peering connection has been disabled
    - DELETING: the peering connection is being deleted
    - INVALID: the peering request is invalid
    - UNKNOWN: an unrecognized state

    - `"PENDING"`

    - `"TIMEOUT"`

    - `"APPROVED"`

    - `"ACTIVE"`

    - `"DISABLED"`

    - `"DELETING"`

    - `"INVALID"`

    - `"UNKNOWN"`

  - `created: optional string`

    Creation timestamp.

  - `error_message: optional string`

    A human-readable error message when the peering connection failed.

  - `provisioned_id: optional string`

    The provider-assigned identifier for the provisioned peering.

### Example

```http
curl https://console.cloud.tigerdata.com/public/api/v1/projects/$PROJECT_ID/vpcs/$VPC_ID/peerings \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TIGER_CLOUD_API_KEY" \
    -d '{
          "peer_account_id": "acc-12345",
          "peer_region_code": "us-east-1",
          "peer_vpc_id": "1234567890"
        }'
```

#### Response

```json
{
  "id": "1234567890",
  "peer_account_id": "acc-12345",
  "peer_region_code": "us-east-1",
  "peer_vpc_id": "1234567890",
  "status": "ACTIVE",
  "created": "2025-01-15T09:30:00Z",
  "error_message": "VPC not found",
  "provisioned_id": "pcx-0123456789abcdef0"
}
```

## Get a VPC Peering

**get** `/projects/{project_id}/vpcs/{vpc_id}/peerings/{peering_id}`

Retrieves the details of a specific VPC peering connection.

### Path Parameters

- `project_id: string`

- `vpc_id: string`

- `peering_id: string`

### Returns

- `Peering object { id, peer_account_id, peer_region_code, 5 more }`

  A VPC peering connection to an external cloud account.

  - `id: string`

    The unique identifier for the peering connection.

  - `peer_account_id: string`

    The cloud account ID of the peer VPC.

  - `peer_region_code: string`

    The cloud region of the peer VPC.

  - `peer_vpc_id: string`

    The ID of the peer VPC.

  - `status: "PENDING" or "TIMEOUT" or "APPROVED" or 5 more`

    The current status of a VPC peering connection:

    - PENDING: the peering request has been made and is awaiting action
    - TIMEOUT: the peering request timed out before being resolved
    - APPROVED: the peering request has been approved
    - ACTIVE: the peering connection is active
    - DISABLED: the peering connection has been disabled
    - DELETING: the peering connection is being deleted
    - INVALID: the peering request is invalid
    - UNKNOWN: an unrecognized state

    - `"PENDING"`

    - `"TIMEOUT"`

    - `"APPROVED"`

    - `"ACTIVE"`

    - `"DISABLED"`

    - `"DELETING"`

    - `"INVALID"`

    - `"UNKNOWN"`

  - `created: optional string`

    Creation timestamp.

  - `error_message: optional string`

    A human-readable error message when the peering connection failed.

  - `provisioned_id: optional string`

    The provider-assigned identifier for the provisioned peering.

### Example

```http
curl https://console.cloud.tigerdata.com/public/api/v1/projects/$PROJECT_ID/vpcs/$VPC_ID/peerings/$PEERING_ID \
    -H "Authorization: Bearer $TIGER_CLOUD_API_KEY"
```

#### Response

```json
{
  "id": "1234567890",
  "peer_account_id": "acc-12345",
  "peer_region_code": "us-east-1",
  "peer_vpc_id": "1234567890",
  "status": "ACTIVE",
  "created": "2025-01-15T09:30:00Z",
  "error_message": "VPC not found",
  "provisioned_id": "pcx-0123456789abcdef0"
}
```

## Delete a VPC Peering

**delete** `/projects/{project_id}/vpcs/{vpc_id}/peerings/{peering_id}`

Deletes a specific VPC peering connection. This is an asynchronous operation.

### Path Parameters

- `project_id: string`

- `vpc_id: string`

- `peering_id: string`

### Example

```http
curl https://console.cloud.tigerdata.com/public/api/v1/projects/$PROJECT_ID/vpcs/$VPC_ID/peerings/$PEERING_ID \
    -X DELETE \
    -H "Authorization: Bearer $TIGER_CLOUD_API_KEY"
```

## Domain Types

### Peering

- `Peering object { id, peer_account_id, peer_region_code, 5 more }`

  A VPC peering connection to an external cloud account.

  - `id: string`

    The unique identifier for the peering connection.

  - `peer_account_id: string`

    The cloud account ID of the peer VPC.

  - `peer_region_code: string`

    The cloud region of the peer VPC.

  - `peer_vpc_id: string`

    The ID of the peer VPC.

  - `status: "PENDING" or "TIMEOUT" or "APPROVED" or 5 more`

    The current status of a VPC peering connection:

    - PENDING: the peering request has been made and is awaiting action
    - TIMEOUT: the peering request timed out before being resolved
    - APPROVED: the peering request has been approved
    - ACTIVE: the peering connection is active
    - DISABLED: the peering connection has been disabled
    - DELETING: the peering connection is being deleted
    - INVALID: the peering request is invalid
    - UNKNOWN: an unrecognized state

    - `"PENDING"`

    - `"TIMEOUT"`

    - `"APPROVED"`

    - `"ACTIVE"`

    - `"DISABLED"`

    - `"DELETING"`

    - `"INVALID"`

    - `"UNKNOWN"`

  - `created: optional string`

    Creation timestamp.

  - `error_message: optional string`

    A human-readable error message when the peering connection failed.

  - `provisioned_id: optional string`

    The provider-assigned identifier for the provisioned peering.

### Peering List Response

- `PeeringListResponse = array of Peering`

  - `id: string`

    The unique identifier for the peering connection.

  - `peer_account_id: string`

    The cloud account ID of the peer VPC.

  - `peer_region_code: string`

    The cloud region of the peer VPC.

  - `peer_vpc_id: string`

    The ID of the peer VPC.

  - `status: "PENDING" or "TIMEOUT" or "APPROVED" or 5 more`

    The current status of a VPC peering connection:

    - PENDING: the peering request has been made and is awaiting action
    - TIMEOUT: the peering request timed out before being resolved
    - APPROVED: the peering request has been approved
    - ACTIVE: the peering connection is active
    - DISABLED: the peering connection has been disabled
    - DELETING: the peering connection is being deleted
    - INVALID: the peering request is invalid
    - UNKNOWN: an unrecognized state

    - `"PENDING"`

    - `"TIMEOUT"`

    - `"APPROVED"`

    - `"ACTIVE"`

    - `"DISABLED"`

    - `"DELETING"`

    - `"INVALID"`

    - `"UNKNOWN"`

  - `created: optional string`

    Creation timestamp.

  - `error_message: optional string`

    A human-readable error message when the peering connection failed.

  - `provisioned_id: optional string`

    The provider-assigned identifier for the provisioned peering.
