The async_api.py module#

Summary#

AsyncDataTransferApi

Provides a wrapper for the Data Transfer Worker REST API, offering an async interface.

log

Description#

Provides asynchronous API functionality for interacting with the Ansys HPS data transfer client.

This module includes methods and utilities for performing data transfer operations asynchronously, managing resources, and handling client interactions.

Module detail#

class async_api.AsyncDataTransferApi(client: ansys.hps.data_transfer.client.client.AsyncClient)#

Provides a wrapper for the Data Transfer Worker REST API, offering an async interface.

Overview#

status

Provides an async interface to get the status of the worker.

operations

Provides an async interface to get a list of operations by their IDs.

storages

Provides an async interface to get the list of storage configurations.

copy

Provides an async interface to copy a list of SrcDst objects.

exists

Provides an async interface to check if a list of StoragePath objects exist.

list

Provides an async interface to get a list of StoragePath objects.

mkdir

Provides an async interface to create a list of directories in the remote backend.

move

Provides an async interface to move a list of SrcDst objects in the remote backend.

remove

Provides an async interface to remove files in the remote backend.

rmdir

Provides an async interface to remove directories in the remote backend.

check_permissions

Provides an async interface to check permissions of a list of RoleAssignment objects.

get_permissions

Provides an async interface to get permissions of a list of RoleQuery objects.

remove_permissions

Provides an async interface to remove permissions of a list of RoleAssignment objects.

set_permissions

Provides an async interface to set permissions of a list of RoleAssignment objects.

get_metadata

Provides an async interface to get metadata of a list of StoragePath objects.

set_metadata

Provides an async interface to set metadata of a list of DataAssignment objects.

wait_for

Provides an async interface to wait for a list of operations to complete.

Import detail#

from ansys.hps.data_transfer.client.api.async_api import AsyncDataTransferApi

Attribute detail#

AsyncDataTransferApi.dump_mode = 'json'#
AsyncDataTransferApi.client#

Method detail#

async AsyncDataTransferApi.status(wait=False, sleep=5, jitter=True, timeout: float | None = 20.0)#

Provides an async interface to get the status of the worker.

async AsyncDataTransferApi.operations(ids: list[str])#

Provides an async interface to get a list of operations by their IDs.

async AsyncDataTransferApi.storages()#

Provides an async interface to get the list of storage configurations.

async AsyncDataTransferApi.copy(operations: list[ansys.hps.data_transfer.client.models.msg.SrcDst])#

Provides an async interface to copy a list of SrcDst objects.

async AsyncDataTransferApi.exists(operations: list[ansys.hps.data_transfer.client.models.msg.StoragePath])#

Provides an async interface to check if a list of StoragePath objects exist.

async AsyncDataTransferApi.list(operations: list[ansys.hps.data_transfer.client.models.msg.StoragePath])#

Provides an async interface to get a list of StoragePath objects.

async AsyncDataTransferApi.mkdir(operations: list[ansys.hps.data_transfer.client.models.msg.StoragePath])#

Provides an async interface to create a list of directories in the remote backend.

async AsyncDataTransferApi.move(operations: list[ansys.hps.data_transfer.client.models.msg.SrcDst])#

Provides an async interface to move a list of SrcDst objects in the remote backend.

async AsyncDataTransferApi.remove(operations: list[ansys.hps.data_transfer.client.models.msg.StoragePath])#

Provides an async interface to remove files in the remote backend.

async AsyncDataTransferApi.rmdir(operations: list[ansys.hps.data_transfer.client.models.msg.StoragePath])#

Provides an async interface to remove directories in the remote backend.

async AsyncDataTransferApi.check_permissions(permissions: list[ansys.hps.data_transfer.client.models.permissions.RoleAssignment])#

Provides an async interface to check permissions of a list of RoleAssignment objects.

async AsyncDataTransferApi.get_permissions(permissions: list[ansys.hps.data_transfer.client.models.permissions.RoleQuery])#

Provides an async interface to get permissions of a list of RoleQuery objects.

async AsyncDataTransferApi.remove_permissions(permissions: list[ansys.hps.data_transfer.client.models.permissions.RoleAssignment])#

Provides an async interface to remove permissions of a list of RoleAssignment objects.

async AsyncDataTransferApi.set_permissions(permissions: list[ansys.hps.data_transfer.client.models.permissions.RoleAssignment])#

Provides an async interface to set permissions of a list of RoleAssignment objects.

async AsyncDataTransferApi.get_metadata(paths: list[str | ansys.hps.data_transfer.client.models.msg.StoragePath])#

Provides an async interface to get metadata of a list of StoragePath objects.

async AsyncDataTransferApi.set_metadata(asgs: dict[str | ansys.hps.data_transfer.client.models.msg.StoragePath, ansys.hps.data_transfer.client.models.metadata.DataAssignment])#

Provides an async interface to set metadata of a list of DataAssignment objects.

async AsyncDataTransferApi.wait_for(operation_ids: list[str | ansys.hps.data_transfer.client.models.ops.Operation], timeout: float | None = None, interval: float = 0.1, cap: float = 2.0, raise_on_error: bool = False, progress_handler: collections.abc.Callable[[str, float], collections.abc.Awaitable[None]] = None)#

Provides an async interface to wait for a list of operations to complete.

Parameters:
operation_ids: list[str | Operation]

The list of operation ids to wait for.

timeout: float | None

The maximum time to wait for the operations to complete.

interval: float

The interval between checks for the operations to complete.

cap: float

The maximum backoff value used to calculate the next wait time. Default is 2.0.

raise_on_error: bool

Raise an exception if an error occurs. Default is False.

progress_handler: Callable[[str, float], None]

A async function to handle progress updates. Default is None.

AsyncDataTransferApi.log#