本文整理汇总了Python中azure.storage.blob.BlobService.get_container_acl方法的典型用法代码示例。如果您正苦于以下问题:Python BlobService.get_container_acl方法的具体用法?Python BlobService.get_container_acl怎么用?Python BlobService.get_container_acl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类azure.storage.blob.BlobService
的用法示例。
在下文中一共展示了BlobService.get_container_acl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: identifier
# 需要导入模块: from azure.storage.blob import BlobService [as 别名]
# 或者: from azure.storage.blob.BlobService import get_container_acl [as 别名]
storage_container_name,
'sample.log',
example_file_path,
)
# Create a new signed identifier (policy)
si = SignedIdentifier()
# Set the name
si.id = policy_name
# Set the expiration date
si.access_policy.expiry = '2016-01-01'
# Set the permissions. Read and List in this example
si.access_policy.permission = ContainerSharedAccessPermissions.READ + ContainerSharedAccessPermissions.LIST
# Get the existing signed identifiers (policies) for the container
identifiers = blob_service.get_container_acl(storage_container_name)
# And append the new one ot the list
identifiers.signed_identifiers.append(si)
# Set the container to the updated list of signed identifiers (policies)
blob_service.set_container_acl(
container_name=storage_container_name,
signed_identifiers=identifiers,
)
# Generate a new Shared Access Signature token using the
sas_token = blob_service.generate_shared_access_signature(
container_name=storage_container_name,
shared_access_policy=SharedAccessPolicy(signed_identifier=policy_name),
)
开发者ID:hning86,项目名称:hdinsight-dotnet-python-azure-storage-shared-access-signature,代码行数:32,代码来源:SASToken.py