mik-laj commented on issue #5939: [AIRFLOW-5335] Update GCSHook methods so they 
need min IAM perms
URL: https://github.com/apache/airflow/pull/5939#issuecomment-525836613
 
 
   Full example code: 
   ```
   import logging
   from google.cloud import storage
   
   logging.basicConfig(level=logging.DEBUG)
   
   client = storage.Client()
   print("Execute get_bucket")
   bucket = client.get_bucket('gcp-transfer-first-target')
   
   print("-"*80)
   
   print("Execute bucket")
   bucket = client.bucket('gcp-transfer-second-target')
   
   print("Execute reload")
   bucket.reload()
   ```
   Sample output: 
   ```
   Execute get_bucket
   DEBUG:urllib3.util.retry:Converted retries value: 3 -> Retry(total=3, 
connect=None, read=None, redirect=None, status=None)
   DEBUG:google.auth.transport.requests:Making request: POST 
https://oauth2.googleapis.com/token
   DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): 
oauth2.googleapis.com:443
   DEBUG:urllib3.connectionpool:https://oauth2.googleapis.com:443 "POST /token 
HTTP/1.1" 200 None
   DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): 
www.googleapis.com:443
   DEBUG:urllib3.connectionpool:https://www.googleapis.com:443 "GET 
/storage/v1/b/gcp-transfer-first-target?projection=noAcl HTTP/1.1" 200 563
   
--------------------------------------------------------------------------------
   Execute bucket
   Execute reload
   DEBUG:urllib3.connectionpool:https://www.googleapis.com:443 "GET 
/storage/v1/b/gcp-transfer-second-target?projection=noAcl HTTP/1.1" 200 561
   ```

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to