Compute V1 Client - Class Autoscaler (1.14.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
NameDescription
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
TypeDescription
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
NameDescription
var Google\Cloud\Compute\V1\AutoscalingPolicy
Returns
TypeDescription
$this

getCreationTimestamp

[Output Only] Creation timestamp in RFC3339 text format.

Returns
TypeDescription
string

hasCreationTimestamp

clearCreationTimestamp

setCreationTimestamp

[Output Only] Creation timestamp in RFC3339 text format.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDescription

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

Returns
TypeDescription
string

hasDescription

clearDescription

setDescription

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getId

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

Returns
TypeDescription
int|string

hasId

clearId

setId

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

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getKind

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

Returns
TypeDescription
string

hasKind

clearKind

setKind

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

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var int
Returns
TypeDescription
$this

getRegion

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

Returns
TypeDescription
string

hasRegion

clearRegion

setRegion

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getScalingScheduleStatus

[Output Only] Status information of existing scaling schedules.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setScalingScheduleStatus

[Output Only] Status information of existing scaling schedules.

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

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

Returns
TypeDescription
string

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

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var array<Google\Cloud\Compute\V1\AutoscalerStatusDetails>
Returns
TypeDescription
$this

getTarget

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

Returns
TypeDescription
string

hasTarget

clearTarget

setTarget

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getZone

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

Returns
TypeDescription
string

hasZone

clearZone

setZone

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this