Update documentation related to 'refresh()'

Update the documentation with the relevant changes pertaining to
the new behaviour of ResourceBase.refresh() [0] method.

Also, removed CPU and memory information from 'Missing Features'
portion as those are available now.

[0] Commit patch 2b39751e19

Change-Id: Ifb81e0c58d70097eda1f65c9dbec13803056111c
This commit is contained in:
Debayan Ray 2018-01-05 04:48:04 -05:00
parent 92f79530b9
commit b4cb4aaaa8
2 changed files with 21 additions and 5 deletions

View File

@ -22,7 +22,7 @@ Missing Features
These are some features that sushy is presently missing.
* Collect sensor data (Health state, temperature, fans etc...)
* System inspection (Number of CPUs, memory and disk size)
* System disk size
* Serial console
Sushy Python API Reference

View File

@ -47,6 +47,14 @@ Creating and using a sushy system object
sys_inst = sys_col.get_member(sys_col.members_identities[0])
# Refresh the system collection object
#
# In order to reload a resource post its initialization it has to be marked
# as stale (i.e. invoking 'invalidate()') first and then 'refresh()' has to
# be called. This will only reload the resource w/o reloading/refreshing its
# sub-resources (lazy-refresh of sub-resources).
# Note that calling 'refresh()' only, i.e. w/o calling 'invalidate()' first,
# will be a no-op wrt resource reload in this case.
sys_col.invalidate()
sys_col.refresh()
@ -59,8 +67,15 @@ Creating and using a sushy system object
# Get a list of allowed reset values
print(sys_inst.get_allowed_reset_system_values())
# Refresh the system object
sys_inst.refresh()
# Refresh the system object (with all its sub-resources)
#
# Alternatively, this is the other way of reloading a resource object:
# The resource can be reloaded w/o the need of marking it stale
# (i.e. not invoking 'invalidate()'). It is achieved when the "force"
# argument of 'refresh()' method is set to True. Do note that the
# sub-resources of the resource being reloaded will also get reloaded
# (greedy-refresh of sub-resources) when this mode is adopted.
sys_inst.refresh(force=True)
# Get the current power state
print(sys_inst.power_state)
@ -126,6 +141,7 @@ Creating and using a sushy manager object
mgr_inst = mgr_col.get_member(mgr_col.members_identities[0])
# Refresh the manager collection object
mgr_col.invalidate()
mgr_col.refresh()
@ -147,8 +163,8 @@ Creating and using a sushy manager object
# Reset the manager
mgr_inst.reset_manager(sushy.RESET_MANAGER_FORCE_RESTART)
# Refresh the manager object
mgr_inst.refresh()
# Refresh the manager object (with all its sub-resources)
mgr_inst.refresh(force=True)
If you do not have any real baremetal machine that supports the Redfish