pytan3.auth_methods.
SessionId
(http_client, session, login_timeout=5, logout_timeout=5, expires_after=295, ver_check=True, lvl='info')[source]¶Bases: pytan3.auth_methods.CommonMixin
, pytan3.auth_methods.AuthMethod
Method that uses session id to interact with the ‘/auth’ API.
__init__
(http_client, session, login_timeout=5, logout_timeout=5, expires_after=295, ver_check=True, lvl='info')[source]¶Constructor.
Parameters: |
|
---|
get_version_req
()[source]¶Get the min, max, and eq version requirements of this class.
Notes
Dict can specify keys: “vmin”, “vmax”, “veq”.
This class method gets called by
pytan3.utils.versions.version_check_obj_req()
to perform version
checks.
Returns: | dict |
---|
get_args_required
()[source]¶Get all arguments used by this class that are required.
Returns: | list |
---|
get_args_secure
()[source]¶Get all arguments used by this class that need their prompt input hidden.
Returns: | list |
---|
token
¶Get a token.
Notes
If CommonMixin.logged_in
is False, can not login to get a
new one with just a session.
If CommonMixin.expired
is True, can not login to get
a new one with just a session.
If CommonMixin.logged_in
is True, and CommonMixin.last_used
is older than CommonMixin.revalidate_after
,
CommonMixin.validate()
to re-validate token.
If CommonMixin.validate()
fails validation, can not login
to get a new one with just a session.
Returns: | str |
---|
login
(**kwargs)[source]¶Send a login request to receive a token.
Raises: | exceptions.LoginError – If status code in response is not 200. |
---|---|
Returns: | str |
_abc_impl
= <_abc_data object>¶