Created
December 14, 2020 20:23
-
-
Save larkintuckerllc/d7d885301085c77cfd0fb33715bca67f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Interact with Google Cloud SDK""" | |
from os import environ | |
from google.cloud import storage | |
from google.oauth2.credentials import Credentials | |
def interact(): | |
access_token = environ.get('ACCESS_TOKEN') | |
credentials = Credentials(access_token) if access_token is not None else None | |
storage_client = storage.Client(project='hello-accounts', credentials=credentials) | |
buckets = storage_client.list_buckets() | |
for bucket in buckets: | |
print(bucket.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment