Authentication Module

Authentication module can be used to generate API authentication token.

Client Module

class Client(auth_token, project=None)

Client class provides access to device, package, volume and deployment classes.

__init__(auth_token, project=None)

Get new client object

Parameters
  • auth_token (string) – Authentication token

  • project (string) – project_guid of the user

static get_auth_token(email, password, token_level=AuthTokenLevel.LOW)

Generate and fetch a new API Authentication Token.

Parameters
  • email (str) – Email of the user account.

  • password (str) – User password for the account.

  • token_level (AuthTokenLevel) – Level of the token. This corresponds to token validity

Returns

str

Following example demonstrates how to get auth token

>>> from rapyuta_io import Client
>>> from rapyuta_io.clients.rip_client import AuthTokenLevel
>>> auth_token = Client.get_auth_token('email@example.com', 'password', AuthTokenLevel.MED)
>>> client = Client(auth_token, 'project-id')
get_authenticated_user()

Get details for authenticated User.

Return type

User

Following example demonstrates how to get authenticated user details.

>>> from rapyuta_io import Client
>>> client = Client(auth_token='auth_token', project='project_guid')
>>> user = client.get_authenticated_user()