autoscalers
Creates, updates, deletes, gets or lists an autoscalers resource.
Overview
| Name | autoscalers |
| Type | Resource |
| Id | google.compute.autoscalers |
Fields
The following fields are returned by SELECT queries:
- get
- list
- aggregated_list
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
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 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])?) |
autoscalingPolicy | object | The 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) |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
kind | string | Output only. [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. (default: compute#autoscaler) |
recommendedSize | integer (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. |
region | string | Output only. [Output Only] URL of theregion where the instance group resides (for autoscalers living in regional scope). |
scalingScheduleStatus | object | Output only. [Output Only] Status information of existing scaling schedules. |
selfLink | 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. (ACTIVE, DELETING, ERROR, PENDING) |
statusDetails | array | [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. |
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. [Output Only] URL of thezone where the instance group resides (for autoscalers living in zonal scope). |
| Name | Datatype | Description |
|---|---|---|
id | string | [Output Only] Unique identifier for the resource; defined by the server. |
items | array | A list of Autoscaler resources. |
kind | string | Output only. Type of resource. (default: compute#regionAutoscalerList) |
nextPageToken | string | [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger thanmaxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. |
selfLink | string | Output only. [Output Only] Server-defined URL for this resource. |
warning | object | [Output Only] Informational warning message. |
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
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 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])?) |
autoscalingPolicy | object | The 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) |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
kind | string | Output only. [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. (default: compute#autoscaler) |
recommendedSize | integer (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. |
region | string | Output only. [Output Only] URL of theregion where the instance group resides (for autoscalers living in regional scope). |
scalingScheduleStatus | object | Output only. [Output Only] Status information of existing scaling schedules. |
selfLink | 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. (ACTIVE, DELETING, ERROR, PENDING) |
statusDetails | array | [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. |
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. [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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, region, autoscaler | Returns the specified autoscaler. | |
list | select | project, region | orderBy, filter, maxResults, pageToken, returnPartialSuccess | Retrieves a list of autoscalers contained within the specified region. |
aggregated_list | select | project | returnPartialSuccess, maxResults, pageToken, filter, serviceProjectNumber, includeAllScopes, orderBy | Retrieves an aggregated list of autoscalers. To prevent failure, it is recommended that you set the returnPartialSuccess parameter to true. |
insert | insert | project, region | requestId | Creates an autoscaler in the specified project using the data included in the request. |
patch | update | project, region | requestId, autoscaler | 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 | replace | project, region | autoscaler, requestId | Updates an autoscaler in the specified project using the data included in the request. |
delete | delete | project, region, autoscaler | requestId | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
autoscaler | string | |
project | string | |
region | string | |
autoscaler | string | |
filter | string | |
includeAllScopes | boolean | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean | |
serviceProjectNumber | string (int64) |
SELECT examples
- get
- list
- aggregated_list
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
;
Retrieves a list of autoscalers contained within
the specified region.
SELECT
id,
items,
kind,
nextPageToken,
selfLink,
warning
FROM google.compute.autoscalers
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
;
Retrieves an aggregated list of autoscalers.
To prevent failure, it is recommended that you set thereturnPartialSuccess parameter to true.
SELECT
id,
name,
autoscalingPolicy,
creationTimestamp,
description,
kind,
recommendedSize,
region,
scalingScheduleStatus,
selfLink,
status,
statusDetails,
target,
zone
FROM google.compute.autoscalers
WHERE project = '{{ project }}' -- required
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND orderBy = '{{ orderBy }}'
;
INSERT examples
- insert
- Manifest
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
;
# Description fields are for documentation purposes
- name: autoscalers
props:
- name: project
value: "{{ project }}"
description: Required parameter for the autoscalers resource.
- name: region
value: "{{ region }}"
description: Required parameter for the autoscalers resource.
- name: target
value: "{{ target }}"
description: |
URL of the managed instance group that this autoscaler will scale. This
field is required when creating an autoscaler.
- name: status
value: "{{ status }}"
description: |
[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.
valid_values: ['ACTIVE', 'DELETING', 'ERROR', 'PENDING']
- name: statusDetails
description: |
[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.
value:
- message: "{{ message }}"
type: "{{ type }}"
- name: name
value: "{{ name }}"
description: |
Name 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.
- name: autoscalingPolicy
description: |
The 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%.
value:
scaleInControl:
timeWindowSec: {{ timeWindowSec }}
maxScaledInReplicas:
calculated: {{ calculated }}
fixed: {{ fixed }}
percent: {{ percent }}
mode: "{{ mode }}"
coolDownPeriodSec: {{ coolDownPeriodSec }}
loadBalancingUtilization:
utilizationTarget: {{ utilizationTarget }}
stabilizationPeriodSec: {{ stabilizationPeriodSec }}
customMetricUtilizations:
- singleInstanceAssignment: {{ singleInstanceAssignment }}
metric: "{{ metric }}"
utilizationTargetType: "{{ utilizationTargetType }}"
utilizationTarget: {{ utilizationTarget }}
filter: "{{ filter }}"
minNumReplicas: {{ minNumReplicas }}
cpuUtilization:
utilizationTarget: {{ utilizationTarget }}
predictiveMethod: "{{ predictiveMethod }}"
scalingSchedules: "{{ scalingSchedules }}"
maxNumReplicas: {{ maxNumReplicas }}
- name: selfLink
value: "{{ selfLink }}"
description: |
[Output Only] Server-defined URL for the resource.
- name: description
value: "{{ description }}"
description: |
An optional description of this resource. Provide this property when you
create the resource.
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- patch
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
- update
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
- delete
Deletes the specified autoscaler.
DELETE FROM google.compute.autoscalers
WHERE project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND autoscaler = '{{ autoscaler }}' --required
AND requestId = '{{ requestId }}'
;