Merge "Add all_projects as a preferred alias for all_tenants"
This commit is contained in:
commit
093540d595
|
@ -45,7 +45,7 @@ class Proxy(proxy.Proxy):
|
||||||
the snapshots being returned. Available parameters include:
|
the snapshots being returned. Available parameters include:
|
||||||
|
|
||||||
* name: Name of the snapshot as a string.
|
* name: Name of the snapshot as a string.
|
||||||
* all_tenants: Whether return the snapshots of all tenants.
|
* all_projects: Whether return the snapshots in all projects.
|
||||||
* volume_id: volume id of a snapshot.
|
* volume_id: volume id of a snapshot.
|
||||||
* status: Value of the status of the snapshot so that you can
|
* status: Value of the status of the snapshot so that you can
|
||||||
filter on "available" for example.
|
filter on "available" for example.
|
||||||
|
@ -154,7 +154,7 @@ class Proxy(proxy.Proxy):
|
||||||
the volumes being returned. Available parameters include:
|
the volumes being returned. Available parameters include:
|
||||||
|
|
||||||
* name: Name of the volume as a string.
|
* name: Name of the volume as a string.
|
||||||
* all_tenants: Whether return the volumes of all tenants
|
* all_projects: Whether return the volumes in all projects
|
||||||
* status: Value of the status of the volume so that you can filter
|
* status: Value of the status of the volume so that you can filter
|
||||||
on "available" for example.
|
on "available" for example.
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ class Snapshot(resource.Resource):
|
||||||
base_path = "/snapshots"
|
base_path = "/snapshots"
|
||||||
|
|
||||||
_query_mapping = resource.QueryParameters(
|
_query_mapping = resource.QueryParameters(
|
||||||
'all_tenants', 'name', 'status', 'volume_id')
|
'name', 'status', 'volume_id', all_projects='all_tenants')
|
||||||
|
|
||||||
# capabilities
|
# capabilities
|
||||||
allow_fetch = True
|
allow_fetch = True
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Volume(resource.Resource):
|
||||||
base_path = "/volumes"
|
base_path = "/volumes"
|
||||||
|
|
||||||
_query_mapping = resource.QueryParameters(
|
_query_mapping = resource.QueryParameters(
|
||||||
'all_tenants', 'name', 'status', 'project_id')
|
'name', 'status', 'project_id', all_projects='all_tenants')
|
||||||
|
|
||||||
# capabilities
|
# capabilities
|
||||||
allow_fetch = True
|
allow_fetch = True
|
||||||
|
|
|
@ -371,7 +371,7 @@ class Proxy(proxy.Proxy):
|
||||||
"""
|
"""
|
||||||
return self._get(_server.Server, server)
|
return self._get(_server.Server, server)
|
||||||
|
|
||||||
def servers(self, details=True, **query):
|
def servers(self, details=True, all_projects=False, **query):
|
||||||
"""Retrieve a generator of servers
|
"""Retrieve a generator of servers
|
||||||
|
|
||||||
:param bool details: When set to ``False``
|
:param bool details: When set to ``False``
|
||||||
|
@ -395,6 +395,8 @@ class Proxy(proxy.Proxy):
|
||||||
* status: Value of the status of the server so that you can filter
|
* status: Value of the status of the server so that you can filter
|
||||||
on "ACTIVE" for example.
|
on "ACTIVE" for example.
|
||||||
* host: Name of the host as a string.
|
* host: Name of the host as a string.
|
||||||
|
* all_projects: Flag to request servers be returned from all
|
||||||
|
projects, not just the currently scoped one.
|
||||||
* limit: Requests a specified page size of returned items from the
|
* limit: Requests a specified page size of returned items from the
|
||||||
query. Returns a number of items up to the specified
|
query. Returns a number of items up to the specified
|
||||||
limit value. Use the limit parameter to make an initial
|
limit value. Use the limit parameter to make an initial
|
||||||
|
@ -408,6 +410,8 @@ class Proxy(proxy.Proxy):
|
||||||
|
|
||||||
:returns: A generator of server instances.
|
:returns: A generator of server instances.
|
||||||
"""
|
"""
|
||||||
|
if all_projects:
|
||||||
|
query['all_projects'] = True
|
||||||
srv = _server.ServerDetail if details else _server.Server
|
srv = _server.ServerDetail if details else _server.Server
|
||||||
return self._list(srv, paginated=True, **query)
|
return self._list(srv, paginated=True, **query)
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Server(resource.Resource, metadata.MetadataMixin):
|
||||||
|
|
||||||
_query_mapping = resource.QueryParameters(
|
_query_mapping = resource.QueryParameters(
|
||||||
"image", "flavor", "name",
|
"image", "flavor", "name",
|
||||||
"status", "host", "all_tenants",
|
"status", "host",
|
||||||
"sort_key", "sort_dir",
|
"sort_key", "sort_dir",
|
||||||
"reservation_id", "tags",
|
"reservation_id", "tags",
|
||||||
"project_id",
|
"project_id",
|
||||||
|
@ -39,7 +39,8 @@ class Server(resource.Resource, metadata.MetadataMixin):
|
||||||
is_deleted="deleted",
|
is_deleted="deleted",
|
||||||
ipv4_address="ip",
|
ipv4_address="ip",
|
||||||
ipv6_address="ip6",
|
ipv6_address="ip6",
|
||||||
changes_since="changes-since")
|
changes_since="changes-since",
|
||||||
|
all_projects="all_tenants")
|
||||||
|
|
||||||
#: A list of dictionaries holding links relevant to this server.
|
#: A list of dictionaries holding links relevant to this server.
|
||||||
links = resource.Body('links')
|
links = resource.Body('links')
|
||||||
|
|
|
@ -53,7 +53,7 @@ class TestSnapshot(base.TestCase):
|
||||||
|
|
||||||
self.assertDictEqual({"name": "name",
|
self.assertDictEqual({"name": "name",
|
||||||
"status": "status",
|
"status": "status",
|
||||||
"all_tenants": "all_tenants",
|
"all_projects": "all_tenants",
|
||||||
"volume_id": "volume_id",
|
"volume_id": "volume_id",
|
||||||
"limit": "limit",
|
"limit": "limit",
|
||||||
"marker": "marker"},
|
"marker": "marker"},
|
||||||
|
|
|
@ -85,7 +85,7 @@ class TestVolume(base.TestCase):
|
||||||
|
|
||||||
self.assertDictEqual({"name": "name",
|
self.assertDictEqual({"name": "name",
|
||||||
"status": "status",
|
"status": "status",
|
||||||
"all_tenants": "all_tenants",
|
"all_projects": "all_tenants",
|
||||||
"project_id": "project_id",
|
"project_id": "project_id",
|
||||||
"limit": "limit",
|
"limit": "limit",
|
||||||
"marker": "marker"},
|
"marker": "marker"},
|
||||||
|
|
|
@ -84,7 +84,7 @@ class TestServer(base.TestCase):
|
||||||
"name": "name",
|
"name": "name",
|
||||||
"status": "status",
|
"status": "status",
|
||||||
"host": "host",
|
"host": "host",
|
||||||
"all_tenants": "all_tenants",
|
"all_projects": "all_tenants",
|
||||||
"changes_since": "changes-since",
|
"changes_since": "changes-since",
|
||||||
"limit": "limit",
|
"limit": "limit",
|
||||||
"marker": "marker",
|
"marker": "marker",
|
||||||
|
|
Loading…
Reference in New Issue