[
https://issues.apache.org/jira/browse/AIRFLOW-3895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16785736#comment-16785736
]
ASF GitHub Bot commented on AIRFLOW-3895:
-----------------------------------------
ashb commented on pull request #4717: [AIRFLOW-3895] GoogleCloudStorageHook
create_bucket with optional request body
URL: https://github.com/apache/airflow/pull/4717
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> 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)