gcloud

Python gCloud billing APIs from CloudRun container instance gives 404 error

Python gCloud billing APIs from CloudRun container instance gives 404 error Question: The account that is running cloudrun has been linked to the billing account, but still the cloud billing python apis throw errors. What else needs to be done in the service account ? #1. Created json token for service account and passed into …

Total answers: 1

Why does gunicorn need to restart so often in my gcloud appengine app?

Why does gunicorn need to restart so often in my gcloud appengine app? Question: I am using Flask to run an application. The application will be deployed on gcloud appengine. Currently, when I run it on my local dev machine, there is no issue. But when I run it on gcloud appengine, it appears that …

Total answers: 1

Python equivalent for gcloud auth print-identity-token command

Python equivalent for gcloud auth print-identity-token command Question: The gcloud auth print-identity-token command prints an identity token for the specified account. $(gcloud auth print-identity-token –audiences=https://example.com –impersonate-service-account [email protected] –include-email) How do I do the same using Python? Asked By: nipy || Source Answers: Here a code sample (not so easy and well documented) import google.auth.transport.requests from …

Total answers: 1

Why does running `gcloud run deploy`, exactly according to the tutorial, give the error "image must be specified"

Why does running `gcloud run deploy`, exactly according to the tutorial, give the error "image must be specified" Question: I’m following the Google Cloud Run quickstart for Python, but it ain’t working. I am running Python 3.7, have gcloud installed, and have all the necessary permissions on my project. Here’s the tutorial I followed: https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-service …

Total answers: 2

google-cloud-resource-manage list projects 403 The caller does not have permission

google-cloud-resource-manage list projects 403 The caller does not have permission Question: I created a GCP service account and assigned the needed permissions for listing the projects inside the organization. When I’m using the gcloud cli, everything works: gcloud auth activate-service-account –key-file=./key.json gcloud projects list # -> List of all projects But when I try the …

Total answers: 1

How to run Google gsutil using Python

How to run Google gsutil using Python Question: After installing and configuring Google Cloud SDK gsutil command can be run by simply typing its name and the argument(-s) using Windows cmd. Here is the example: “C:Program Files (x86)GoogleCloud SDKgoogle-cloud-sdkbingcloud” version But the same command fails if run using Python subprocess. With subprocess’s shell argument set …

Total answers: 2

Calling gcloud from bazel genrule

Calling gcloud from bazel genrule Question: I am having some issues getting gcloud to run in a Bazel genrule. Looks like python path related issues. genrule( name=”foo”, outs=[“bar”], srcs=[“:bar.enc”], cmd=”gcloud decrypt –location=global –keyring=foo –key=bar –plaintext-file $@ –ciphertext-file $(location bar.enc)” ) The exception is: ImportError: No module named traceback From: try: gcloud_main = _import_gcloud_main() except Exception …

Total answers: 2

How to use gcloud commands programmatically via Python

How to use gcloud commands programmatically via Python Question: 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 …

Total answers: 4