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
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

How to filter by networkIP in gcloud python instances

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 how to filter by IP address (networkIP). I'm sure it has…
2
votes
1 answer

How to determine authentication method while using Google Cloud Platform client libraries locally

I'm currently able to run a local python script that calls the Google vision API using the python client library (specifically, I'm using the google-cloud-vision package). However, I'm curious about how it's authenticating. In the python script…
2
votes
2 answers

Google Cloud and Appengine Python Package conflict

I'm going through google's appengine tutorials and made the simple example of posting a form ans retrieving the information. Through the tutorial steps I had to install Google Cloud SDK with the appengine libs. It works fine. One step forward I pip…
Maviles
  • 3,209
  • 2
  • 25
  • 39
2
votes
1 answer

Is there a way to save nested entities in gcloud-python?

I'm trying to save an object into Cloud Datastore, the object contains a dictionary as a property value: client = datastore.Client(project_id) key = client.key('Config', 'config', 'Environment', 'env_name') env =…
2
votes
1 answer

gcloud preview app deploy uploads all souce code files everytime in python project taking long time

After i recently updated the gcloud components with gcloud components update to version 108.0.0, i noticed the gcloud preview app deploy app.yaml command has started taking too long every time (about 15 minutes) for my project. Before this it only…
2
votes
2 answers

gcloud python: how to construct query with OR condition

It seems there is no way to construct query with OR condition. Has anyone hit this issue or know when this will be done or any workaround. What I want to achive something like this with OR: query = datastore.query(kind='Article', …
2
votes
1 answer

How to do a GQL query (using gcloud-python)

I have a collection of Entities of one kind. I need to extract the distinct values of one property, named p, of these Entities. In GQL, I would do: SELECT DISTINCT p from kind However in the gcloud-python library GQL queries aren't implemented yet…
2
votes
2 answers

Connecting to Google Datastore using gcloud

I am trying to connect to my Google Datastore instance but I can't find any sample code for how to initialize a connection! Gcloud's main documentation immediately starts with how to assign an Entity or a Query but skips the crucial connection bit.…
1
vote
2 answers

How do I use a GCloud Access Token with the Python SDK?

I can obtain an access token for a service account using gcloud auth print-access-token --impersonate-service-account= Assuming I have such a token from somewhere (e.g. in an environment variable), how do I use it to…
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
1
vote
1 answer

Cloud Spanner, Create a database client, quick start guide, error

I am trying the "Getting Started with Cloud Spanner in Python" guide for google cloud spanner. I have created the instances databases e.t.c. I have got to the "Create a database client" section. We operate behind a firewall and have to set our proxy…
mez63
  • 166
  • 4
  • 20
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
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