Skip to content

Commit 680b782

Browse files
committed
added an example
1 parent a58e5c4 commit 680b782

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

examples/storage_volumes.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
all_volumes = datacrunch.volumes.get()
2020

2121
# Get all attached volumes
22-
all_attached_volumes = datacrunch.volumes.get(status=datacrunch.constants.volume_status.ATTACHED)
22+
all_attached_volumes = datacrunch.volumes.get(
23+
status=datacrunch.constants.volume_status.ATTACHED)
2324

2425
# Get volume by id
25-
random_volume = datacrunch.volumes.get_by_id("0c41e387-3dd8-495f-a285-e861527f2f3d")
26+
random_volume = datacrunch.volumes.get_by_id(
27+
"0c41e387-3dd8-495f-a285-e861527f2f3d")
2628

2729
# Create a 200 GB detached NVMe volume
2830
nvme_volume = datacrunch.volumes.create(type=NVMe,
@@ -51,5 +53,8 @@
5153
# increase volume size
5254
datacrunch.volumes.increase_size(nvme_volume_id, 300)
5355

56+
# clone volume
57+
datacrunch.volumes.clonse(nvme_volume_id)
58+
5459
# delete volumes
5560
datacrunch.volumes.delete([nvme_volume_id, hdd_volume_id])

0 commit comments

Comments
 (0)