sushy.resources.base
Module¶sushy.resources.base.
AbstractJsonReader
¶Bases: object
get_json
()¶Based on data source get data and parse to JSON
set_connection
(connector, path)¶Sets mandatory connection parameters
Parameters: |
|
---|
sushy.resources.base.
CompositeField
(*args, **kwargs)¶Bases: collections.abc.Mapping
, sushy.resources.base.Field
Base class for fields consisting of several sub-fields.
sushy.resources.base.
DictionaryField
(*args, **kwargs)¶Bases: sushy.resources.base.Field
Base class for fields consisting of dictionary of several sub-fields.
sushy.resources.base.
Field
(path, required=False, default=None, adapter=<function Field.<lambda>>)¶Bases: object
Definition for fields fetched from JSON.
sushy.resources.base.
JsonArchiveReader
(archive_file)¶Bases: sushy.resources.base.AbstractJsonReader
Gets the data from JSON file in archive
get_json
()¶Gets JSON file from archive. Currently supporting ZIP only
sushy.resources.base.
JsonDataReader
¶Bases: sushy.resources.base.AbstractJsonReader
Gets the data from HTTP response given by path
get_json
()¶Gets JSON file from URI directly
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, reader=None)¶Bases: object
get_oem_extension
(vendor)¶Get the OEM extension instance for this resource by OEM vendor
Parameters: | vendor – the OEM vendor string which is the vendor-specific
extensibility identifier. Examples are ‘Contoso’, ‘Hpe’.
Possible value can be got from oem_vendors attribute. |
---|---|
Returns: | the Redfish resource OEM extension instance. |
Raises: | OEMExtensionNotFoundError |
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
¶oem_vendors
= <sushy.resources.base.Field object>¶The list of OEM extension names for this resource.
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 |
resource_name
¶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.