imerit_ango.sdk.SDK.
create_storage(storage_data)
Create storage
Parameters:
storage_data: Storage
Storage
provider: StorageProvider
region: string, default "eu-central-1"
Returns:
Example:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.storage import Storage
from imerit_ango.models.enums import StorageProvider
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
ango_sdk = SDK(api_key)
sdk_response = ango_sdk.create_storage(Storage(name="My Storage",
provider=StorageProvider.AWS,
public_key='<YOUR PUBLIC KEY>',
private_key='<YOUR PRIVATE KEY>',
region='<YOUR REGION>',
credentials='<YOUR CREDENTIALS>'))
delete_organization_invites(organization_id, invite_emails)
Delete organization invites
Parameters:
invite_emails: List[string]
Returns:
Example:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
organization_id = os.getenv('ORGANIZATION_ID')
ango_sdk = SDK(api_key)
sdk_respose = ango_sdk.delete_organization_invites(organization_id=organization_id,
invite_emails=["user@example.com"])
delete_organization_members(organization_id, member_emails)
Delete organization members
Parameters:
member_emails: List[string]
Returns:
Example:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
organization_id = os.getenv('ORGANIZATION_ID')
ango_sdk = SDK(api_key)
ango_sdk.delete_organization_members(organization_id=organization_id,
member_emails=["user1@example.com", "user2@example.com"])
delete_storage(storage_id)
Delete storage
Parameters:
Returns:
Example:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
ango_sdk = SDK(api_key)
storage_id = '<YOUR STORAGE ID>'
ango_sdk.delete_storage(storage_id=storage_id)
get_organization_invites(organization_id)
Get organization invites
Parameters:
Returns:
Example:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
organization_id = os.getenv('ORGANIZATION_ID')
ango_sdk = SDK(api_key)
sdk_response = ango_sdk.get_organization_invites(organization_id=organization_id)
invites = sdk_response['data']['invites']
get_organization_members(organization_id)
Get organization members
Parameters:
Returns:
Example:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
organization_id = os.getenv('ORGANIZATION_ID')
ango_sdk = SDK(api_key)
sdk_response = ango_sdk.get_organization_members(organization_id=organization_id)
members = sdk_response["data"]["users"]
get_storages(storage_id)
Get all the storages of the current organization.
Parameters:
storage_id: String, Optional, Default None
Returns:
Example:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
ango_sdk = SDK(api_key)
sdk_response = ango_sdk.get_storages()
storage_list = sdk_response['data']['storages']
Outputs:
{
"status": "success",
"data": {
"storages": [
{
"id": "<STORAGE ID>",
"name": "<STORAGE NAME>",
"provider": "GCP",
"createdAt": "2022-11-24T13:48:32.100Z",
"organization": "<ORGANIZATION ID>"
}
]
}
}
invite_members_to_org(organization_id, invite_data)
Invite members to the organization
Parameters:
invite_data: Invitation
Invitation
organizationRole: OrganizationRoles
projectRole: ProjectRoles
ProjectRoles
{Manager, Labeler, Reviewer, Lead}
Returns:
Example:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.invite import Invitation
from imerit_ango.models.enums import OrganizationRoles, ProjectRoles
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
organization_id = os.getenv('ORGANIZATION_ID')
project_id = os.getenv('PROJECT_ID')
ango_sdk = SDK(api_key)
ango_sdk.invite_members_to_org(organization_id=organization_id,
invite_data=Invitation(to=["user@example.com"],
organizationRole=OrganizationRoles.Member,
projectId=project_id,
projectRole=ProjectRoles.Labeler))
update_organization_members_role(organization_id, role_updates)
Update organization members' role
Parameters:
role_updates: List[RoleUpdate]
RoleUpdate
organizationRole: OrganizationRoles
Returns:
Example:
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK
from imerit_ango.models.invite import RoleUpdate
from imerit_ango.models.enums import OrganizationRoles
load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
organization_id = os.getenv('ORGANIZATION_ID')
ango_sdk = SDK(api_key)
role_update_1 = RoleUpdate(email="user1@example.com", organizationRole=OrganizationRoles.Admin)
role_update_2 = RoleUpdate(email="user2@example.com", organizationRole=OrganizationRoles.Admin)
sdk_response = ango_sdk.update_organization_members_role(organization_id=organization_id,
role_updates=[role_update_1, role_update_2])