GoogleCloudPlatform / google-cloud-powershell

PowerShell cmdlets for the Google Cloud Platform
http://googlecloudplatform.github.io/google-cloud-powershell/
Apache License 2.0
135 stars 61 forks source link

Add -Region option to Add-GceManagedInstane cmdlets #600

Closed quoctruong closed 6 years ago

quoctruong commented 6 years ago

This change is Reviewable

quoctruong commented 6 years ago

@ILMTitan PTAL. I modify the logic when pipelining the object so that:

  1. If -Region is supplied, we will create a Regional Instance Group.
  2. Otherwise, create a Zonal Instance Group. If the user supplies either -Project or -Zone parameters, we will use them instead of the default value from the SDK.

I have to add logic for this instead of using ParameterSet because I wasn't able to resolve them.

ILMTitan commented 6 years ago

I think the logic should be:

  1. If the user specifies both -Zone and -Region, throw an error.
  2. If the user specifies -Region, create a Region Instance Group there.
  3. If the user specifies -Zone, create a Zone Instance Group there.
  4. If the user supplies an object that specifies either Zone or Region, create that type of instance group.
  5. Else create a Zone Instance Group at the default zone.
quoctruong commented 6 years ago

@ILMTitan Thanks for the great suggestion! PTAL.

quoctruong commented 6 years ago

@ILMTitan PTAL.

quoctruong commented 6 years ago

Thanks!