0

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.

Sarang Shinde
  • 717
  • 3
  • 7
  • 24

1 Answers1

2

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.

James
  • 2,321
  • 14
  • 30
  • Hi James i am using Try API but . When i submit , its just loading but not creating any Environment. Yes agree with you that most of time composer creation is one time activity but just looking ways to create Environment as we have Rest Api. – Sarang Shinde Aug 29 '18 at 16:22
  • What's the response you get back when you submit your request? – James Aug 29 '18 at 17:51