# Gateway

> Source: https://developers.cloud66.com/v3/endpoints/gateway/

## List Gateways

URL: https://developers.cloud66.com/v3/endpoints/gateway/#list
Endpoint: GET /accounts/:account_id/gateways
OAuth scope: public

Get a list of all the gateways of the account.

**Related models:** Gateway, Pagination

### Parameters

- `account_id` (string, required) — The account id

### Response

```json
{
  "response":[
    {
      "id": 1,
      "name": "aws_bastion",
      "username": "ec2-usr",
      "address": "1.1.1.1",
      "private_ip": "2.2.2.2",
      "ttl": "2016-02-01T14:46:38Z",
      "content": "N/A",
      "created_at_iso": "2016-02-01T14:37:05Z",
      "updated_at_iso": "2016-02-01T14:47:01Z",
      "created_by": "user1@cloud66.com",
      "updated_by": "user1@cloud66.com"
    }
  ],
  "count":1,
  "pagination":{
    "previous":null,
    "next":null,
    "current":1,
    "per_page":30,
    "count":1,
    "pages":1
  }
}
```

---

## Create Gateway

URL: https://developers.cloud66.com/v3/endpoints/gateway/#create
Endpoint: POST /accounts/:account_id/gateways
OAuth scope: admin

Create a new gateway under the account. `name` must be passed as params. You can also specify `username`, `address`, `ttl`, `private_ip` and `content` as params.

**Related models:** Gateway

### Parameters

- `account_id` (string, required) — The account id
- `name` (string, required) — New gateway name
- `username` (string, optional) — Username of bastion server
- `address` (string, optional) — Public IP or DNS address of bastion server
- `ttl` (integer, optional) — The number of seconds you want the gateway available
- `private_ip` (string, optional) — Private IP or DNS address of bastion server
- `content` (string, optional) — The content of private key of bastion server

### Response

```json
{ 
  "response":
    {
      "ok": true
    }
}
```

---

## Update Gateway

URL: https://developers.cloud66.com/v3/endpoints/gateway/#update
Endpoint: PUT /accounts/:account_id/gateways/:id
OAuth scope: admin

Update gateway information.

**Related models:** Gateway

### Parameters

- `id` (integer, required) — The gateway id
- `account_id` (string, required) — The account id
- `name` (string, optional) — Gateway name
- `username` (string, optional) — Username of bastion server
- `address` (string, optional) — Public IP or DNS address of bastion server
- `ttl` (integer, optional) — The number of seconds you want the gateway available
- `private_ip` (string, optional) — Private IP or DNS address of bastion server
- `content` (string, optional) — The content of private key of bastion server

### Response

```json
{ 
  "response":
    {
      "ok": true
    }
}
```

---

## Delete Gateway

URL: https://developers.cloud66.com/v3/endpoints/gateway/#delete
Endpoint: DELETE /accounts/:account_id/gateways/:id
OAuth scope: admin

Delete a gateway.

**Related models:** Gateway

### Parameters

- `id` (integer, required) — The gateway id
- `account_id` (string, required) — The account id

---

## Gateway

URL: https://developers.cloud66.com/v3/endpoints/gateway/#reference
OAuth scope: public

Gateway endpoints provide access to Cloud 66 gateway functionality.

This section contains endpoints for managing gateway configurations and settings.

**Related models:** Gateway
