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
1
vote
3 answers

Memory leak in Google PubSub Python client

I am publishing messages indefinitely to Google PubSub using Python. I am publishing the messages in batches. I've set the batch_size as 20. I am publishing messages in 5 processes. I executed below script in GCE with 1 CPU and 3.75 memory. After…
1
vote
1 answer

Google spanner structs as parameter

When using the spanner python client (but perhaps the problem is more general) it seems impossible to pass structs to the query as a parameter. Consider following setup: from google.cloud.proto.spanner.v1 import type_pb2 from google.cloud import…
1
vote
3 answers

Python: How can I create a GoogleCredentials using a specific user instead of get_application_default()

I'm updating a script to call OAuth2-protected Google Cloud endpoints. The previous version assumed a single user previously authenticated by gcloud auth login and thus was able to use the default: credentials =…
broadmonkey
  • 124
  • 2
  • 9
1
vote
2 answers

gce launch instance python api using example guide

I tried to replicate the following guide found on google's website https://cloud.google.com/compute/docs/tutorials/python-guide I couldn't figure out what the bucket, and compute mean. What kind of parameter do I need to pass into the script? What…
1
vote
1 answer

Creating a Datastore Entry results in encrypted properties when viewing with the browser

I manage to create or modify a datastore entity fine with google.cloud.datastore in python, but when I log in into my Cloud Platform project in the browser and check the entry, it looks like all of its properties are encrypted (They look like…
1
vote
1 answer

Uploading empty data to Bigquery using gcloud python

I try to upload a few rows of data using the gcloud python library and don't succeed. Here is the sample code taken from the latest documentation client = bigquery.Client() dataset = client.dataset('test') table = dataset.table("test_table") rows =…
crisscross
  • 1,675
  • 2
  • 18
  • 28
1
vote
3 answers

Cannot get gcloud to work with Python and Pycharm

I am trying to connect to the Google App Engine Datastore from my local machine. I have spent all day digging in to this without any luck. I have tried the approach here (as well as alot of other suggestions from SO such as Using gcloud-python in…
ThomasD
  • 2,464
  • 6
  • 40
  • 56
1
vote
1 answer

How to use gcloud on google app engine?

I'm trying to use client and buckets of gcloud on google app engine. First, I install gcloud. pip install gcloud -t my_project_directory Second,I start to import gcloud and use it. Here is my code: from gcloud import storage class…
1
vote
3 answers

How to use Google Cloud Client Library for Python to configure the gcloud project

Hi I am trying to use the Google Cloud Client Library for Python to convert a shell script using the gcloud CLI to launch a container to python. In searching through the documentation (https://googlecloudplatform.github.io/gcloud-python/), I have…
1
vote
1 answer

Installing gcloud after GoogleAppEngineLauncher webapp2 import not found

I've been running GoogleAppEngineLauncher for a couple days, without incident. This morning I installed the gcloud package from Google. The issue is that now, regardless of where I run my AppEngine project from (GoogleAppEngineLauncher or using…
1
vote
1 answer

How to access google cloud docker registry from Python

I want to retrieve a list of images from Google Cloud Docker Registry via https://gcr.io http API. I found a way to do it from command line like this: curl -u _token:$(gcloud auth print-access-token) https://gcr.io/v2/{project}/{repo}/tags/list But…
1
vote
0 answers

How can I athenticate dockerpy using gcloud API?

I have tried to push a Docker Image to "gcr" Registry programmatically. The "gcloud docker --authorize-only" gives me a short - live authentication. How can I perform authentication using python gcloud API without shell execution?
worroc
  • 117
  • 8
1
vote
1 answer

Query google datastore by key in gcloud api

I'm trying to query for some data using the gcloud api that I just discovered. I'd like to query for a KeyPropery. e.g.: from google.appengine.ext import ndb class User(ndb.Model): email = ndb.StringProperty() class Data(ndb.Model): user…
1
vote
1 answer

Datastore returns 503 when trying to access from a docker container

I have a Google Compute Engine instance running Ubuntu 15.10 and docker 1.10.1. When I try to access Google Datastore from gcloud-python on the instance, everything works fine. When I try to access it from inside a docker container based on…
1
vote
0 answers

Exporting BigQuery table to GCS using gcloud-python

The example here is outdated https://googlecloudplatform.github.io/gcloud-python/stable/bigquery-usage.html#exporting-data-async. The example gives error: AttributeError: 'Table' object has no attribute 'export_to_storage' How do I construct and run…