Compute V1 Client - Class InstanceGroupManager (1.29.0)

Reference documentation and code samples for the Compute V1 Client class InstanceGroupManager.

Represents a Managed Instance Group resource. An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups. For zonal Managed Instance Group, use the instanceGroupManagers resource. For regional Managed Instance Group, use the regionInstanceGroupManagers resource.

Generated from protobuf message google.cloud.compute.v1.InstanceGroupManager

Namespace

Google \ Cloud \ Compute \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
dataarray

Optional. Data for populating the Message object.

↳ all_instances_configInstanceGroupManagerAllInstancesConfig

Specifies configuration that overrides the instance template configuration for the group.

↳ auto_healing_policiesarray<InstanceGroupManagerAutoHealingPolicy>

The autohealing policy for this managed instance group. You can specify only one value.

↳ base_instance_namestring

The base instance name is a prefix that you want to attach to the names of all VMs in a MIG. The maximum character length is 58 and the name must comply with RFC1035 format. When a VM is created in the group, the MIG appends a hyphen and a random four-character string to the base instance name. If you want the MIG to assign sequential numbers instead of a random string, then end the base instance name with a hyphen followed by one or more hash symbols. The hash symbols indicate the number of digits. For example, a base instance name of "vm-###" results in "vm-001" as a VM name. @pattern a-z

↳ creation_timestampstring

[Output Only] The creation timestamp for this managed instance group in RFC3339 text format.

↳ current_actionsInstanceGroupManagerActionsSummary

[Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions.

↳ descriptionstring

An optional description of this resource.

↳ distribution_policyDistributionPolicy

Policy specifying the intended distribution of managed instances across zones in a regional managed instance group.

↳ fingerprintstring

Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.

↳ idint|string

[Output Only] A unique identifier for this resource type. The server generates this identifier.

↳ instance_flexibility_policyInstanceGroupManagerInstanceFlexibilityPolicy

Instance flexibility allowing MIG to create VMs from multiple types of machines. Instance flexibility configuration on MIG overrides instance template configuration.

↳ instance_groupstring

[Output Only] The URL of the Instance Group resource.

↳ instance_lifecycle_policyInstanceGroupManagerInstanceLifecyclePolicy

The repair policy for this managed instance group.

↳ instance_templatestring

The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.

↳ kindstring

[Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.

↳ list_managed_instances_resultsstring

Pagination behavior of the listManagedInstances API method for this managed instance group. Check the ListManagedInstancesResults enum for the list of possible values.

↳ namestring

The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.

↳ named_portsarray<NamedPort>

[Output Only] Named ports configured on the Instance Groups complementary to this Instance Group Manager.

↳ regionstring

[Output Only] The URL of the region where the managed instance group resides (for regional resources).

↳ resource_policiesInstanceGroupManagerResourcePolicies

Resource policies for this managed instance group.

↳ satisfies_pzibool

[Output Only] Reserved for future use.

↳ satisfies_pzsbool

[Output Only] Reserved for future use.

↳ self_linkstring

[Output Only] The URL for this managed instance group. The server defines this URL.

↳ standby_policyInstanceGroupManagerStandbyPolicy

Standby policy for stopped and suspended instances.

↳ stateful_policyStatefulPolicy

Stateful configuration for this Instanced Group Manager

↳ statusInstanceGroupManagerStatus

[Output Only] The status of this managed instance group.

↳ target_poolsarray

The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.

↳ target_sizeint

The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.

↳ target_stopped_sizeint

The target number of stopped instances for this managed instance group. This number changes when you: - Stop instance using the stopInstances method or start instances using the startInstances method. - Manually change the targetStoppedSize using the update method.

↳ target_suspended_sizeint

The target number of suspended instances for this managed instance group. This number changes when you: - Suspend instance using the suspendInstances method or resume instances using the resumeInstances method. - Manually change the targetSuspendedSize using the update method.

↳ update_policyInstanceGroupManagerUpdatePolicy

The update policy for this managed instance group.

↳ versionsarray<InstanceGroupManagerVersion>

Specifies the instance templates used by this managed instance group to create instances. Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.

↳ zonestring

[Output Only] The URL of a zone where the managed instance group is located (for zonal resources).

getAllInstancesConfig

Specifies configuration that overrides the instance template configuration for the group.

Returns
TypeDescription
InstanceGroupManagerAllInstancesConfig|null

hasAllInstancesConfig

clearAllInstancesConfig

setAllInstancesConfig

Specifies configuration that overrides the instance template configuration for the group.

Parameter
NameDescription
varInstanceGroupManagerAllInstancesConfig
Returns
TypeDescription
$this

getAutoHealingPolicies

The autohealing policy for this managed instance group. You can specify only one value.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setAutoHealingPolicies

The autohealing policy for this managed instance group. You can specify only one value.

Parameter
NameDescription
vararray<InstanceGroupManagerAutoHealingPolicy>
Returns
TypeDescription
$this

getBaseInstanceName

The base instance name is a prefix that you want to attach to the names of all VMs in a MIG. The maximum character length is 58 and the name must comply with RFC1035 format. When a VM is created in the group, the MIG appends a hyphen and a random four-character string to the base instance name. If you want the MIG to assign sequential numbers instead of a random string, then end the base instance name with a hyphen followed by one or more hash symbols. The hash symbols indicate the number of digits. For example, a base instance name of "vm-###" results in "vm-001" as a VM name. @pattern a-z

Returns
TypeDescription
string

hasBaseInstanceName

clearBaseInstanceName

setBaseInstanceName

The base instance name is a prefix that you want to attach to the names of all VMs in a MIG. The maximum character length is 58 and the name must comply with RFC1035 format. When a VM is created in the group, the MIG appends a hyphen and a random four-character string to the base instance name. If you want the MIG to assign sequential numbers instead of a random string, then end the base instance name with a hyphen followed by one or more hash symbols. The hash symbols indicate the number of digits. For example, a base instance name of "vm-###" results in "vm-001" as a VM name. @pattern a-z

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getCreationTimestamp

[Output Only] The creation timestamp for this managed instance group in RFC3339 text format.

Returns
TypeDescription
string

hasCreationTimestamp

clearCreationTimestamp

setCreationTimestamp

[Output Only] The creation timestamp for this managed instance group in RFC3339 text format.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getCurrentActions

[Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions.

Returns
TypeDescription
InstanceGroupManagerActionsSummary|null

hasCurrentActions

clearCurrentActions

setCurrentActions

[Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions.

Parameter
NameDescription
varInstanceGroupManagerActionsSummary
Returns
TypeDescription
$this

getDescription

An optional description of this resource.

Returns
TypeDescription
string

hasDescription

clearDescription

setDescription

An optional description of this resource.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getDistributionPolicy

Policy specifying the intended distribution of managed instances across zones in a regional managed instance group.

Returns
TypeDescription
DistributionPolicy|null

hasDistributionPolicy

clearDistributionPolicy

setDistributionPolicy

Policy specifying the intended distribution of managed instances across zones in a regional managed instance group.

Parameter
NameDescription
varDistributionPolicy
Returns
TypeDescription
$this

getFingerprint

Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.

Returns
TypeDescription
string

hasFingerprint

clearFingerprint

setFingerprint

Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getId

[Output Only] A unique identifier for this resource type. The server generates this identifier.

Returns
TypeDescription
int|string

hasId

clearId

setId

[Output Only] A unique identifier for this resource type. The server generates this identifier.

Parameter
NameDescription
varint|string
Returns
TypeDescription
$this

getInstanceFlexibilityPolicy

Instance flexibility allowing MIG to create VMs from multiple types of machines. Instance flexibility configuration on MIG overrides instance template configuration.

Returns
TypeDescription
InstanceGroupManagerInstanceFlexibilityPolicy|null

hasInstanceFlexibilityPolicy

clearInstanceFlexibilityPolicy

setInstanceFlexibilityPolicy

Instance flexibility allowing MIG to create VMs from multiple types of machines. Instance flexibility configuration on MIG overrides instance template configuration.

Parameter
NameDescription
varInstanceGroupManagerInstanceFlexibilityPolicy
Returns
TypeDescription
$this

getInstanceGroup

[Output Only] The URL of the Instance Group resource.

Returns
TypeDescription
string

hasInstanceGroup

clearInstanceGroup

setInstanceGroup

[Output Only] The URL of the Instance Group resource.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getInstanceLifecyclePolicy

The repair policy for this managed instance group.

Returns
TypeDescription
InstanceGroupManagerInstanceLifecyclePolicy|null

hasInstanceLifecyclePolicy

clearInstanceLifecyclePolicy

setInstanceLifecyclePolicy

The repair policy for this managed instance group.

Parameter
NameDescription
varInstanceGroupManagerInstanceLifecyclePolicy
Returns
TypeDescription
$this

getInstanceTemplate

The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.

Returns
TypeDescription
string

hasInstanceTemplate

clearInstanceTemplate

setInstanceTemplate

The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getKind

[Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.

Returns
TypeDescription
string

hasKind

clearKind

setKind

[Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getListManagedInstancesResults

Pagination behavior of the listManagedInstances API method for this managed instance group.

Check the ListManagedInstancesResults enum for the list of possible values.

Returns
TypeDescription
string

hasListManagedInstancesResults

clearListManagedInstancesResults

setListManagedInstancesResults

Pagination behavior of the listManagedInstances API method for this managed instance group.

Check the ListManagedInstancesResults enum for the list of possible values.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getName

The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.

Returns
TypeDescription
string

hasName

clearName

setName

The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getNamedPorts

[Output Only] Named ports configured on the Instance Groups complementary to this Instance Group Manager.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setNamedPorts

[Output Only] Named ports configured on the Instance Groups complementary to this Instance Group Manager.

Parameter
NameDescription
vararray<NamedPort>
Returns
TypeDescription
$this

getRegion

[Output Only] The URL of the region where the managed instance group resides (for regional resources).

Returns
TypeDescription
string

hasRegion

clearRegion

setRegion

[Output Only] The URL of the region where the managed instance group resides (for regional resources).

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getResourcePolicies

Resource policies for this managed instance group.

Returns
TypeDescription
InstanceGroupManagerResourcePolicies|null

hasResourcePolicies

clearResourcePolicies

setResourcePolicies

Resource policies for this managed instance group.

Parameter
NameDescription
varInstanceGroupManagerResourcePolicies
Returns
TypeDescription
$this

getSatisfiesPzi

[Output Only] Reserved for future use.

Returns
TypeDescription
bool

hasSatisfiesPzi

clearSatisfiesPzi

setSatisfiesPzi

[Output Only] Reserved for future use.

Parameter
NameDescription
varbool
Returns
TypeDescription
$this

getSatisfiesPzs

[Output Only] Reserved for future use.

Returns
TypeDescription
bool

hasSatisfiesPzs

clearSatisfiesPzs

setSatisfiesPzs

[Output Only] Reserved for future use.

Parameter
NameDescription
varbool
Returns
TypeDescription
$this

[Output Only] The URL for this managed instance group. The server defines this URL.

Returns
TypeDescription
string

[Output Only] The URL for this managed instance group. The server defines this URL.

Parameter
NameDescription
varstring
Returns
TypeDescription
$this

getStandbyPolicy

Standby policy for stopped and suspended instances.

Returns
TypeDescription
InstanceGroupManagerStandbyPolicy|null

hasStandbyPolicy

clearStandbyPolicy

setStandbyPolicy

Standby policy for stopped and suspended instances.

Parameter
NameDescription
varInstanceGroupManagerStandbyPolicy
Returns
TypeDescription
$this

getStatefulPolicy

Stateful configuration for this Instanced Group Manager

Returns
TypeDescription
StatefulPolicy|null

hasStatefulPolicy

clearStatefulPolicy

setStatefulPolicy

Stateful configuration for this Instanced Group Manager

Parameter
NameDescription
varStatefulPolicy
Returns
TypeDescription
$this

getStatus

[Output Only] The status of this managed instance group.

Returns
TypeDescription
InstanceGroupManagerStatus|null

hasStatus

clearStatus

setStatus

[Output Only] The status of this managed instance group.

Parameter
NameDescription
varInstanceGroupManagerStatus
Returns
TypeDescription
$this

getTargetPools

The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setTargetPools

The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.

Parameter
NameDescription
varstring[]
Returns
TypeDescription
$this

getTargetSize

The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.

Returns
TypeDescription
int

hasTargetSize

clearTargetSize

setTargetSize

The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number.

Parameter
NameDescription
varint
Returns
TypeDescription
$this

getTargetStoppedSize

The target number of stopped instances for this managed instance group. This number changes when you: - Stop instance using the stopInstances method or start instances using the startInstances method. - Manually change the targetStoppedSize using the update method.

Returns
TypeDescription
int

hasTargetStoppedSize

clearTargetStoppedSize

setTargetStoppedSize

The target number of stopped instances for this managed instance group. This number changes when you: - Stop instance using the stopInstances method or start instances using the startInstances method. - Manually change the targetStoppedSize using the update method.

Parameter
NameDescription
varint
Returns
TypeDescription
$this

getTargetSuspendedSize

The target number of suspended instances for this managed instance group. This number changes when you: - Suspend instance using the suspendInstances method or resume instances using the resumeInstances method. - Manually change the targetSuspendedSize using the update method.

Returns
TypeDescription
int

hasTargetSuspendedSize

clearTargetSuspendedSize

setTargetSuspendedSize

The target number of suspended instances for this managed instance group. This number changes when you: - Suspend instance using the suspendInstances method or resume instances using the resumeInstances method. - Manually change the targetSuspendedSize using the update method.

Parameter
NameDescription
varint
Returns
TypeDescription
$this

getUpdatePolicy

The update policy for this managed instance group.

Returns
TypeDescription
InstanceGroupManagerUpdatePolicy|null

hasUpdatePolicy

clearUpdatePolicy

setUpdatePolicy

The update policy for this managed instance group.

Parameter
NameDescription
varInstanceGroupManagerUpdatePolicy
Returns
TypeDescription
$this

getVersions

Specifies the instance templates used by this managed instance group to create instances. Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setVersions

Specifies the instance templates used by this managed instance group to create instances. Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.

Parameter
NameDescription
vararray<InstanceGroupManagerVersion>
Returns
TypeDescription
$this

getZone

[Output Only] The URL of a zone where the managed instance group is located (for zonal resources).

Returns
TypeDescription
string

hasZone

clearZone

setZone

[Output Only] The URL of a zone where the managed instance group is located (for zonal resources).

Parameter
NameDescription
varstring
Returns
TypeDescription
$this