koalalorenzo / python-digitalocean

🐍🐳 Python module to manage Digital Ocean droplets
GNU Lesser General Public License v3.0
1.26k stars 301 forks source link

Droplet create #307

Closed Bekmezcii closed 4 years ago

Bekmezcii commented 4 years ago

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()

Bekmezcii commented 4 years ago

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.

Bekmezcii commented 4 years ago

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.