Compute V1 Client - Class Autoscaler (1.17.0)

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

Represents an Autoscaler resource. Google Compute Engine has two Autoscaler resources: * Zonal * Regional Use autoscalers to automatically add or delete instances from a managed instance group according to your defined autoscaling policy. For more information, read Autoscaling Groups of Instances. For zonal managed instance groups resource, use the autoscaler resource. For regional managed instance groups, use the regionAutoscalers resource.

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

Namespace

Google \ Cloud \ Compute \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ autoscaling_policy Google\Cloud\Compute\V1\AutoscalingPolicy

The configuration parameters for the autoscaling algorithm. You can define one or more signals for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.

↳ creation_timestamp string

[Output Only] Creation timestamp in RFC3339 text format.

↳ description string

An optional description of this resource. Provide this property when you create the resource.

↳ id int|string

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

↳ kind string

[Output Only] Type of the resource. Always compute#autoscaler for autoscalers.

↳ name string

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

↳ recommended_size int

[Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates the recommended MIG size even when the autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to an existing managed instance group or autoscaler did not generate its prediction.

↳ region string

[Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).

↳ scaling_schedule_status array|Google\Protobuf\Internal\MapField

[Output Only] Status information of existing scaling schedules.

↳ self_link string

[Output Only] Server-defined URL for the resource.

↳ status string

[Output Only] The status of the autoscaler configuration. Current set of possible values: - PENDING: Autoscaler backend hasn't read new/updated configuration. - DELETING: Configuration is being deleted. - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future. Check the Status enum for the list of possible values.

↳ status_details array<Google\Cloud\Compute\V1\AutoscalerStatusDetails>

[Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter.

↳ target string

URL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler.

↳ zone string

[Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).

getAutoscalingPolicy

The configuration parameters for the autoscaling algorithm. You can define one or more signals for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.

Returns
Type Description
Google\Cloud\Compute\V1\AutoscalingPolicy|null

hasAutoscalingPolicy

clearAutoscalingPolicy

setAutoscalingPolicy

The configuration parameters for the autoscaling algorithm. You can define one or more signals for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.

Parameter
Name Description
var Google\Cloud\Compute\V1\AutoscalingPolicy
Returns
Type Description
$this

getCreationTimestamp

[Output Only] Creation timestamp in RFC3339 text format.

Returns
Type Description
string

hasCreationTimestamp

clearCreationTimestamp

setCreationTimestamp

[Output Only] Creation timestamp in RFC3339 text format.

Parameter
Name Description
var string
Returns
Type Description
$this

getDescription

An optional description of this resource. Provide this property when you create the resource.

Returns
Type Description
string

hasDescription

clearDescription

setDescription

An optional description of this resource. Provide this property when you create the resource.

Parameter
Name Description
var string
Returns
Type Description
$this

getId

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

Returns
Type Description
int|string

hasId

clearId

setId

[Output Only] The unique identifier for the resource. This identifier is defined by the server.

Parameter
Name Description
var int|string
Returns
Type Description
$this

getKind

[Output Only] Type of the resource. Always compute#autoscaler for autoscalers.

Returns
Type Description
string

hasKind

clearKind

setKind

[Output Only] Type of the resource. Always compute#autoscaler for autoscalers.

Parameter
Name Description
var string
Returns
Type Description
$this

getName

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Returns
Type Description
string

hasName

clearName

setName

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Parameter
Name Description
var string
Returns
Type Description
$this

getRecommendedSize

[Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates the recommended MIG size even when the autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to an existing managed instance group or autoscaler did not generate its prediction.

Returns
Type Description
int

hasRecommendedSize

clearRecommendedSize

setRecommendedSize

[Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates the recommended MIG size even when the autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to an existing managed instance group or autoscaler did not generate its prediction.

Parameter
Name Description
var int
Returns
Type Description
$this

getRegion

[Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).

Returns
Type Description
string

hasRegion

clearRegion

setRegion

[Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).

Parameter
Name Description
var string
Returns
Type Description
$this

getScalingScheduleStatus

[Output Only] Status information of existing scaling schedules.

Returns
Type Description
Google\Protobuf\Internal\MapField

setScalingScheduleStatus

[Output Only] Status information of existing scaling schedules.

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this

[Output Only] Server-defined URL for the resource.

Returns
Type Description
string

[Output Only] Server-defined URL for the resource.

Parameter
Name Description
var string
Returns
Type Description
$this

getStatus

[Output Only] The status of the autoscaler configuration. Current set of possible values: - PENDING: Autoscaler backend hasn't read new/updated configuration. - DELETING: Configuration is being deleted. - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.

Check the Status enum for the list of possible values.

Returns
Type Description
string

hasStatus

clearStatus

setStatus

[Output Only] The status of the autoscaler configuration. Current set of possible values: - PENDING: Autoscaler backend hasn't read new/updated configuration. - DELETING: Configuration is being deleted. - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.

Check the Status enum for the list of possible values.

Parameter
Name Description
var string
Returns
Type Description
$this

getStatusDetails

[Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setStatusDetails

[Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter.

Parameter
Name Description
var array<Google\Cloud\Compute\V1\AutoscalerStatusDetails>
Returns
Type Description
$this

getTarget

URL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler.

Returns
Type Description
string

hasTarget

clearTarget

setTarget

URL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler.

Parameter
Name Description
var string
Returns
Type Description
$this

getZone

[Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).

Returns
Type Description
string

hasZone

clearZone

setZone

[Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).

Parameter
Name Description
var string
Returns
Type Description
$this