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:
objectPicklable recipe for rebuilding an equivalent
AzureStore.- build()¶
- class synology_apm_repo.sdk.storage.azure.AzureStore(container, *, client=None, **client_kwargs)¶
Bases:
AsyncClosingAn Azure Blob Storage container, addressed by
"/"-separated paths relative to the container root.client, if given, is used as-is (tests inject a mockedBlobServiceClient) and is not closed byclose; otherwise one is built fromclient_kwargs(most commonlyaccount_urlplus one ofcredential/connection_string), with a plain-stringcredentialresolved by_resolve_shared_key_credential.- descriptor()¶
How a worker process rebuilds this store;
Nonefor one built on an injectedclient, which has no picklable recipe.
- async close()¶
Close the underlying
aiohttptransport.Only for a client this class built itself — an injected
clientbelongs to whoever created it. Safe to call more than once.
- async read(path, offset=0, length=None)¶
- async size(path)¶
- async exists(path)¶
Truefor a blob exactly atpathor a “directory” (a prefix with at least one blob under it).layout.pyrelies on the latter:db/@dataare only prefixes here.
- async listdir(path)¶
Immediate entries under
path, each blob with itssizefrom the listing; a virtual directory prefix has no size. An absent prefix and an empty one are indistinguishable, so both return[], as inS3Store.listdir.
- async synology_apm_repo.sdk.storage.azure.list_containers(**client_kwargs)¶
Every container visible to these credentials (
AzureStoreis 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:
PermissionDeniedError – The credential lacks account-level list permission (a container-scoped SAS token, say).
StorageBackendError – The request failed otherwise.
- Return type: