# 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`

- `cidr: optional string`

- `name: optional string`

- `region_code: optional string`

### Example

```http
curl http://localhost:8080/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`

- `name: string`

- `region_code: string`

### Returns

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

  - `id: optional string`

  - `cidr: optional string`

  - `name: optional string`

  - `region_code: optional string`

### Example

```http
curl http://localhost:8080/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 }`

  - `id: optional string`

  - `cidr: optional string`

  - `name: optional string`

  - `region_code: optional string`

### Example

```http
curl http://localhost:8080/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 http://localhost:8080/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 }`

  - `id: optional string`

  - `cidr: optional string`

  - `name: optional string`

  - `region_code: optional string`

### Example

```http
curl http://localhost:8080/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 }`

  - `id: optional string`

  - `cidr: optional string`

  - `name: optional string`

  - `region_code: optional string`

### Vpc List Response

- `VpcListResponse = array of Vpc`

  - `id: optional string`

  - `cidr: optional string`

  - `name: optional string`

  - `region_code: optional string`

# 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`

- `error_message: optional string`

- `peer_account_id: optional string`

- `peer_region_code: optional string`

- `peer_vpc_id: optional string`

- `provisioned_id: optional string`

- `status: optional string`

### Example

```http
curl http://localhost:8080/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`

- `peer_region_code: string`

- `peer_vpc_id: string`

### Returns

- `Peering = object { id, error_message, peer_account_id, 4 more }`

  - `id: optional string`

  - `error_message: optional string`

  - `peer_account_id: optional string`

  - `peer_region_code: optional string`

  - `peer_vpc_id: optional string`

  - `provisioned_id: optional string`

  - `status: optional string`

### Example

```http
curl http://localhost:8080/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 }`

  - `id: optional string`

  - `error_message: optional string`

  - `peer_account_id: optional string`

  - `peer_region_code: optional string`

  - `peer_vpc_id: optional string`

  - `provisioned_id: optional string`

  - `status: optional string`

### Example

```http
curl http://localhost:8080/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 http://localhost:8080/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 }`

  - `id: optional string`

  - `error_message: optional string`

  - `peer_account_id: optional string`

  - `peer_region_code: optional string`

  - `peer_vpc_id: optional string`

  - `provisioned_id: optional string`

  - `status: optional string`

### Peering List Response

- `PeeringListResponse = array of Peering`

  - `id: optional string`

  - `error_message: optional string`

  - `peer_account_id: optional string`

  - `peer_region_code: optional string`

  - `peer_vpc_id: optional string`

  - `provisioned_id: optional string`

  - `status: optional string`
