diff --git a/openstack/block_storage/v2/snapshot.py b/openstack/block_storage/v2/snapshot.py index 4962014cf..120b50b50 100644 --- a/openstack/block_storage/v2/snapshot.py +++ b/openstack/block_storage/v2/snapshot.py @@ -57,6 +57,13 @@ class SnapshotDetail(Snapshot): base_path = "/snapshots/detail" + # capabilities + allow_fetch = False + allow_create = False + allow_delete = False + allow_commit = False + allow_list = True + #: The percentage of completeness the snapshot is currently at. progress = resource.Body("os-extended-snapshot-attributes:progress") #: The project ID this snapshot is associated with. diff --git a/openstack/block_storage/v2/volume.py b/openstack/block_storage/v2/volume.py index c2dfe4380..28ed870ff 100644 --- a/openstack/block_storage/v2/volume.py +++ b/openstack/block_storage/v2/volume.py @@ -94,6 +94,13 @@ class VolumeDetail(Volume): base_path = "/volumes/detail" + # capabilities + allow_fetch = False + allow_create = False + allow_delete = False + allow_commit = False + allow_list = True + #: The volume's current back-end. host = resource.Body("os-vol-host-attr:host") #: The project ID associated with current back-end. diff --git a/openstack/tests/unit/block_storage/v2/test_snapshot.py b/openstack/tests/unit/block_storage/v2/test_snapshot.py index e502f8b70..4910b6db7 100644 --- a/openstack/tests/unit/block_storage/v2/test_snapshot.py +++ b/openstack/tests/unit/block_storage/v2/test_snapshot.py @@ -77,6 +77,11 @@ class TestSnapshotDetail(base.TestCase): sot = snapshot.SnapshotDetail(DETAILED_SNAPSHOT) self.assertIsInstance(sot, snapshot.Snapshot) self.assertEqual("/snapshots/detail", sot.base_path) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) + self.assertFalse(sot.allow_create) + self.assertFalse(sot.allow_delete) + self.assertTrue(sot.allow_list) def test_create_detailed(self): sot = snapshot.SnapshotDetail(**DETAILED_SNAPSHOT) diff --git a/openstack/tests/unit/block_storage/v2/test_volume.py b/openstack/tests/unit/block_storage/v2/test_volume.py index 935941f68..da20309c8 100644 --- a/openstack/tests/unit/block_storage/v2/test_volume.py +++ b/openstack/tests/unit/block_storage/v2/test_volume.py @@ -126,6 +126,11 @@ class TestVolumeDetail(base.TestCase): sot = volume.VolumeDetail(VOLUME_DETAIL) self.assertIsInstance(sot, volume.Volume) self.assertEqual("/volumes/detail", sot.base_path) + self.assertFalse(sot.allow_fetch) + self.assertFalse(sot.allow_commit) + self.assertFalse(sot.allow_create) + self.assertFalse(sot.allow_delete) + self.assertTrue(sot.allow_list) def test_create(self): sot = volume.VolumeDetail(**VOLUME_DETAIL)