# DigitalOcean

> List your Droplets and manage DigitalOcean DNS: add domains, create records, and clean up when you're done.

App · Cloud Computing · 5 actions. Web page: https://docs.lodol.com/docs/integrations/digitalocean

## Actions

### Create DNS record

Create a new DNS record in a domain managed by DigitalOcean.

**Inputs**

- Domain name (`domain_name`, text, required): The domain to add the record to (for example, example.com)
- Record type (`record_type`, text, required): The DNS record type (e.g., A, AAAA, CNAME, TXT, MX, NS)
- Name (`name`, text, required): The host name for the record (for example, www, or @ for the root domain)
- Data (`data`, text, required): The value for the record (for example, an IP address for an A record, or a hostname for a CNAME)
- Time to live (TTL) (`ttl`, number): [Optional] How long DNS servers cache this record, in seconds (DigitalOcean minimum is 30)
- Priority (`priority`, number): [Optional] Priority for the record, required by MX and SRV records (lower is higher priority)

**Outputs**

- `data` (text)
- `id` (number)
- `name` (text)
- `priority` (number)
- `ttl` (number)
- `type` (text)

**Example output**

```json
{
  "data": "192.0.2.10",
  "id": 28448429,
  "name": "www",
  "priority": null,
  "ttl": 1800,
  "type": "A"
}
```

### Create domain

Add a domain to DigitalOcean's DNS so you can manage its records. DigitalOcean DNS hosting is free.

**Inputs**

- Name (`name`, text, required): The domain name to add (for example, example.com)
- IP address (`ip_address`, text): [Optional] An IPv4 address. When provided, an A record for the root domain (@) is created pointing to it.

**Outputs**

- `name` (text)
- `ttl` (number)
- `zone_file` (text)

**Example output**

```json
{
  "name": "example.com",
  "ttl": 1800,
  "zone_file": "$ORIGIN example.com.\n"
}
```

### Delete domain

Delete a domain from DigitalOcean's DNS. This also removes all of the domain's DNS records and cannot be undone.

**Inputs**

- Name (`name`, text, required): The domain name to delete (for example, example.com)

**Outputs**

- `deleted` (true/false)
- `name` (text)

**Example output**

```json
{
  "deleted": true,
  "name": "example.com"
}
```

### List DNS records

List the DNS records for a domain managed by DigitalOcean, with optional filters by record type and name.

**Inputs**

- Domain name (`domain_name`, text, required): The domain to list records for (for example, example.com)
- Record type (`record_type`, text): [Optional] Only return records of this type (e.g., A, CNAME, TXT)
- Name (`name`, text): [Optional] Only return records with this fully qualified name (e.g., www.example.com)
- Page (`page`, number): [Optional] Which page of results to return (default: 1)
- Per page (`per_page`, number): [Optional] Number of records per page (default: 20)

**Outputs**

- `count` (number)
- `records` (list)

**Example output**

```json
{
  "count": 1,
  "records": [
    {
      "data": "192.0.2.10",
      "id": 28448429,
      "name": "www",
      "priority": null,
      "ttl": 1800,
      "type": "A"
    }
  ]
}
```

### List Droplets

List the Droplets (virtual machines) in your DigitalOcean account, optionally filtered by tag.

**Inputs**

- Tag name (`tag_name`, text): [Optional] Only return Droplets that have this tag
- Page (`page`, number): [Optional] Which page of results to return (default: 1)
- Per page (`per_page`, number): [Optional] Number of Droplets per page (default: 20)

**Outputs**

- `count` (number)
- `droplets` (list)

**Example output**

```json
{
  "count": 1,
  "droplets": [
    {
      "created_at": "2024-01-15T18:37:44Z",
      "disk": 25,
      "id": 3164444,
      "image": "ubuntu-22-04-x64",
      "memory": 1024,
      "name": "web-01",
      "public_ipv4": "192.0.2.10",
      "region": "nyc3",
      "size": "s-1vcpu-1gb",
      "status": "active",
      "vcpus": 1
    }
  ]
}
```
