Check whether deployed in cloud
I have a python program running in a Docker container. My authentication method depends on whether the container is deployed in GCP or not. Ideally I’d have a function like this:
I have a python program running in a Docker container. My authentication method depends on whether the container is deployed in GCP or not. Ideally I’d have a function like this:
gcloud auth print-access-token gives me a Bearer token that I can use later on; however, this is a shell command. How would I obtain one programmatically via the Google Cloud Python API?
Reading this doc it says “You must initially deploy a version of your app to the default service before you can create and deploy subsequent services.”
I’m a Ruby dev trying my hand at Google Cloud Functions written in Python and have hit a wall with transferring a remote file from a given URL to Google Cloud Storage (GCS).
I am not using Appengine.