pypicloud.storage.azure_blob module¶
Store packages in Azure Blob Storage
- class pypicloud.storage.azure_blob.AzureBlobStorage(request, expire_after=None, path_prefix=None, redirect_urls=None, storage_account_name=None, storage_account_key=None, storage_container_name=None)[source]¶
Bases:
IStorage
Storage backend that uses Azure Blob Storage
- check_health()[source]¶
Check the health of the storage backend
- Returns
- (healthy, status)(bool, str)
Tuple that describes the health status and provides an optional status message
- download_response(package)[source]¶
Return a HTTP Response that will download this package
This is called from the download endpoint
- list(factory=<class 'pypicloud.models.Package'>)[source]¶
Return a list or generator of all packages
- open(package)[source]¶
Get a buffer object that can read the package data
This should be a context manager. It is used in migration scripts, not directly by the web application.
- Parameters
- package
Package
- package
Examples
with storage.open(package) as pkg_data: with open('outfile.tar.gz', 'w') as ofile: ofile.write(pkg_data.read())