The sushy.auth Module

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.

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.AuthBase

Basic 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.AuthBase

Session 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.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.