oss

阿里云使用

June 13, 2024
oss

oss 对象存储 # Python SDK # pip install oss2 export OSS_ACCESS_KEY_ID=SIHDoisdhuasuiUGDS export OSS_ACCESS_KEY_SECRET=asdih213asHSIDH2e1 一、Auth # import oss2 from oss2.credentials import EnvironmentVariableCredentialsProvider from itertools import islice auth = oss2.ProviderAuth(EnvironmentVariableCredentialsProvider()) 二、Bucket # bucket_info 字段说明 # 字段 type 注释 {bucket_info.name} Bucket的名称 {bucket_info.storage_class} Bucket的存储类型 {bucket_info.creation_date} Bucket的创建时间 {bucket_info.intranet_endpoint} Bucket的内网Endpoint {bucket_info.extranet_endpoint} Bucket的外网Endpoint {bucket_info.owner.id} Bucket的拥有者ID {bucket_info.acl.grant} Bucket的ACL授权 {bucket_info.data_redundancy_type} Bucket的数据冗余类型 {bucket_info.access_monitor} Bucket的访问跟踪状态 代码示例 # # 查看Bucket service = oss2.Service(auth, 'oss-ap-xiaomengmai-1.aliyuncs.com') for b in oss2.BucketIterator(service): print(b.name) # bucket信息 bucket = oss2. ...