Skip to content

Commit ace9a27

Browse files
authored
Merge pull request #24 from DataCrunch-io/fix-volumes
Release 1.7.0: fix volumes.get() and volume.increase_size()
2 parents e9c374c + f1ab70e commit ace9a27

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
v1.7.0 (2024-11-21)
5+
-------------------
6+
7+
* Fix volume.increase_size()
8+
* Fix volumes.get()
9+
410
v1.6.1 (2023-10-02)
511
-------------------
612

datacrunch/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '1.6.1'
1+
VERSION = '1.7.0'

datacrunch/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class VolumeActions:
1313
ATTACH = 'attach'
1414
DETACH = 'detach'
1515
RENAME = 'rename'
16-
INCREASE_SIZE = 'increase-size'
16+
INCREASE_SIZE = 'resize'
1717
DELETE = 'delete'
1818
CLONE = 'clone'
1919

datacrunch/volumes/volumes.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,21 @@ def create_from_dict(cls: 'Volume', volume_dict: dict) -> 'Volume':
179179
:return: Volume
180180
:rtype: Volume
181181
"""
182-
return cls(**volume_dict)
182+
183+
return cls(
184+
id = volume_dict['id'],
185+
status = volume_dict['status'],
186+
name = volume_dict['name'],
187+
size = volume_dict['size'],
188+
type = volume_dict['type'],
189+
is_os_volume = volume_dict['is_os_volume'],
190+
created_at = volume_dict['created_at'],
191+
target = volume_dict['target'],
192+
location = volume_dict['location'],
193+
instance_id = volume_dict['instance_id'],
194+
ssh_key_ids = volume_dict['ssh_key_ids'],
195+
deleted_at = volume_dict.get('deleted_at'),
196+
)
183197

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

0 commit comments

Comments
 (0)