synology_apm_repo.sdk.storage.azure module

AzureStore — an ObjectStore implementation for Azure Blob Storage with the same contract and lazy-import pattern as S3Store; list_containers mirrors its list_buckets().

The aiohttp-based client owns a session that AzureStore.close must close. Every client gets _with_default_timeouts’ interactive-friendly settings.

class synology_apm_repo.sdk.storage.azure.AzureStoreDescriptor(container, client_kwargs)

Bases: object

Picklable recipe for rebuilding an equivalent AzureStore.

container: str
client_kwargs: dict[str, Any]
build()
class synology_apm_repo.sdk.storage.azure.AzureStore(container, *, client=None, **client_kwargs)

Bases: AsyncClosing

An Azure Blob Storage container, addressed by "/"-separated paths relative to the container root.

client, if given, is used as-is (tests inject a mocked BlobServiceClient) and is not closed by close; otherwise one is built from client_kwargs (most commonly account_url plus one of credential/connection_string), with a plain-string credential resolved by _resolve_shared_key_credential.

descriptor()

How a worker process rebuilds this store; None for one built on an injected client, which has no picklable recipe.

async close()

Close the underlying aiohttp transport.

Only for a client this class built itself — an injected client belongs to whoever created it. Safe to call more than once.

async read(path, offset=0, length=None)
async size(path)
async exists(path)

True for a blob exactly at path or a “directory” (a prefix with at least one blob under it). layout.py relies on the latter: db/@data are only prefixes here.

async listdir(path)

Immediate entries under path, each blob with its size from the listing; a virtual directory prefix has no size. An absent prefix and an empty one are indistinguishable, so both return [], as in S3Store.listdir.

async synology_apm_repo.sdk.storage.azure.list_containers(**client_kwargs)

Every container visible to these credentials (AzureStore is scoped to one container). Uses a transient client, closed before returning.

Parameters:

**client_kwargs (Any) – What a caller would pass to AzureStore.

Returns:

Container names, sorted.

Raises:
Return type:

list[str]