diff --git a/CHANGELOG.md b/CHANGELOG.md index f193000..91f9538 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Added shared filesystem (SFS) type constant and example + ## [1.16.0] - 2025-10-27 ### Changed diff --git a/datacrunch/constants.py b/datacrunch/constants.py index 2370cff..3ba0a92 100644 --- a/datacrunch/constants.py +++ b/datacrunch/constants.py @@ -61,6 +61,7 @@ class VolumeTypes: NVMe = 'NVMe' HDD = 'HDD' + SFS = 'NVMe_Shared' def __init__(self): return diff --git a/examples/storage_volumes.py b/examples/storage_volumes.py index 5cec8df..56072f0 100644 --- a/examples/storage_volumes.py +++ b/examples/storage_volumes.py @@ -12,6 +12,7 @@ # Get some volume type constants NVMe = datacrunch.constants.volume_types.NVMe HDD = datacrunch.constants.volume_types.HDD +SFS = datacrunch.constants.volume_types.SFS # Example instance id INSTANCE_ID = '8705bb38-2574-454f-9967-d18b130bf5ee' @@ -28,6 +29,9 @@ # Create a 200 GB detached NVMe volume nvme_volume = datacrunch.volumes.create(type=NVMe, name='data-storage-1', size=200) +# Create a shared filesystem volume +shared_filesystem_volume = datacrunch.volumes.create(type=SFS, name='shared-filesystem-1', size=50) + # Create a 500 GB HDD volume and attach it to an existing shutdown instance # Note: If the instance isn't shutdown an exception would be raised hdd_volume = datacrunch.volumes.create( @@ -36,6 +40,7 @@ nvme_volume_id = nvme_volume.id hdd_volume_id = hdd_volume.id +sfs_volume_id = shared_filesystem_volume.id # attach the nvme volume to the instance datacrunch.volumes.attach(nvme_volume_id, INSTANCE_ID) @@ -59,10 +64,10 @@ datacrunch.volumes.clone([nvme_volume_id, hdd_volume_id]) # delete volumes (move to trash for 96h, not permanent) -datacrunch.volumes.delete([nvme_volume_id, hdd_volume_id]) +datacrunch.volumes.delete([nvme_volume_id, hdd_volume_id, sfs_volume_id]) # get all volumes in trash volumes_in_trash = datacrunch.volumes.get_in_trash() # delete volumes permanently -datacrunch.volumes.delete([nvme_volume_id, hdd_volume_id], is_permanent=True) +datacrunch.volumes.delete([nvme_volume_id, hdd_volume_id, sfs_volume_id], is_permanent=True)