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
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | [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 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?) |
autoscalingPolicy | object | 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%. (id: AutoscalingPolicy) |
creationTimestamp | 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. |
kind | string | [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. (default: compute#autoscaler) |
recommendedSize | integer (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. |
region | string | [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). |
scalingScheduleStatus | object | [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. |
statusDetails | array | [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). |
Successful response
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 | 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 than maxResults, 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] Server-defined URL for this resource. |
warning | object | [Output Only] Informational warning message. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | [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 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?) |
autoscalingPolicy | object | 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%. (id: AutoscalingPolicy) |
creationTimestamp | 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. |
kind | string | [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. (default: compute#autoscaler) |
recommendedSize | integer (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. |
region | string | [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). |
scalingScheduleStatus | object | [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. |
statusDetails | array | [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). |
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 | filter , maxResults , orderBy , pageToken , returnPartialSuccess | Retrieves a list of autoscalers contained within the specified region. |
aggregated_list | select | project | filter , includeAllScopes , maxResults , orderBy , pageToken , returnPartialSuccess , serviceProjectNumber | Retrieves an aggregated list of autoscalers. To prevent failure, Google recommends 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 | autoscaler , requestId | 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 | 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 filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}';
Retrieves an aggregated list of autoscalers. To prevent failure, Google recommends that you set the returnPartialSuccess
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 filter = '{{ filter }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}';
INSERT
examples
- insert
- Manifest
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
;
# Description fields are for documentation purposes
- name: autoscalers
props:
- name: project
value: string
description: Required parameter for the autoscalers resource.
- name: region
value: string
description: Required parameter for the autoscalers resource.
- name: kind
value: string
description: >
[Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
default: compute#autoscaler
- name: id
value: string
description: >
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
- name: creationTimestamp
value: string
description: >
[Output Only] Creation timestamp in RFC3339 text format.
- name: name
value: string
description: >
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.
- name: description
value: string
description: >
An optional description of this resource. Provide this property when you create the resource.
- name: target
value: string
description: >
URL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler.
- name: autoscalingPolicy
value: object
description: >
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%.
- name: zone
value: string
description: >
[Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
- name: region
value: string
description: >
[Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
- name: selfLink
value: string
description: >
[Output Only] Server-defined URL for the resource.
- name: status
value: string
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
value: array
description: >
[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.
- name: recommendedSize
value: integer
description: >
[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.
- name: scalingScheduleStatus
value: object
description: >
[Output Only] Status information of existing scaling schedules.
- name: requestId
value: string
UPDATE
examples
- patch
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
- update
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
- 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 }}';