services
The compute client module contains the main classes to interact with the Arraylake compute service.
For asynchronous operations, the AsyncComputeClient
class is recommended,
while the ComputeClient
class should be used for synchronous operations.
Example usage:
from arraylake import Client
services = Client().get_services("my-org")
services.list_enabled()
AsyncComputeClient​
Asyncio Client for interacting with the Arraylake Compute API for a specific organization.
__init__​
def __init__(service_uri: str, token: str | None, org: str)
Initializes the AsyncComputeClient with the service URI, API token, and organization.
Arguments:
service_uri: The service URI to target. token: API token for service account authentication. org: The organization to target.
enable​
async def enable(protocol: str,
is_public: bool = False,
**kwargs) -> dict[str, Any]
Enables a new Arraylake compute service.
list_enabled​
async def list_enabled() -> list[DeploymentInfo]
Lists all of the Arraylake compute services for the organization.
get_status​
async def get_status(service_id: str) -> dict[str, Any]
Gets the status of an Arraylake compute service.
get_logs​
async def get_logs(service_id: str) -> str
Gets a snapshot of the logs of an Arraylake compute service.
disable​
async def disable(service_id: str) -> dict[str, Any]
Disables an Arraylake compute service.
ComputeClient​
Synchronous interface for interacting with the Arraylake Compute API.
__init__​
def __init__(aclient: AsyncComputeClient)
Initializes the ComputeClient with an existing AsyncComputeClient instance.
Arguments:
aclient
- An existing AsyncComputeClient instance.
enable​
def enable(protocol: str, is_public: bool = False, **kwargs) -> dict[str, Any]
Enables a new Arraylake compute service.
Arguments:
protocol
- The protocol to use. Must be one of dap2, edr, wms, or zarr.is_public
- Whether the service should be public or not. Defaults to False.**kwargs
- Additional arguments to pass to the service.
Returns:
Confirmation of the service being enabled.
list_enabled​
def list_enabled() -> list[DeploymentInfo]
Lists all of the Arraylake compute services for the organization.
Returns:
The list of services in the organization.
get_status​
def get_status(service_id: str) -> dict[str, Any]
Gets the status of an Arraylake compute service.
Arguments:
org
- The organization where the service is located.service_id
- The ID of the service to get status for.
Returns:
Dictionary containing the status of the service.
get_logs​
def get_logs(service_id: str) -> str
Gets a snapshot of the logs of an Arraylake compute service.
Arguments:
service_id
- The ID of the service to get logs for.
Returns:
The kubernetes logs for the service.
disable​
def disable(service_id: str) -> dict[str, Any]
Disables an Arraylake compute service..
Arguments:
service_id
- The ID of the service to disable.
Returns:
Confirmation of the service being disabled.