Skip to main content

autoscalers

Creates, updates, deletes, gets or lists an autoscalers resource.

Overview

Nameautoscalers
TypeResource
Idgoogle.compute.autoscalers

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstring (uint64)[Output Only] The unique identifier for the resource. This identifier is defined by the server.
namestringName 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. (pattern: a-z?)
autoscalingPolicyobjectThe 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%. (id: AutoscalingPolicy)
creationTimestampstring[Output Only] Creation timestamp in RFC3339 text format.
descriptionstringAn optional description of this resource. Provide this property when you create the resource.
kindstring[Output Only] Type of the resource. Always compute#autoscaler for autoscalers. (default: compute#autoscaler)
recommendedSizeinteger (int32)[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.
regionstring[Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
scalingScheduleStatusobject[Output Only] Status information of existing scaling schedules.
selfLinkstring[Output Only] Server-defined URL for the resource.
statusstring[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.
statusDetailsarray[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.
targetstringURL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler.
zonestring[Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, region, autoscalerReturns the specified autoscaler.
listselectproject, regionfilter, maxResults, orderBy, pageToken, returnPartialSuccessRetrieves a list of autoscalers contained within the specified region.
aggregated_listselectprojectfilter, includeAllScopes, maxResults, orderBy, pageToken, returnPartialSuccess, serviceProjectNumberRetrieves an aggregated list of autoscalers. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true.
insertinsertproject, regionrequestIdCreates an autoscaler in the specified project using the data included in the request.
patchupdateproject, regionautoscaler, requestIdUpdates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
updatereplaceproject, regionautoscaler, requestIdUpdates an autoscaler in the specified project using the data included in the request.
deletedeleteproject, region, autoscalerrequestIdDeletes the specified autoscaler.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
autoscalerstring
projectstring
regionstring
autoscalerstring
filterstring
includeAllScopesboolean
maxResultsinteger (uint32)
orderBystring
pageTokenstring
requestIdstring
returnPartialSuccessboolean
serviceProjectNumberstring (int64)

SELECT examples

Returns the specified autoscaler.

SELECT
id,
name,
autoscalingPolicy,
creationTimestamp,
description,
kind,
recommendedSize,
region,
scalingScheduleStatus,
selfLink,
status,
statusDetails,
target,
zone
FROM google.compute.autoscalers
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND autoscaler = '{{ autoscaler }}' -- required;

INSERT examples

Creates an autoscaler in the specified project using the data included in the request.

INSERT INTO google.compute.autoscalers (
data__kind,
data__id,
data__creationTimestamp,
data__name,
data__description,
data__target,
data__autoscalingPolicy,
data__zone,
data__region,
data__selfLink,
data__status,
data__statusDetails,
data__recommendedSize,
data__scalingScheduleStatus,
project,
region,
requestId
)
SELECT
'{{ kind }}',
'{{ id }}',
'{{ creationTimestamp }}',
'{{ name }}',
'{{ description }}',
'{{ target }}',
'{{ autoscalingPolicy }}',
'{{ zone }}',
'{{ region }}',
'{{ selfLink }}',
'{{ status }}',
'{{ statusDetails }}',
{{ recommendedSize }},
'{{ scalingScheduleStatus }}',
'{{ project }}',
'{{ region }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;

UPDATE examples

Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

UPDATE google.compute.autoscalers
SET
data__kind = '{{ kind }}',
data__id = '{{ id }}',
data__creationTimestamp = '{{ creationTimestamp }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__target = '{{ target }}',
data__autoscalingPolicy = '{{ autoscalingPolicy }}',
data__zone = '{{ zone }}',
data__region = '{{ region }}',
data__selfLink = '{{ selfLink }}',
data__status = '{{ status }}',
data__statusDetails = '{{ statusDetails }}',
data__recommendedSize = {{ recommendedSize }},
data__scalingScheduleStatus = '{{ scalingScheduleStatus }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND autoscaler = '{{ autoscaler}}'
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;

REPLACE examples

Updates an autoscaler in the specified project using the data included in the request.

REPLACE google.compute.autoscalers
SET
data__kind = '{{ kind }}',
data__id = '{{ id }}',
data__creationTimestamp = '{{ creationTimestamp }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__target = '{{ target }}',
data__autoscalingPolicy = '{{ autoscalingPolicy }}',
data__zone = '{{ zone }}',
data__region = '{{ region }}',
data__selfLink = '{{ selfLink }}',
data__status = '{{ status }}',
data__statusDetails = '{{ statusDetails }}',
data__recommendedSize = {{ recommendedSize }},
data__scalingScheduleStatus = '{{ scalingScheduleStatus }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND autoscaler = '{{ autoscaler}}'
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;

DELETE examples

Deletes the specified autoscaler.

DELETE FROM google.compute.autoscalers
WHERE project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND autoscaler = '{{ autoscaler }}' --required
AND requestId = '{{ requestId }}';