Report this

What is the reason for this report?

How do I create a Droplet using a Snapshot using v2 API?

Posted on May 7, 2018

Hi, I’ve created a shapshot for one of my droplets and can see it being retrieved using the a private Image: URL: https://api.digitalocean.com/v2/images?private=true Response:

{
    "images": [
        {
            "id": 34127022,
            "name": "sc-sh-foundation",
            "distribution": "CentOS",
            "slug": null,
            "public": false,
            "regions": [
                "sfo2"
            ],
            "created_at": "2018-05-07T09:42:19Z",
            "min_disk_size": 80,
            "type": "snapshot",
            "size_gigabytes": 10.78
        }
    ],
    "links": {},
    "meta": {
        "total": 1
    }
}

But when I try to create a droplet with the image id I get an error. URL: https://api.digitalocean.com/v2/droplets Request:

{
  "name": "sc-sh-isccs",
  "region": "sfo2",
  "size": 109,
  "image": 34127022,
  "ssh_keys": [20594886],
  "backups": false,
  "ipv6": false,
  "user_data": null,
  "private_networking": null,
  "volumes": null,
  "tags":["sterling","isccs"]
}

Response:

{
    "id": "unprocessable_entity",
    "message": "You specified an invalid image for Droplet creation."
}

Can you please guide on what the issue could be?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.