Merge "Add 'project_id' to Snapshot query parameters"

This commit is contained in:
Zuul 2020-10-05 11:37:36 +00:00 committed by Gerrit Code Review
commit 8c44ff176c
3 changed files with 4 additions and 1 deletions

View File

@ -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.

View File

@ -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

View File

@ -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"},