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:

NameDatatypeDescription
idstring (uint64)Output only. [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 withRFC1035. 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](?:[-a-z0-9]{0,61}[a-z0-9])?)
autoscalingPolicyobjectThe configuration parameters for the autoscaling algorithm. You can define one or more signals for an autoscaler: cpuUtilization,customMetricUtilizations, andloadBalancingUtilization. If none of these are specified, the default will be to autoscale based oncpuUtilization to 0.6 or 60%. (id: AutoscalingPolicy)
creationTimestampstringOutput only. [Output Only] Creation timestamp inRFC3339 text format.
descriptionstringAn optional description of this resource. Provide this property when you create the resource.
kindstringOutput only. [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. (default: compute#autoscaler)
recommendedSizeinteger (int32)Output only. [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.
regionstringOutput only. [Output Only] URL of theregion where the instance group resides (for autoscalers living in regional scope).
scalingScheduleStatusobjectOutput only. [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. (ACTIVE, DELETING, ERROR, PENDING)
statusDetailsarray[Output Only] Human-readable details about the current state of the autoscaler. Read the documentation forCommonly 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.
zonestringOutput only. [Output Only] URL of thezone 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, regionorderBy, filter, maxResults, pageToken, returnPartialSuccessRetrieves a list of autoscalers contained within
the specified region.
aggregated_listselectprojectreturnPartialSuccess, maxResults, pageToken, filter, serviceProjectNumber, includeAllScopes, orderByRetrieves an aggregated list of autoscalers.

To prevent failure, it is recommended that you set the
returnPartialSuccess parameter to true.
insertinsertproject, regionrequestIdCreates an autoscaler in the specified project using
the data included in the request.
patchupdateproject, regionrequestId, autoscalerUpdates an autoscaler in the specified project using
the data included in the request. This method supportsPATCH
semantics and uses theJSON 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__target,
data__status,
data__statusDetails,
data__name,
data__autoscalingPolicy,
data__selfLink,
data__description,
project,
region,
requestId
)
SELECT
'{{ target }}',
'{{ status }}',
'{{ statusDetails }}',
'{{ name }}',
'{{ autoscalingPolicy }}',
'{{ selfLink }}',
'{{ description }}',
'{{ project }}',
'{{ region }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
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 supportsPATCH
semantics and uses theJSON merge
patch format and processing rules.

UPDATE google.compute.autoscalers
SET
data__target = '{{ target }}',
data__status = '{{ status }}',
data__statusDetails = '{{ statusDetails }}',
data__name = '{{ name }}',
data__autoscalingPolicy = '{{ autoscalingPolicy }}',
data__selfLink = '{{ selfLink }}',
data__description = '{{ description }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND requestId = '{{ requestId}}'
AND autoscaler = '{{ autoscaler}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
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__target = '{{ target }}',
data__status = '{{ status }}',
data__statusDetails = '{{ statusDetails }}',
data__name = '{{ name }}',
data__autoscalingPolicy = '{{ autoscalingPolicy }}',
data__selfLink = '{{ selfLink }}',
data__description = '{{ description }}'
WHERE
project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND autoscaler = '{{ autoscaler}}'
AND requestId = '{{ requestId}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
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 }}'
;