koalalorenzo/python-digitalocean

how to create droplet from snapshots

GOPIPACHA opened this issue · 2 comments

Hi all,
Let me come to point straight I am have some snapshot in digital ocen account, iwanted to create a droplet from those snapshots,can anyone help me out how can i do this using python?

Thanks in advance !!

When you create a new Droplet, you can specify the image you want to use. That can be a DigitalOcean base image (e.g. ubuntu-20-04-x64) or the ID of your snapshot.

Here's a basic example:

import digitalocean

droplet = digitalocean.Droplet(token="digitalocean-api-token",
                               name='example.com',
                               region='nyc3',
                               image='123456789', # ID of you Droplet snapshot
                               size_slug='s-1vcpu-1gb')
droplet.create()

Hi thanks for reply it works like a charm