Skip to content
This repository has been archived by the owner on Aug 9, 2020. It is now read-only.

Commit

Permalink
Added a method for resizing volumes by name
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Sep 12, 2016
1 parent 8d80f26 commit bdbf519
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ v0.3.0 (in development)
- ``doapi.detach_volume_by_name()``
- ``doapi.fetch_all_volumes()``
- ``doapi.fetch_volume()``
- ``doapi.resize_volume_by_name()``

- ``doapi.create_droplet`` now takes an optional ``volumes`` argument

Expand Down
2 changes: 0 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
- Support block storage
- Look into whether volumes can be resized by name
- Look into whether volumes can be attached/detached by only name or region

- It seems that Exceptions make their error message available via a(n
undocumented?) `message` property, which conflicts with the "message" field
Expand Down
5 changes: 5 additions & 0 deletions doapi/doapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,11 @@ def detach_volume_by_name(self, droplet_id, volume_name, region):
return self.act_on_volume_by_name("detach", volume_name, region,
droplet_id=int(droplet_id))

def resize_volume_by_name(self, size_gigabytes, volume_name, region):
""" TODO """
return self.act_on_volume_by_name("resize", volume_name, region,
size_gigabytes=size_gigabytes)

def __eq__(self, other):
return type(self) is type(other) and vars(self) == vars(other)

Expand Down

0 comments on commit bdbf519

Please sign in to comment.