# Vpcs

## List All VPCs

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

Retrieves a list of all Virtual Private Clouds (VPCs).

### Path Parameters

- `project_id: string`

### Returns

- `id: optional string`

  The unique identifier for the VPC.

- `cidr: optional string`

  The CIDR block for the VPC.

- `name: optional string`

  The name of the VPC.

- `region_code: optional string`

  The cloud region where the VPC is hosted.

### Example

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

#### Response

```json
[
  {
    "id": "1234567890",
    "cidr": "10.0.0.0/16",
    "name": "my-production-vpc",
    "region_code": "us-east-1"
  }
]
```

## Create a VPC

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

Creates a new Virtual Private Cloud (VPC).

### Path Parameters

- `project_id: string`

### Body Parameters

- `cidr: string`

  The CIDR block for the VPC.

- `name: string`

  The name of the VPC.

- `region_code: string`

  The cloud region where the VPC will be created.

### Returns

- `Vpc object { id, cidr, name, region_code }`

  A virtual private cloud that services can be attached to.

  - `id: optional string`

    The unique identifier for the VPC.

  - `cidr: optional string`

    The CIDR block for the VPC.

  - `name: optional string`

    The name of the VPC.

  - `region_code: optional string`

    The cloud region where the VPC is hosted.

### Example

```http
curl https://console.cloud.tigerdata.com/public/api/v1/projects/$PROJECT_ID/vpcs \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TIGER_CLOUD_API_KEY" \
    -d '{
          "cidr": "10.0.0.0/16",
          "name": "my-production-vpc",
          "region_code": "us-east-1"
        }'
```

#### Response

```json
{
  "id": "1234567890",
  "cidr": "10.0.0.0/16",
  "name": "my-production-vpc",
  "region_code": "us-east-1"
}
```

## Get a VPC

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

Retrieves the details of a specific VPC by its ID.

### Path Parameters

- `project_id: string`

- `vpc_id: string`

### Returns

- `Vpc object { id, cidr, name, region_code }`

  A virtual private cloud that services can be attached to.

  - `id: optional string`

    The unique identifier for the VPC.

  - `cidr: optional string`

    The CIDR block for the VPC.

  - `name: optional string`

    The name of the VPC.

  - `region_code: optional string`

    The cloud region where the VPC is hosted.

### Example

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

#### Response

```json
{
  "id": "1234567890",
  "cidr": "10.0.0.0/16",
  "name": "my-production-vpc",
  "region_code": "us-east-1"
}
```

## Delete a VPC

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

Deletes a specific VPC.

### Path Parameters

- `project_id: string`

- `vpc_id: string`

### Example

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

## Rename a VPC

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

Updates the name of a specific VPC.

### Path Parameters

- `project_id: string`

- `vpc_id: string`

### Body Parameters

- `name: string`

  The new name for the VPC.

### Returns

- `Vpc object { id, cidr, name, region_code }`

  A virtual private cloud that services can be attached to.

  - `id: optional string`

    The unique identifier for the VPC.

  - `cidr: optional string`

    The CIDR block for the VPC.

  - `name: optional string`

    The name of the VPC.

  - `region_code: optional string`

    The cloud region where the VPC is hosted.

### Example

```http
curl https://console.cloud.tigerdata.com/public/api/v1/projects/$PROJECT_ID/vpcs/$VPC_ID/rename \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TIGER_CLOUD_API_KEY" \
    -d '{
          "name": "my-renamed-vpc"
        }'
```

#### Response

```json
{
  "id": "1234567890",
  "cidr": "10.0.0.0/16",
  "name": "my-production-vpc",
  "region_code": "us-east-1"
}
```

## Domain Types

### Vpc

- `Vpc object { id, cidr, name, region_code }`

  A virtual private cloud that services can be attached to.

  - `id: optional string`

    The unique identifier for the VPC.

  - `cidr: optional string`

    The CIDR block for the VPC.

  - `name: optional string`

    The name of the VPC.

  - `region_code: optional string`

    The cloud region where the VPC is hosted.

### Vpc List Response

