Skip to content

Commit

Permalink
Merge pull request #24 from DataCrunch-io/fix-volumes
Browse files Browse the repository at this point in the history
Release 1.7.0: fix volumes.get() and volume.increase_size()
  • Loading branch information
shamrin authored Nov 21, 2024
2 parents e9c374c + f1ab70e commit ace9a27
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

v1.7.0 (2024-11-21)
-------------------

* Fix volume.increase_size()
* Fix volumes.get()

v1.6.1 (2023-10-02)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion datacrunch/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '1.6.1'
VERSION = '1.7.0'
2 changes: 1 addition & 1 deletion datacrunch/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class VolumeActions:
ATTACH = 'attach'
DETACH = 'detach'
RENAME = 'rename'
INCREASE_SIZE = 'increase-size'
INCREASE_SIZE = 'resize'
DELETE = 'delete'
CLONE = 'clone'

Expand Down
16 changes: 15 additions & 1 deletion datacrunch/volumes/volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,21 @@ def create_from_dict(cls: 'Volume', volume_dict: dict) -> 'Volume':
:return: Volume
:rtype: Volume
"""
return cls(**volume_dict)

return cls(
id = volume_dict['id'],
status = volume_dict['status'],
name = volume_dict['name'],
size = volume_dict['size'],
type = volume_dict['type'],
is_os_volume = volume_dict['is_os_volume'],
created_at = volume_dict['created_at'],
target = volume_dict['target'],
location = volume_dict['location'],
instance_id = volume_dict['instance_id'],
ssh_key_ids = volume_dict['ssh_key_ids'],
deleted_at = volume_dict.get('deleted_at'),
)

def __str__(self) -> str:
"""Returns a string of the json representation of the volume
Expand Down

0 comments on commit ace9a27

Please sign in to comment.