Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirse committed Jan 13, 2025
2 parents 28a61c5 + 5972c1b commit 47f7bb2
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 9 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
12 changes: 10 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ Release Guidelines
------------------------
Some steps for releasing a new version:

1. Update the version in `__version__.py`
1. Update the version in ``__version__.py``
2. Add an entry to the CHANGELOG.rst file
3. Push the changes to the `master` branch and add a new release tag.
3. ``git tag vX.Y.Z``
4. ``git push master``
5. ``git push --tags``
6. `Draft and publish`_ a new release.
7. Check that package is automatically published to `PyPI`_ via `GitHub action`_.

.. _Draft and publish: https://github.com/DataCrunch-io/datacrunch-python/releases
.. _PyPI: https://pypi.org/project/datacrunch/
.. _GitHub action: https://github.com/DataCrunch-io/datacrunch-python/actions/workflows/publish_package.yml
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
2 changes: 1 addition & 1 deletion docs/source/examples/advanced_create_instance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Advanced Create Instance
ssh_key_ids=ssh_keys_ids,
hostname='example',
description='large instance'
os_volumes={
os_volume={
"name": "Large OS volume",
"size": 95
})
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/instances_and_volumes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Instances and Volumes
ssh_key_ids=ssh_keys,
hostname='example',
description='example instance',
os_volumes={
os_volume={
"name": "OS volume",
"size": 95
})
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_create_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
ssh_key_ids=ssh_keys_ids,
hostname='example',
description='large instance',
os_volumes={
os_volume={
"name": "Large OS volume",
"size": 95
})
Expand Down
2 changes: 1 addition & 1 deletion examples/instances_and_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
ssh_key_ids=ssh_keys,
hostname='example',
description='example instance',
os_volumes={
os_volume={
"name": "OS volume",
"size": 95
})
Expand Down

0 comments on commit 47f7bb2

Please sign in to comment.