ABEJA SDK is Libirary for python, which allow developers to create, get and delete ABEJA Platform resources.
Contents:
There are two ways to set credential information for ABEJA Platform SDK usage.
ABEJA Platform SDK reads env vars with keys below and use these as credential information.
Variable Name |
Description |
---|---|
ABEJA_ORGANIZATION_ID |
Organization Identifier |
ABEJA_PLATFORM_USER_ID |
User Identifier (which starts with user- ) |
ABEJA_PLATFORM_PERSONAL_ACCESS_TOKEN |
User’s Personal Access Token |
ABEJA Platform SDK Client accepts credential information when instantiating. It is required to passing parameters in different way between high level interface and low level interface.
from abeja.datalake import Client
organization_id = '1234567890123'
credential = {
'user_id': 'user-1234567890123',
'personal_access_token': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
client = Client(organization_id=organization_id, credential=credential)
channel = client.get_channel(channel_id='9999999999999')
You can set connection_timeout and max_retry_count to Client.
from abeja.datalake import Client
organization_id = '1234567890123'
credential = {
'user_id': 'user-1234567890123',
'personal_access_token': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
client = Client(organization_id=organization_id, credential=credential, timeout=60, max_retry_count=10)
from abeja.datalake import APIClient
organization_id = '1234567890123'
credential = {
'user_id': 'user-1234567890123',
'personal_access_token': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
client = APIClient(credential=credential)
channel = client.get_channel(organization_id=organization_id, channel_id='9999999999999')
You can set connection_timeout and max_retry_count to APIClient.
from abeja.datalake import APIClient
organization_id = '1234567890123'
credential = {
'user_id': 'user-1234567890123',
'personal_access_token': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
client = APIClient(credential=credential, timeout=60, max_retry_count=10)
ABEJA Platform SDK reads env vars with keys below and use as http request parameters.
Variable Name |
Description |
---|---|
ABEJA_SDK_CONNECTION_TIMEOUT |
Connection timeout of http request to API. Specify in seconds. Default is 30. |
ABEJA_SDK_MAX_RETRY_COUNT |
Max retry count of http request to API. Default is 5. |
There are multiple ways to pass the credentials that are checked in the following order/priority.
credential passed in client object initialization.
PLATFORM_AUTH_TOKEN in environment variables.
ABEJA_PLATFORM_USER_ID and ABEJA_PLATFORM_PERSONAL_ACCESS_TOKEN in environment variables.
Priority of connetion_timeout and max_retry_count is as below.
connetion_timeout / max_retry_count passed as argument to Client and APIClient
Environment variables.
Default values.