Questions tagged [google-cloud-python]

Use this tag if you are going to refer something from Python libraries OR API Clients of Google Cloud Platform.

207 questions
3
votes
1 answer

google cloud storage stores only (48 B) for each file

I am uploading binary jpeg files using html
on to my python webapp server hosted on Google App Engine. The server method receives the entire image (tried printing stats such as file size/type etc. successfully), but fails to write it to…
3
votes
0 answers

Internal Kinds Returned When Retrieving All Entities Belonging to a Particular Namespace

I am trying to retrieve all entities belonging to a particular namespace. The query is quite simple query = datastore.Query(namespace=) Running this however returns keys belonging to internal kinds which aren’t part of the data I am…
2
votes
1 answer

Google Cloud Storage streaming upload from Python generator

I have a Python generator that will yield a large and unknown amount of byte data. I'd like to stream the output to GCS, without buffering to a file on disk first. While I'm sure this is possible (e.g., I can create a subprocess of gsutil cp - <...>…
2
votes
1 answer

Importing & initializing GCP googleapis/google-cloud-python clients

As far as I understand, the suggested way to interact with GCP using python is to use the google-cloud-python client. So far I have not been able to initialize or even import such a client in my project and was not able to find any documentation…
masus04
  • 943
  • 8
  • 19
2
votes
1 answer

How to use python-cloudbuild to run a build trigger

How to use python-cloudbuild library to run a build trigger with correctly passing data from SourceRepo? UPDATE 1: I have a build trigger set up and I am trying to run that trigger by changing the substitutions and the repo branch UPDATE 2: Actual…
2
votes
0 answers

How to deploy python Google Cloud Function with local dependencies

I have a few google-cloud-functions that has common code between them. So I chose to make a package and place it on each of the folders for my functions. ending with the following directory structure google-cloud-function ├── main.py ├──…
2
votes
3 answers

Google Cloud Tasks 'Create Task' request is throwing ServiceUnavailable: 503

I'm converting my Tasks from AppEngine TaskQueues to Google Cloud Tasks. The one having problems is an hourly cron job that checks a S3 Bucket for new files. The cron job launches a new task per file found. Those tasks then download their respective…
Alex
  • 5,141
  • 12
  • 26
2
votes
1 answer

How to read users gmail after receiving push notification from gmail users.watch API?

I want to implement a backend server that can read (to perform some action) users gmail every time a new mail is received. I am able to figure out that using gmail API users.watch, my server can be notified every time a new email is received. Now,…
2
votes
1 answer

PubSub returns 503 - Service Unavailable all the time

I created a small program in Python for reading messages from a Pub/Sub subscription. I am using Python 3.7 and google-cloud-pubsub 1.1.0. My code is very simple: from google.cloud import pubsub_v1 from google.auth import jwt import…
OCDev
  • 655
  • 1
  • 7
  • 21
2
votes
2 answers

What roles are needed to download an object from a Google Storage Bucket

I have created a service account and given it only the Storage Object Viewer role. I would like to use this service account to download objects from a bucket using the python API. I have set the GOOGLE_APPLICATION_CREDENTIALS environment variable…
2
votes
2 answers

Google PubSub Python multiple subscriber clients receiving duplicate messages

I have a pretty straightforward app that starts a PubSub subscriber StreamingPull client. I have this deployed on Kubernetes so I can scale. When I have a single pod deployed, everything works as expected. When I scale to 2 containers, I start…
2
votes
1 answer

How submit a job on Dataproc for us-east4 region using Python SDK

I want to submit a job on the Google Cloud Dataproc for us-east4 region. I have used the following code which gives me an error. job_clnt = dataproc_v1.JobControllerClient() project_id = self.project_id region =…
2
votes
0 answers

Firestore: Listen to documents in a subcollection

I am trying to listen to documents in collection from Python code using example from Firestore Documentation. I receive correct data when listening root collection, but got nothing when listening subcollection. Here's my code: db =…
2
votes
2 answers

google-cloud get instance id and zone with python api

How can I get the current running instanceId, and it's zone in the running Python application. In Go and Java it's done in the following way, what is the equivilant in Python? Go, import metadata "cloud.google.com/go/compute/metadata" func main(){ …
aclowkay
  • 3,577
  • 5
  • 35
  • 66
2
votes
3 answers

Invalid region error when using google-cloud-python API to access Dataproc

I am trying to create a cluster in Dataproc using google-cloud-python library, however, when setting region = 'us-central1' I get below exception: google.api_core.exceptions.InvalidArgument: 400 Region 'us-central1' is invalid. Please see…
tix
  • 2,138
  • 11
  • 18