예제 #1
0
    def __init__(self, bucket, local_path, content_type):
        super().__init__(bucket)
        self.content_type = content_type
        self.local_path = local_path
        self.client = boto3.client('s3')
        self.bucket = bucket

        config = Config()
        config.signature_version = UNSIGNED
        self.url_generator = boto3.client('s3', config=config)
 def get_S3_client(region=None):
     config = Config(signature_version=botocore.UNSIGNED)
     config.signature_version = botocore.UNSIGNED
     if region is None:
         s3_client = boto3.client('s3')
     else:
         s3_client = boto3.client(
             's3',
             config=Config(signature_version=botocore.UNSIGNED),
             region_name=region)
     return s3_client
예제 #3
0
    def __init__(self, bucket, flo, filename, content_type):
        super().__init__(bucket)
        self.filename = filename
        self.flo = flo
        self.content_type = content_type
        self.client = boto3.client('s3')
        self.bucket = bucket

        config = Config()
        config.signature_version = UNSIGNED
        self.url_generator = boto3.client('s3', config=config)
예제 #4
0
    def __init__(self, endpoint, region, access_key, secret, bucket):
        self.bucket = bucket
        self.secret = secret
        self.access_key = access_key
        self.region = region
        self.endpoint = endpoint

        config = Config()
        config.signature_version = UNSIGNED

        self.s3 = boto3.client(
            service_name='s3',
            endpoint_url=self.endpoint,
            region_name=self.region,
            aws_access_key_id=self.access_key,
            aws_secret_access_key=self.secret)

        self.url_generator = boto3.client('s3', config=config)