- `VpcListResponse = array of Vpc`

  - `id: optional string`

    The unique identifier for the VPC.

  - `cidr: optional string`

    The CIDR block for the VPC.

  - `name: optional string`

    The name of the VPC.

  - `region_code: optional string`

    The cloud region where the VPC is hosted.

# 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: optional string`

  The unique identifier for the peering connection.

- `error_message: optional string`

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

- `peer_account_id: optional string`

  The cloud account ID of the peer VPC.

- `peer_region_code: optional string`

  The cloud region of the peer VPC.

- `peer_vpc_id: optional string`

  The ID of the peer VPC.

- `provisioned_id: optional string`

  The provider-assigned identifier for the provisioned peering.

- `status: optional string`

  The current status of the peering connection.

### 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",
    "error_message": "VPC not found",
    "peer_account_id": "acc-12345",
    "peer_region_code": "aws-us-east-1",
    "peer_vpc_id": "1234567890",
    "provisioned_id": "1234567890",
    "status": "active"
  }
]
```

## Create a VPC Peering

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

Creates a new VPC peering connection.

### 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, error_message, peer_account_id, 4 more }`

  A VPC peering connection to an external cloud account.

  - `id: optional string`

    The unique identifier for the peering connection.

  - `error_message: optional string`

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

  - `peer_account_id: optional string`

    The cloud account ID of the peer VPC.

  - `peer_region_code: optional string`

    The cloud region of the peer VPC.

  - `peer_vpc_id: optional string`

    The ID of the peer VPC.

  - `provisioned_id: optional string`

    The provider-assigned identifier for the provisioned peering.

  - `status: optional string`

    The current status of the peering connection.

### 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": "aws-us-east-1",
          "peer_vpc_id": "1234567890"
        }'
```

#### Response

```json
{
  "id": "1234567890",
  "error_message": "VPC not found",
  "peer_account_id": "acc-12345",
  "peer_region_code": "aws-us-east-1",
  "peer_vpc_id": "1234567890",
  "provisioned_id": "1234567890",
  "status": "active"
}
```

## 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, error_message, peer_account_id, 4 more }`

  A VPC peering connection to an external cloud account.

  - `id: optional string`

    The unique identifier for the peering connection.

  - `error_message: optional string`

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

  - `peer_account_id: optional string`

    The cloud account ID of the peer VPC.

  - `peer_region_code: optional string`

    The cloud region of the peer VPC.

  - `peer_vpc_id: optional string`

    The ID of the peer VPC.

  - `provisioned_id: optional string`

    The provider-assigned identifier for the provisioned peering.

  - `status: optional string`

    The current status of the peering connection.

### 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",
  "error_message": "VPC not found",
  "peer_account_id": "acc-12345",
  "peer_region_code": "aws-us-east-1",
  "peer_vpc_id": "1234567890",
  "provisioned_id": "1234567890",
  "status": "active"
}
```

## Delete a VPC Peering

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

Deletes a specific VPC peering connection.

### 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, error_message, peer_account_id, 4 more }`

  A VPC peering connection to an external cloud account.

  - `id: optional string`

    The unique identifier for the peering connection.

  - `error_message: optional string`

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

  - `peer_account_id: optional string`

    The cloud account ID of the peer VPC.

  - `peer_region_code: optional string`

    The cloud region of the peer VPC.

  - `peer_vpc_id: optional string`

    The ID of the peer VPC.

  - `provisioned_id: optional string`

    The provider-assigned identifier for the provisioned peering.

  - `status: optional string`

    The current status of the peering connection.

### Peering List Response

- `PeeringListResponse = array of Peering`

  - `id: optional string`

    The unique identifier for the peering connection.

  - `error_message: optional string`

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

  - `peer_account_id: optional string`

    The cloud account ID of the peer VPC.

  - `peer_region_code: optional string`

    The cloud region of the peer VPC.

  - `peer_vpc_id: optional string`

    The ID of the peer VPC.

  - `provisioned_id: optional string`

    The provider-assigned identifier for the provisioned peering.

  - `status: optional string`

    The current status of the peering connection.
