salrashid123/gcpsamples
Simple "Hello world" samples for accessing Google Cloud APIs in (node,dotnet,java,golang,python)
GoApache-2.0
Issues
- 1
- 0
from google.cloud import storage import google.auth from google.oauth2 import service_account credentials = service_account.Credentials.from_service_account_file('YOUR_JSON_CERT.json') if credentials.requires_scopes: credentials = credentials.with_scopes(['https://www.googleapis.com/auth/devstorage.read_write']) client = storage.Client(credentials=credentials) buckets = client.list_buckets() for bkt in buckets: print bkt
#15 opened by cleverndbest - 0
from google.cloud import storage import google.auth impot os os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "YOUR_JSON_CERT.json" credentials, project = google.auth.default() if credentials.requires_scopes: credentials = credentials.with_scopes(['https://www.googleapis.com/auth/devstorage.read_write']) client = storage.Client(credentials=credentials) buckets = client.list_buckets() for bkt in buckets: print bkt
#14 opened by cleverndbest - 0
client = storage.Client() buckets = client.list_buckets() for bkt in buckets: print bktcd $GOPATH/src/cloud.google.com/go go list -m golang.org/x/oauth2
#12 opened by cleverndbest - 0
from google.cloud import storage import google.auth credentials, project = google.auth.default() client = storage.Client(credentials=credentials) buckets = client.list_buckets() for bkt in buckets: print bkt
#13 opened by cleverndbest - 0
Cloud Logging client is borked
#11 opened by DazWilkin - 2