Exemple #1
0
 def __init__(self, *args, **kwargs):
     super(CosFileSystem, self).__init__(*args, **kwargs)
     if CosFtpConfig().host is not None:
         self._cos_client = CosS3Client(CosConfig(
             Region=None,
             Access_id=CosFtpConfig().secretid,
             Access_key=CosFtpConfig().secretkey,
         ),
                                        retry=3)
     else:
         self._cos_client = CosS3Client(CosConfig(
             Region=CosFtpConfig().region,
             Access_id=CosFtpConfig().secretid,
             Access_key=CosFtpConfig().secretkey,
         ),
                                        retry=3)
     self._bucket_name = CosFtpConfig().bucket
 def __init__(self, *args, **kwargs):
     super(CosFileSystem, self).__init__(*args, **kwargs)
     self._cos_client = CosS3Client(CosConfig(
         Appid=CosFtpConfig().appid,
         Region=CosFtpConfig().region,
         Access_id=CosFtpConfig().secretid,
         Access_key=CosFtpConfig().secretkey),
                                    retry=3)
     self._bucket_name = CosFtpConfig().bucket
Exemple #3
0
 def __init__(self, *args, **kwargs):
     super(CosFileSystem, self).__init__(*args, **kwargs)
     self._cos_client = CosS3Client(CosConfig(
         Region=CosFtpConfig().get_user_info(self.root)['cos_region'],
         Endpoint=CosFtpConfig().get_user_info(self.root)['cos_endpoint'],
         Scheme=CosFtpConfig().get_user_info(self.root)['cos_protocol'],
         Access_id=CosFtpConfig().get_user_info(self.root)["cos_secretid"],
         Access_key=CosFtpConfig().get_user_info(
             self.root)['cos_secretkey'],
         UA=version.user_agent),
                                    retry=3)
     self._bucket_name = CosFtpConfig().get_user_info(self.root)["bucket"]
def test():
    cos_client = CosS3Client(
        CosConfig(Appid=CosFtpConfig().appid,
                  Access_id=CosFtpConfig().secretid,
                  Access_key=CosFtpConfig().secretkey,
                  Region=CosFtpConfig().region))
 def __init__(self):
     super(OssHelper, self).__init__()
     self.conf = CosConfig(SecretId=getattr(self.cred, 'secretId'),
                           SecretKey=getattr(self.cred, 'secretKey'),
                           Region=self.region)
     self.client = CosS3Client(self.conf)