2

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 about it.

Can anyone help me figure out the import and init statements for the Resource Client as well as the Compute Engine Client?

From there on I assume I'll figure out the rest using the docs.

1
  • What is it that you're trying to do? Asking because I'm not sure what RC and CEC have to do with the cloud-python client, why you want to combine these, etc. Makes it kinda hard to answer, atm. Commented Jan 17, 2022 at 9:25

1 Answer 1

3

So I figured it out, primarily I had an issue with another google package that messed up my dependencies.

The import statement is as follows:

from google.cloud.resourcemanager_v3.services.projects.client import ProjectsClient

and the initialization is simply this:

client = ProjectsClient()

Note however, that this relies on an existing application default credentials file existing on the machine, which can be created by running the following command in the console:

gcloud auth application-default login
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.