# acl operation samples ###################################################################################################### # set bucket canned acl to "private" bos_client.set_bucket_canned_acl(bucket_name, canned_acl.PRIVATE) # get bucket acl response = bos_client.get_bucket_acl(bucket_name) __logger.debug("[Sample] get bucket acl owner id:%s", response.owner_id) __logger.debug("[Sample] get bucket acl:%s", response.access_control_list) # set bucket acl from BucketAccessControl list bos_client.set_bucket_acl(bucket_name, [{ 'grantee': [{ 'id': 'b124deeaf6f641c9ac27700b41a350a8' }, { 'id': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }], 'permission': ['FULL_CONTROL'] }]) # get bucket acl and see if it affects response = bos_client.get_bucket_acl(bucket_name) __logger.debug("[Sample] get bucket acl owner id:%s", response.owner_id) __logger.debug("[Sample] get bucket acl:%s", response.access_control_list) ###################################################################################################### # multi-upload operation samples ###################################################################################################### # put a super file to object _create_file(file_name, 10 * 1024 * 1024)
###################################################################################################### # acl operation samples ###################################################################################################### # set bucket canned acl to "private" bos_client.set_bucket_canned_acl(bucket_name, canned_acl.PRIVATE) # get bucket acl response = bos_client.get_bucket_acl(bucket_name) __logger.debug("[Sample] get bucket acl owner id:%s", response.owner_id) __logger.debug("[Sample] get bucket acl:%s", response.access_control_list) # set bucket acl from BucketAccessControl list bos_client.set_bucket_acl( bucket_name, [{'grantee': [{'id': 'b124deeaf6f641c9ac27700b41a350a8'}, {'id': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'}], 'permission': ['FULL_CONTROL']}]) # get bucket acl and see if it affects response = bos_client.get_bucket_acl(bucket_name) __logger.debug("[Sample] get bucket acl owner id:%s", response.owner_id) __logger.debug("[Sample] get bucket acl:%s", response.access_control_list) ###################################################################################################### # multi-upload operation samples ###################################################################################################### # put a super file to object _create_file(file_name, 10 * 1024 * 1024)
# acl operation samples ###################################################################################################### # set bucket canned acl to "private" bos_client.set_bucket_canned_acl(bucket_name, canned_acl.PRIVATE) # get bucket acl response = bos_client.get_bucket_acl(bucket_name) __logger.debug("[Sample] get bucket acl owner id:%s", response.owner_id) __logger.debug("[Sample] get bucket acl:%s", response.access_control_list) # set bucket acl from BucketAccessControl list bos_client.set_bucket_acl(bucket_name, [{ 'grantee': [{ 'id': 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' }, { 'id': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }], 'permission': ['FULL_CONTROL'] }]) # get bucket acl and see if it affects response = bos_client.get_bucket_acl(bucket_name) __logger.debug("[Sample] get bucket acl owner id:%s", response.owner_id) __logger.debug("[Sample] get bucket acl:%s", response.access_control_list) ###################################################################################################### # multi-upload operation samples ###################################################################################################### # put a super file to object _create_file(file_name, 10 * 1024 * 1024)