Sarang Shinde
Sarang Shinde

Reputation: 737

Using Google Cloud Composer Rest API OR Node.js Client

Hi i am new to Google Cloud Platform and Cloud Composer.

I want to create Cloud Composer Environment using code. But before that i have following questions:

  1. Is there any way to create Cloud Composer Environment using its Rest Api?
  2. Using Try Api for Google Cloud Composer to create Environment is not working why is it so?
  3. Is there any node package for Cloud Composer such as @google-cloud/composer as we have same for others like e.g @google-cloud/dataproc?

Please help me to understand it better.

Upvotes: 0

Views: 469

Answers (1)

James
James

Reputation: 2331

Disclaimer: Without seeing an error, it's hard to say why whatever you are trying is not working. If you can share any code it will be useful.

The Composer API has methods to do CRUD on environments. You can create a new environment with environments.create. In fact, there's a Try API section on that page to allow you to try the call from the documentation.

Making the request via the API should be pretty easy. Mainly you'll need to specify an Environment and most of what you will want to set is going to be in the ClusterConfig. Do take note that a lot of the fields are output only, so you do not need to specify them in your request. Also mind the URL syntax - you will need to adapt it to your specific request.

My guess on why it's not working - have you ensured the API is enabled? As for the Python client libraries - it looks like they need to be regenerated.

Having said all of that, what's the use case to create an environment via the API? Generally most environments are left running persistently, meaning the create call is an atomic one-time operation for most people.

Upvotes: 2

Related Questions