commit fa62f7d67f1f3b8567895206dcdbfd88f5db4287 Author: Valery Tschopp Date: Thu Oct 1 10:21:52 2020 +0200 Add 'project_id' to Snapshot query parameters This allow to list volume snapshots filtered by project (as admin). Change-Id: I9372dd139868f726c749b4616acb7d0cdac6643c Task: 41002 Story: 2008214 diff --git a/openstack/block_storage/v3/_proxy.py b/openstack/block_storage/v3/_proxy.py index 247bf3b..d0f07f0 100644 --- a/openstack/block_storage/v3/_proxy.py +++ b/openstack/block_storage/v3/_proxy.py @@ -62,6 +62,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy): * name: Name of the snapshot as a string. * all_projects: Whether return the snapshots in all projects. + * project_id: Filter the snapshots by project. * volume_id: volume id of a snapshot. * status: Value of the status of the snapshot so that you can filter on "available" for example. diff --git a/openstack/block_storage/v3/snapshot.py b/openstack/block_storage/v3/snapshot.py index 04b8e71..86e8383 100644 --- a/openstack/block_storage/v3/snapshot.py +++ b/openstack/block_storage/v3/snapshot.py @@ -20,7 +20,8 @@ class Snapshot(resource.Resource): base_path = "/snapshots" _query_mapping = resource.QueryParameters( - 'name', 'status', 'volume_id', all_projects='all_tenants') + 'name', 'status', 'volume_id', + 'project_id', all_projects='all_tenants') # capabilities allow_fetch = True diff --git a/openstack/tests/unit/block_storage/v3/test_snapshot.py b/openstack/tests/unit/block_storage/v3/test_snapshot.py index ae98054..9aa3665 100644 --- a/openstack/tests/unit/block_storage/v3/test_snapshot.py +++ b/openstack/tests/unit/block_storage/v3/test_snapshot.py @@ -48,6 +48,7 @@ class TestSnapshot(base.TestCase): self.assertDictEqual({"name": "name", "status": "status", "all_projects": "all_tenants", + "project_id": "project_id", "volume_id": "volume_id", "limit": "limit", "marker": "marker"},