koalalorenzo/python-digitalocean

Droplet create

Bekmezcii opened this issue · 2 comments

Thank you for your beautiful work. I can list and destroy my droplets in an easy way.
However, create droplet is not working. My code is as simple as possible. I have a snapshot called as in the code. And my token is valid, because I am using the same token when I list the droplets. Can you help me?

import digitalocean
manager = digitalocean.Manager(token="token")
keys = manager.get_all_sshkeys()

droplet = digitalocean.Droplet(token="token",
name='uni_deneme_jitsiServer-droplet',
region='ams3', # Amster
image='uni_deneme_jitsiServer', # Ubuntu 14.04 x64
size_slug='s-1vcpu-1gb', # 512MB
ssh_keys=keys, #Automatic conversion
backups=False)
droplet.create()

One more thing. I have created the snapshot in FRA1. I also tried to create my droplet in FRA1 (instead of ams3), it is still not working.

I solved the problem. If the image is a snapshot, you have to use image id instead of the name. Like the following.
"image":"1234"

If it is a predefined image name is working properly. I think this issue should be documented in the API documentation properly.