4.7.2.2. Models

Authentication models.

class axonius_api_client.auth.models.Model[source]

Bases: object

Abstract base class for all Authentication methods.

abstract login()[source]

Login to API.

abstract logout()[source]

Logout from API.

abstract check_login()[source]

Throw exc if not logged in.

abstract property http: Http

Get Http object.

abstract property is_logged_in: bool

Check if login has been called.

class axonius_api_client.auth.models.Mixins(http, creds, **kwargs)[source]

Bases: Model

Mixins for Auth Models.

Parameters
__init__(http, creds, **kwargs)[source]

Mixins for Auth Models.

Parameters
LOG: logging.Logger

Logger for this object.

property http: Http

Get HttpClient object.

logout()[source]

Logout from API.

check_login()[source]

Check if login has been called.

Raises

NotLoggedIn – When login has not been called before trying to make a call with this Auth model.

property is_logged_in: bool

Check if login has been called.

get_api_keys()[source]

Get the API key and secret for the current user.

Return type

dict

property endpoints: ApiEndpoints(groups=['instances', 'central_core', 'system_settings', 'remote_support', 'system_users', 'system_roles', 'lifecycle', 'adapters', 'signup', 'password_reset', 'audit_logs', 'enforcements', 'saved_queries', 'assets', 'openapi', 'data_scopes', 'dashboard_spaces', 'folders_queries', 'folders_enforcements', 'account'])

Get the endpoint group for this module.

_validate()[source]

Validate credentials.

__str__()[source]

Show object info.

Return type

str

__repr__()[source]

Show object info.

Return type

str

abstract login()

Login to API.

_check_http_lock()[source]

Check HTTP client not already used by another Auth.

Raises

AuthError – When the HTTP client supplied is already being used by another Auth method.

_get_api_keys(**http_args)[source]

Direct API method to get the API keys for the current user.

Return type

dict

_set_http_lock()[source]

Set HTTP Client auth lock.