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

Get Http object.

Return type

axonius_api_client.http.Http

abstract property is_logged_in

Check if login has been called.

Return type

bool

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

Bases: axonius_api_client.auth.models.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

Get HttpClient object.

Return type

axonius_api_client.http.Http

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

Check if login has been called.

Return type

bool

__str__()[source]

Show object info.

Return type

str

abstract login()

Login to API.

__repr__()[source]

Show object info.

Return type

str

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

_set_http_lock()[source]

Set HTTP Client auth lock.

_validate()[source]

Validate credentials.