1
votes

I need to use a service of compute engine API, however, need to specify the region and zone. How should I set multi zone value to 'zone' parameter of service?

https://www.googleapis.com/compute/beta/projects/-project-/zones/-zone-/instanceGroupManagers/instanceGroupManager

My instance group is multi zone type, running at europe-west1-b, europe-west1-d, and europe-west1-c, but I can't use a value like europe-west1 to the zone parameter.

1

1 Answers

1
votes

There are two kinds of Instance Group Managers (IGMs), which are almost identical.

  • Zonal, and
  • Regional.

There are two differences between them:

  • Service used to managed them (compute.instanceGroupManagers for zonal and compute.regionInstanceGroupManagers for regional),
  • Fields you can set (you must set zone for regional but can not set it for regional, reverse that for with region field).

You want to create a regional IGM. So you must send call to compute.regionInstanceGroupManagers.create method not set any value to zone field but set value of region field.

If you are just starting it's probably easiest to use web UI. You can also use command gcloud compute instance-groups managed create (with --region flag) if you like console. If you want to interact with API more directly APIs Explorer makes that easier.