sushy.resources.base
Module¶sushy.resources.base.
CompositeField
(*args, **kwargs)¶Bases: _abcoll.Mapping
, sushy.resources.base.Field
Base class for fields consisting of several sub-fields.
sushy.resources.base.
Field
(path, required=False, default=None, adapter=<function <lambda>>)¶Bases: object
Definition for fields fetched from JSON.
sushy.resources.base.
ListField
(*args, **kwargs)¶Bases: sushy.resources.base.Field
Base class for fields consisting of a list of several sub-fields.
sushy.resources.base.
MappedField
(field, mapping, required=False, default=None)¶Bases: sushy.resources.base.Field
Field taking real value from a mapping.
sushy.resources.base.
ResourceBase
(connector, path='', redfish_version=None)¶Bases: object
invalidate
(force_refresh=False)¶Mark the resource as stale, prompting refresh() before getting used.
If force_refresh
is set to True, then it invokes refresh()
on the resource.
Parameters: | force_refresh – will invoke refresh on the resource, if set to True. |
---|---|
Raises: | ResourceNotFoundError |
Raises: | ConnectionError |
Raises: | HTTPError |
json
¶path
¶redfish_version
= None¶The Redfish version
refresh
(force=True)¶Refresh the resource
Freshly retrieves/fetches the resource attributes and invokes
_parse_attributes()
method on successful retrieval.
It is recommended not to override this method in concrete ResourceBase
classes. Resource classes can place their refresh specific operations
in _do_refresh()
method, if needed. This method represents the
template method in the paradigm of Template design pattern.
Parameters: | force – if set to False, will only refresh if the resource is marked as stale, otherwise neither it nor its subresources will be refreshed. |
---|---|
Raises: | ResourceNotFoundError |
Raises: | ConnectionError |
Raises: | HTTPError |
sushy.resources.base.
ResourceCollectionBase
(connector, path, redfish_version=None)¶Bases: sushy.resources.base.ResourceBase
get_member
(identity)¶Given the identity return a _resource_type
object
Parameters: | identity – The identity of the _resource_type |
---|---|
Returns: | The _resource_type object |
Raises: | ResourceNotFoundError |
get_members
()¶Return a list of _resource_type
objects present in collection
Returns: | A list of _resource_type objects |
---|
members_identities
= <sushy.resources.base.Field object>¶A tuple with the members identities
name
= <sushy.resources.base.Field object>¶The name of the collection
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.