Skip to content

Commit

Permalink
Created a new method to get all the snapshots ( Images )
Browse files Browse the repository at this point in the history
  • Loading branch information
koalalorenzo committed Aug 12, 2014
1 parent e582a1c commit e4ab97c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion digitalocean/Droplet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import requests
from .Action import Action
from .Image import Image
from .baseapi import BaseAPI

class Droplet(BaseAPI):
Expand Down Expand Up @@ -299,4 +300,15 @@ def get_actions(self):
action.token = self.token
action.load()
actions.append(action)
return actions
return actions

def get_snapshots(self):
"""
This method will return the snapshots/images connected to that
specific droplet.
"""
snapshots = list()
for id in droplet.snapshot_ids:
snapshot = Image(token=droplet.token, id=id)
snapshots.append(snapshot)
return snapshots

0 comments on commit e4ab97c

Please sign in to comment.