Questions tagged [gcloud-python]

Google Cloud Client Library for Python - an idiomatic, intuitive, and natural way for Python developers to integrate with Google Cloud Platform services, like Cloud Datastore and Cloud Storage.

gcloud is a client library for accessing Google Cloud Platform services that significantly reduces the boilerplate code you have to write. The library provides high-level API abstractions so they're easier to understand. It embraces idioms of Python, works well with the standard library, and integrates better with your codebase. All this means you spend more time creating code that matters to you.

gcloud is configured to access Google Cloud Platform services and authorize (OAuth 2.0) automatically on your behalf. With a one-line install and a private key, you are up and ready to go. Better yet, if you are running on a Google Compute Engine instance, the one-line install is enough!

More information

60 questions
38
votes
5 answers

Google Cloud Storage + Python : Any way to list obj in certain folder in GCS?

I'm going to write a Python program to check if a file is in certain folder of my Google Cloud Storage, the basic idea is to get the list of all objects in a folder, a file name list, then check if the file abc.txt is in the file name list. Now the…
Reed_Xia
  • 1,300
  • 3
  • 17
  • 29
21
votes
1 answer

Upload File to Google Cloud Storage Bucket Sub Directory using Python

I have successfully implemented the python function to upload a file to Google Cloud Storage bucket but I want to add it to a sub-directory (folder) in the bucket and when I try to add it to the bucket name the code fails to find the folder.…
seanie_oc
  • 331
  • 2
  • 5
  • 15
19
votes
3 answers

Google Cloud Functions Deploy "allow unauthenticated invocations..."

Whenever I have to deploy a new python function using the gcloud sdk I get this message Allow unauthenticated invocations of new function [function-name]? (y/N)? WARNING: Function created with limited-access IAM policy. To enable unauthorized…
18
votes
5 answers

Google Cloud Storage Signed URLs with Google App Engine

It's frustrating to deal with the regular Signed URLs (Query String Authentication) for Google Cloud Storage. Google Cloud Storage Signed URLs Example -> Is this really the only code available in the whole internet for generating Signed URLs for…
17
votes
4 answers

GCloud Upload httplib2.RedirectMissingLocation: Redirected but the response is missing a Location: header

I am attempting to upload a small file to gcloud using a simple python program client = storage.Client(project=GCLOUD_PROJECT) bucket = client.get_bucket(GCLOUD_BUCKET) blob =…
mumshad
  • 409
  • 1
  • 7
  • 13
9
votes
3 answers

Set metadata in Google Cloud Storage using gcloud-python

I am trying to upload a file to Google Cloud Storage using gcloud-python and set some custom metadata properties. To try this I have created a simple script. import os from gcloud import storage client = storage.Client('super secret app…
7
votes
3 answers

Difficulty comparing generated and google cloud storage provided CRC32c checksums

I am attemptting to get a CRC32c checksum on my local file so I can compare it to the blob.crc32c provided by the gcloud library. Google says I should be using the crcmod module in order to actually calculate CRC32c hashes of my data.…
6
votes
1 answer

Google Cloud Datastore timeout errors in python

I have a table in Google Cloud Datastore where I store a small data structure which is written in one Python service and read in another. I am using gcloud version 0.15.0. Here is the Python code that I use to write/read data to/from GCD: from…
5
votes
4 answers

How to use gcloud commands programmatically via Python

The Google documentation is a little generic on this topic and I find it hard to get around the different APIs and terms they're using, so I'm wondering if someone could point me to the right direction. I'm looking for a way to call the gcloud…
orange
  • 7,755
  • 14
  • 75
  • 139
4
votes
1 answer

How to filter by tags in gcloud python client

I am using gcloud python client library(https://github.com/google/google-api-python-client) to get a list of instances. I am able to use filters like name, status but I can't figure out a way to filter by tags. I am able to do that via gcloud cli…
mehulved
  • 371
  • 2
  • 14
4
votes
1 answer

gcloud-python close connection

Is there a way in gcloud-python to close a connection? Currently, it seems that a connection is established and once it's done, it will sit there in CLOSE_WAIT and time out eventually. Any help is appreciated. Thanks! Background: I have a server…
4
votes
2 answers

Using Google Cloud Datastore with NDB API?

There is a lot of info on using NDB API with Google App Engine Datastore but I can't find any info on how to use NDB with Google Cloud Datastore. The only module I found is googledatastore which is very primitive library. How is App Engine…
4
votes
2 answers

Using gcloud-python in GAE

I've got a bunch of little Raspberry Pis running some python code which saves directly to the Datastore (skips GAE) using the gcloud-python datastore package. This works great. I now want to present the data via web and mobile clients using Google…
4
votes
2 answers

Using Datastore outside of App Engine (python)?

I am used to Google Cloud SQL, where you can connect to a database outside of GAE. Is something like this possible for the GAE datastore, using the Python NDB interface ideally ? Basically, my use-case is I want to run acceptance tests that…
3
votes
1 answer

How to use gcloud auth list in python

We could run "gcloud auth list" to get our credentialed account, and now I want to do the same thing in my python code, that is checking the credential account by API in python. But I didn't fine it..... Any suggestion? More information is: I want…
1
2 3 4