Support non-public volume types
- added query-parameters to filter for non-public volume-types. Needs ?is_public=None - added is_public-property to support non-public-volume-types Change-Id: I3f6cdf3fc4c97584a28c9254b74985d8ecde4719
This commit is contained in:
parent
7c1048128e
commit
08dfc169dc
|
@ -98,12 +98,12 @@ class Proxy(proxy.Proxy):
|
||||||
"""
|
"""
|
||||||
return self._get(_type.Type, type)
|
return self._get(_type.Type, type)
|
||||||
|
|
||||||
def types(self):
|
def types(self, **query):
|
||||||
"""Retrieve a generator of volume types
|
"""Retrieve a generator of volume types
|
||||||
|
|
||||||
:returns: A generator of volume type objects.
|
:returns: A generator of volume type objects.
|
||||||
"""
|
"""
|
||||||
return self._list(_type.Type, paginated=False)
|
return self._list(_type.Type, paginated=False, **query)
|
||||||
|
|
||||||
def create_type(self, **attrs):
|
def create_type(self, **attrs):
|
||||||
"""Create a new type from attributes
|
"""Create a new type from attributes
|
||||||
|
|
|
@ -24,6 +24,8 @@ class Type(resource.Resource):
|
||||||
allow_delete = True
|
allow_delete = True
|
||||||
allow_list = True
|
allow_list = True
|
||||||
|
|
||||||
|
_query_mapping = resource.QueryParameters("is_public")
|
||||||
|
|
||||||
# Properties
|
# Properties
|
||||||
#: A ID representing this type.
|
#: A ID representing this type.
|
||||||
id = resource.Body("id")
|
id = resource.Body("id")
|
||||||
|
@ -31,3 +33,5 @@ class Type(resource.Resource):
|
||||||
name = resource.Body("name")
|
name = resource.Body("name")
|
||||||
#: A dict of extra specifications. "capabilities" is a usual key.
|
#: A dict of extra specifications. "capabilities" is a usual key.
|
||||||
extra_specs = resource.Body("extra_specs", type=dict)
|
extra_specs = resource.Body("extra_specs", type=dict)
|
||||||
|
#: a private volume-type. *Type: bool*
|
||||||
|
is_public = resource.Body('os-volume-type-access:is_public', type=bool)
|
||||||
|
|
Loading…
Reference in New Issue