Execution¶
NOTE: In order to run this example, an active Mat3ra.com account is required.
Set Parameters¶
USERNAME: Your Mat3ra account username.
PASSWORD: Your Mat3ra account password.
In [ ]:
Copied!
# @title Authorization Form
USERNAME = "YOUR_USERNAME" # @param {type:"string"}
# avoid storing password in plaintext
from getpass import getpass
PASSWORD = getpass("Please enter password: ")
import os
if "COLAB_JUPYTER_IP" in os.environ:
!GIT_BRANCH="dev"; export GIT_BRANCH; curl -s "https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh" | bash
# @title Authorization Form
USERNAME = "YOUR_USERNAME" # @param {type:"string"}
# avoid storing password in plaintext
from getpass import getpass
PASSWORD = getpass("Please enter password: ")
import os
if "COLAB_JUPYTER_IP" in os.environ:
!GIT_BRANCH="dev"; export GIT_BRANCH; curl -s "https://raw.githubusercontent.com/Exabyte-io/api-examples/${GIT_BRANCH}/scripts/env.sh" | bash
Import packages¶
In [ ]:
Copied!
from utils.settings import HOST, PORT, VERSION, SECURE
from utils.generic import display_JSON
from exabyte_api_client.endpoints.login import LoginEndpoint
from utils.settings import HOST, PORT, VERSION, SECURE
from utils.generic import display_JSON
from exabyte_api_client.endpoints.login import LoginEndpoint
Initialize the endpoint¶
In [ ]:
Copied!
endpoint = LoginEndpoint(HOST, PORT, USERNAME, PASSWORD, VERSION, SECURE)
auth_params = endpoint.login()
endpoint = LoginEndpoint(HOST, PORT, USERNAME, PASSWORD, VERSION, SECURE)
auth_params = endpoint.login()
In [ ]:
Copied!
display_JSON(auth_params)
display_JSON(auth_params)