[ 
https://issues.apache.org/jira/browse/AIRFLOW-3895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16785737#comment-16785737
 ] 

ASF subversion and git services commented on AIRFLOW-3895:
----------------------------------------------------------

Commit 36a6305271f8c61f819f616550a44bab2c0ae8ab in airflow's branch 
refs/heads/master from Ole Christian Langfjæran
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=36a6305 ]

[AIRFLOW-3895] GoogleCloudStorageHook/Op create_bucket takes optional resource 
params (#4717)

This makes it possible to supply missing request-parameters when
creating a bucket in Google Cloud Storage


> GoogleCloudStorageHook.create_bucket with optional request body
> ---------------------------------------------------------------
>
>                 Key: AIRFLOW-3895
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-3895
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: hooks
>    Affects Versions: 1.10.2
>            Reporter: Ole Christian Langfjæran
>            Priority: Trivial
>
> When creating a new bucket in Google Cloud Storage, 
> GoogleCloudStorageHook.create_bucket, I would like to have the option of 
> supplying missing parameters.
> For instance, the field 
> [lifecycle|https://cloud.google.com/storage/docs/json_api/v1/buckets#lifecycle]
>  is not available. 
> My suggestion to supply this is to add an optional dict to the parameters 
> that gets overwritten with bucket_name, storage_class and collection.
> For example like so:
> {{def create_bucket(self,}}
> {{     bucket_name,}}
> {{     resource=None,}}
> {{     storage_class='MULTI_REGIONAL',}}
> {{     location='US',}}
> {{     project_id=None,}}
> {{     labels=None):}}
> ....
> {{     service = self.get_conn()}}
> {{     bucket_resource = copy.copy(resource)}}
> {{     bucket_resource.update({}}
> {{          'name': bucket_name,}}
> {{          'location': location,}}
> {{          'storageClass': storage_class}}
> {{     })}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to