The sushy.auth Module¶
-
class
sushy.auth.AuthBase(username=None, password=None)¶ Bases:
object-
authenticate()¶ Perform authentication.
Raises: RuntimeError
-
can_refresh_session()¶ Method to assert if session based refresh can be done.
-
close()¶ Shutdown Redfish authentication object
Undoes whatever should be undone to cancel authenticated session.
-
set_context(root_resource, connector)¶ Set the context of the authentication object.
Parameters: - root_resource – Root sushy object
- connector – Connector for http connections
-
-
class
sushy.auth.BasicAuth(username=None, password=None)¶ Bases:
sushy.auth.AuthBaseBasic Authentication class.
This is a class used to encapsulate a basic authentication session.
Parameters: - username – User account with admin/server-profile access privilege.
- password – User account password.
-
can_refresh_session()¶ Method to assert if session based refresh can be done.
-
class
sushy.auth.SessionAuth(username=None, password=None)¶ Bases:
sushy.auth.AuthBaseSession Authentication class.
This is a class used to encapsulate a redfish session.
-
can_refresh_session()¶ Method to assert if session based refresh can be done.
-
close()¶ Close the Redfish Session.
Attempts to close an established RedfishSession by deleting it from the remote Redfish controller.
-
get_session_key()¶ Returns the session key.
Returns: The session key.
-
get_session_resource_id()¶ Returns the session resource id.
Returns: The session resource id.
-
refresh_session()¶ Method to refresh a session to a Redfish controller.
This method is called to create a new session after a session that has already been established has timed-out or expired.
Raises: MissingXAuthToken Raises: ConnectionError Raises: AccessError Raises: HTTPError
-
reset_session_attrs()¶ Reset active session related attributes.
-
-
class
sushy.auth.SessionOrBasicAuth(username=None, password=None)¶ Bases:
sushy.auth.SessionAuth-
refresh_session()¶ Method to refresh a session to a Redfish controller.
This method is called to create a new RedfishSession if we have previously established a RedfishSession and the previous session has timed-out or expired. If we did not previously have an established session, we simply return our BasicAuthentication requests.Session.
-