blob: 8a9a543cd5209b544091e30efaca705929188c0f [file] [log] [blame]
Takashi Matsuo06694102015-09-11 13:55:40 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_v1.html">Compute Engine API</a> . <a href="compute_v1.autoscalers.html">autoscalers</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080079<p class="firstline">Retrieves an aggregated list of autoscalers.</p>
Takashi Matsuo06694102015-09-11 13:55:40 -070080<p class="toc_element">
81 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
82<p class="firstline">Retrieves the next page of results.</p>
83<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070084 <code><a href="#close">close()</a></code></p>
85<p class="firstline">Close httplib2 connections.</p>
86<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087 <code><a href="#delete">delete(project, zone, autoscaler, requestId=None)</a></code></p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070088<p class="firstline">Deletes the specified autoscaler.</p>
Takashi Matsuo06694102015-09-11 13:55:40 -070089<p class="toc_element">
90 <code><a href="#get">get(project, zone, autoscaler)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091<p class="firstline">Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.</p>
Takashi Matsuo06694102015-09-11 13:55:40 -070092<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#insert">insert(project, zone, body=None, requestId=None)</a></code></p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070094<p class="firstline">Creates an autoscaler in the specified project using the data included in the request.</p>
Takashi Matsuo06694102015-09-11 13:55:40 -070095<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070096 <code><a href="#list">list(project, zone, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070097<p class="firstline">Retrieves a list of autoscalers contained within the specified zone.</p>
Takashi Matsuo06694102015-09-11 13:55:40 -070098<p class="toc_element">
99 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
100<p class="firstline">Retrieves the next page of results.</p>
101<p class="toc_element">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800102 <code><a href="#patch">patch(project, zone, autoscaler=None, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700103<p class="firstline">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.</p>
Takashi Matsuo06694102015-09-11 13:55:40 -0700104<p class="toc_element">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800105 <code><a href="#update">update(project, zone, autoscaler=None, body=None, requestId=None)</a></code></p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700106<p class="firstline">Updates an autoscaler in the specified project using the data included in the request.</p>
Takashi Matsuo06694102015-09-11 13:55:40 -0700107<h3>Method Details</h3>
108<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700109 <code class="details" id="aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800110 <pre>Retrieves an aggregated list of autoscalers.
Takashi Matsuo06694102015-09-11 13:55:40 -0700111
112Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800113 project: string, Project ID for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700114 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700115
Dan O'Mearadd494642020-05-01 07:42:23 -0700116For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700117
Dan O'Mearadd494642020-05-01 07:42:23 -0700118You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800119
Bu Sun Kim65020912020-05-20 12:08:20 -0700120To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = &quot;Intel Skylake&quot;) ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = &quot;Intel Skylake&quot;) OR (cpuPlatform = &quot;Intel Broadwell&quot;) AND (scheduling.automaticRestart = true) ```
Dan O'Mearadd494642020-05-01 07:42:23 -0700121 includeAllScopes: boolean, Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
Bu Sun Kim65020912020-05-20 12:08:20 -0700122 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
123 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
124
125You can also sort results in descending order based on the creation timestamp using `orderBy=&quot;creationTimestamp desc&quot;`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
126
127Currently, only sorting by `name` or `creationTimestamp desc` is supported.
128 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700129 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
Takashi Matsuo06694102015-09-11 13:55:40 -0700130
131Returns:
132 An object of the form:
133
134 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800135 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
136 &quot;items&quot;: { # A list of AutoscalersScopedList resources.
137 &quot;a_key&quot;: { # [Output Only] Name of the scope containing this set of autoscalers.
138 &quot;autoscalers&quot;: [ # [Output Only] A list of autoscalers contained in this scope.
139 { # Represents an Autoscaler resource.
140 #
141 # Google Compute Engine has two Autoscaler resources:
142 #
143 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
144 #
145 # 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.
146 #
147 # For zonal managed instance groups resource, use the autoscaler resource.
148 #
149 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
150 &quot;autoscalingPolicy&quot;: { # Cloud Autoscaler policy. # The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization.
Bu Sun Kim65020912020-05-20 12:08:20 -0700151 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800152 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
153 &quot;coolDownPeriodSec&quot;: 42, # The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700154 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800155 # Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
156 &quot;cpuUtilization&quot;: { # CPU utilization policy. # Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
157 &quot;utilizationTarget&quot;: 3.14, # The target CPU utilization that the autoscaler should maintain. Must be a float value in the range (0, 1]. If not specified, the default is 0.6.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700158 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800159 # If the CPU level is below the target utilization, the autoscaler scales down the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization.
160 #
161 # If the average CPU is above the target utilization, the autoscaler scales up until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization.
Takashi Matsuo06694102015-09-11 13:55:40 -0700162 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800163 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
164 { # Custom utilization metric policy.
165 &quot;filter&quot;: &quot;A String&quot;, # A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data.
166 #
167 # For the filter to be valid for autoscaling purposes, the following rules apply:
168 # - You can only use the AND operator for joining selectors.
169 # - You can only use direct equality comparison operator (=) without any functions for each selector.
170 # - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical.
171 # - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels.
172 # If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling.
173 #
174 # If not specified, the type defaults to gce_instance.
175 #
176 # You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
177 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
178 #
179 # The metric must have a value type of INT64 or DOUBLE.
180 &quot;singleInstanceAssignment&quot;: 3.14, # If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing.
181 #
182 # A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances.
183 #
184 # A bad example would be a metric exporting an average or median latency, since this value can&#x27;t include a chunk assignable to a single instance, it could be better used with utilization_target instead.
185 &quot;utilizationTarget&quot;: 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric.
186 #
187 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
188 &quot;utilizationTargetType&quot;: &quot;A String&quot;, # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
Bu Sun Kim65020912020-05-20 12:08:20 -0700189 },
190 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800191 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
192 &quot;utilizationTarget&quot;: 3.14, # Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.
193 },
194 &quot;maxNumReplicas&quot;: 42, # The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.
195 &quot;minNumReplicas&quot;: 42, # The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.
196 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
197 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
198 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
199 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
200 #
201 #
202 # - If the value is fixed, then the calculated value is equal to the fixed value.
203 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
204 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
205 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
206 },
207 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
208 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700209 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800210 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
211 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
212 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
213 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
214 &quot;name&quot;: &quot;A String&quot;, # 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.
215 &quot;recommendedSize&quot;: 42, # [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates recommended MIG size even when autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to the existing managed instance group or autoscaler did not generate its prediction.
216 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
217 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
218 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
219 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
220 # - DELETING: Configuration is being deleted.
221 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
222 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
223 &quot;statusDetails&quot;: [ # [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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700224 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800225 &quot;message&quot;: &quot;A String&quot;, # The status message.
226 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
227 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
228 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
229 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
230 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
231 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
232 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
233 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
234 # - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer.
235 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
236 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
237 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
238 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
239 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
240 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
241 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
242 # - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you&#x27;re using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions.
Bu Sun Kim65020912020-05-20 12:08:20 -0700243 },
244 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800245 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
246 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700247 },
248 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800249 &quot;warning&quot;: { # [Output Only] Informational warning which replaces the list of autoscalers when the list is empty.
250 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
251 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
252 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
253 {
254 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
255 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
256 },
257 ],
258 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
259 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700260 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800261 },
262 &quot;kind&quot;: &quot;compute#autoscalerAggregatedList&quot;, # [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers.
263 &quot;nextPageToken&quot;: &quot;A String&quot;, # [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.
264 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
265 &quot;unreachables&quot;: [ # [Output Only] Unreachable resources.
266 &quot;A String&quot;,
267 ],
268 &quot;warning&quot;: { # [Output Only] Informational warning message.
269 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
270 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
271 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
272 {
273 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
274 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
275 },
276 ],
277 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
278 },
279}</pre>
Takashi Matsuo06694102015-09-11 13:55:40 -0700280</div>
281
282<div class="method">
283 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
284 <pre>Retrieves the next page of results.
285
286Args:
287 previous_request: The request for the previous page. (required)
288 previous_response: The response from the request for the previous page. (required)
289
290Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700291 A request object that you can call &#x27;execute()&#x27; on to request the next
Takashi Matsuo06694102015-09-11 13:55:40 -0700292 page. Returns None if there are no more items in the collection.
293 </pre>
294</div>
295
296<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700297 <code class="details" id="close">close()</code>
298 <pre>Close httplib2 connections.</pre>
299</div>
300
301<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700302 <code class="details" id="delete">delete(project, zone, autoscaler, requestId=None)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700303 <pre>Deletes the specified autoscaler.
Takashi Matsuo06694102015-09-11 13:55:40 -0700304
305Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800306 project: string, Project ID for this request. (required)
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700307 zone: string, Name of the zone for this request. (required)
308 autoscaler: string, Name of the autoscaler to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700309 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
310
311For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
312
313The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Takashi Matsuo06694102015-09-11 13:55:40 -0700314
315Returns:
316 An object of the form:
317
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700318 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800319 #
320 # Google Compute Engine has three Operation resources:
321 #
322 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
323 #
324 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
325 #
326 # Operations can be global, regional or zonal.
327 # - For global operations, use the `globalOperations` resource.
328 # - For regional operations, use the `regionOperations` resource.
329 # - For zonal operations, use the `zonalOperations` resource.
330 #
331 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
332 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
333 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
334 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
335 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
336 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
337 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700338 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800339 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
340 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
341 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700342 },
343 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800344 },
345 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
346 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
347 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
348 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
349 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
350 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
351 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
352 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
353 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
354 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
355 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
356 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
357 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
358 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
359 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
360 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
361 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
362 {
363 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
364 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
365 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
366 {
367 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
368 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
369 },
370 ],
371 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
372 },
373 ],
374 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
375}</pre>
Takashi Matsuo06694102015-09-11 13:55:40 -0700376</div>
377
378<div class="method">
379 <code class="details" id="get">get(project, zone, autoscaler)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700380 <pre>Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.
Takashi Matsuo06694102015-09-11 13:55:40 -0700381
382Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800383 project: string, Project ID for this request. (required)
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700384 zone: string, Name of the zone for this request. (required)
385 autoscaler: string, Name of the autoscaler to return. (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700386
387Returns:
388 An object of the form:
389
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700390 { # Represents an Autoscaler resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800391 #
392 # Google Compute Engine has two Autoscaler resources:
393 #
394 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
395 #
396 # 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.
397 #
398 # For zonal managed instance groups resource, use the autoscaler resource.
399 #
400 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
401 &quot;autoscalingPolicy&quot;: { # Cloud Autoscaler policy. # The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization.
Bu Sun Kim65020912020-05-20 12:08:20 -0700402 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800403 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
404 &quot;coolDownPeriodSec&quot;: 42, # The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700405 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800406 # Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
407 &quot;cpuUtilization&quot;: { # CPU utilization policy. # Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
408 &quot;utilizationTarget&quot;: 3.14, # The target CPU utilization that the autoscaler should maintain. Must be a float value in the range (0, 1]. If not specified, the default is 0.6.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700409 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800410 # If the CPU level is below the target utilization, the autoscaler scales down the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization.
411 #
412 # If the average CPU is above the target utilization, the autoscaler scales up until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization.
Bu Sun Kim65020912020-05-20 12:08:20 -0700413 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800414 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
415 { # Custom utilization metric policy.
416 &quot;filter&quot;: &quot;A String&quot;, # A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data.
417 #
418 # For the filter to be valid for autoscaling purposes, the following rules apply:
419 # - You can only use the AND operator for joining selectors.
420 # - You can only use direct equality comparison operator (=) without any functions for each selector.
421 # - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical.
422 # - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels.
423 # If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling.
424 #
425 # If not specified, the type defaults to gce_instance.
426 #
427 # You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
428 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
429 #
430 # The metric must have a value type of INT64 or DOUBLE.
431 &quot;singleInstanceAssignment&quot;: 3.14, # If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing.
432 #
433 # A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances.
434 #
435 # A bad example would be a metric exporting an average or median latency, since this value can&#x27;t include a chunk assignable to a single instance, it could be better used with utilization_target instead.
436 &quot;utilizationTarget&quot;: 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric.
437 #
438 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
439 &quot;utilizationTargetType&quot;: &quot;A String&quot;, # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
Bu Sun Kim65020912020-05-20 12:08:20 -0700440 },
441 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800442 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
443 &quot;utilizationTarget&quot;: 3.14, # Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.
444 },
445 &quot;maxNumReplicas&quot;: 42, # The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.
446 &quot;minNumReplicas&quot;: 42, # The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.
447 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
448 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
449 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
450 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
451 #
452 #
453 # - If the value is fixed, then the calculated value is equal to the fixed value.
454 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
455 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
456 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
457 },
458 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
459 },
460 },
461 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
462 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
463 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
464 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
465 &quot;name&quot;: &quot;A String&quot;, # 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.
466 &quot;recommendedSize&quot;: 42, # [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates recommended MIG size even when autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to the existing managed instance group or autoscaler did not generate its prediction.
467 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
468 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
469 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
470 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
471 # - DELETING: Configuration is being deleted.
472 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
473 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
474 &quot;statusDetails&quot;: [ # [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.
475 {
476 &quot;message&quot;: &quot;A String&quot;, # The status message.
477 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
478 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
479 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
480 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
481 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
482 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
483 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
484 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
485 # - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer.
486 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
487 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
488 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
489 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
490 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
491 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
492 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
493 # - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you&#x27;re using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions.
494 },
495 ],
496 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
497 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
498}</pre>
Takashi Matsuo06694102015-09-11 13:55:40 -0700499</div>
500
501<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700502 <code class="details" id="insert">insert(project, zone, body=None, requestId=None)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700503 <pre>Creates an autoscaler in the specified project using the data included in the request.
Takashi Matsuo06694102015-09-11 13:55:40 -0700504
505Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800506 project: string, Project ID for this request. (required)
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700507 zone: string, Name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700508 body: object, The request body.
Takashi Matsuo06694102015-09-11 13:55:40 -0700509 The object takes the form of:
510
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700511{ # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700512 #
513 # Google Compute Engine has two Autoscaler resources:
514 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700515 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
Bu Sun Kim65020912020-05-20 12:08:20 -0700516 #
517 # 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.
518 #
519 # For zonal managed instance groups resource, use the autoscaler resource.
520 #
521 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
522 &quot;autoscalingPolicy&quot;: { # Cloud Autoscaler policy. # The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700523 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700524 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
525 &quot;coolDownPeriodSec&quot;: 42, # The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds.
526 #
527 # Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
528 &quot;cpuUtilization&quot;: { # CPU utilization policy. # Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
529 &quot;utilizationTarget&quot;: 3.14, # The target CPU utilization that the autoscaler should maintain. Must be a float value in the range (0, 1]. If not specified, the default is 0.6.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700530 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700531 # If the CPU level is below the target utilization, the autoscaler scales down the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization.
532 #
533 # If the average CPU is above the target utilization, the autoscaler scales up until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization.
Takashi Matsuo06694102015-09-11 13:55:40 -0700534 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700535 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
536 { # Custom utilization metric policy.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700537 &quot;filter&quot;: &quot;A String&quot;, # A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data.
538 #
539 # For the filter to be valid for autoscaling purposes, the following rules apply:
540 # - You can only use the AND operator for joining selectors.
541 # - You can only use direct equality comparison operator (=) without any functions for each selector.
542 # - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical.
543 # - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels.
544 # If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling.
545 #
546 # If not specified, the type defaults to gce_instance.
547 #
548 # You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
Bu Sun Kim65020912020-05-20 12:08:20 -0700549 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
550 #
551 # The metric must have a value type of INT64 or DOUBLE.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700552 &quot;singleInstanceAssignment&quot;: 3.14, # If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing.
553 #
554 # A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances.
555 #
556 # A bad example would be a metric exporting an average or median latency, since this value can&#x27;t include a chunk assignable to a single instance, it could be better used with utilization_target instead.
Bu Sun Kim65020912020-05-20 12:08:20 -0700557 &quot;utilizationTarget&quot;: 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric.
558 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700559 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim65020912020-05-20 12:08:20 -0700560 &quot;utilizationTargetType&quot;: &quot;A String&quot;, # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700561 },
562 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700563 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
564 &quot;utilizationTarget&quot;: 3.14, # Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.
565 },
566 &quot;maxNumReplicas&quot;: 42, # The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.
567 &quot;minNumReplicas&quot;: 42, # The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.
568 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700569 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
570 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
571 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
572 #
573 #
574 # - If the value is fixed, then the calculated value is equal to the fixed value.
575 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
576 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
577 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
578 },
579 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
580 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700581 },
582 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
583 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
584 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
585 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
586 &quot;name&quot;: &quot;A String&quot;, # 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.
587 &quot;recommendedSize&quot;: 42, # [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates recommended MIG size even when autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to the existing managed instance group or autoscaler did not generate its prediction.
588 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
589 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
590 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
591 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
592 # - DELETING: Configuration is being deleted.
593 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
594 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
595 &quot;statusDetails&quot;: [ # [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.
596 {
597 &quot;message&quot;: &quot;A String&quot;, # The status message.
598 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
599 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
600 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
601 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
602 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
603 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
604 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
605 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
606 # - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer.
607 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
608 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
609 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
610 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
611 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
612 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
613 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
614 # - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you&#x27;re using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions.
615 },
616 ],
617 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
618 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
619}
Takashi Matsuo06694102015-09-11 13:55:40 -0700620
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700621 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
622
623For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
624
625The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Takashi Matsuo06694102015-09-11 13:55:40 -0700626
627Returns:
628 An object of the form:
629
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700630 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800631 #
632 # Google Compute Engine has three Operation resources:
633 #
634 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
635 #
636 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
637 #
638 # Operations can be global, regional or zonal.
639 # - For global operations, use the `globalOperations` resource.
640 # - For regional operations, use the `regionOperations` resource.
641 # - For zonal operations, use the `zonalOperations` resource.
642 #
643 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
644 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
645 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
646 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
647 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
648 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
649 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700650 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800651 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
652 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
653 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700654 },
655 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800656 },
657 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
658 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
659 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
660 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
661 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
662 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
663 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
664 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
665 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
666 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
667 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
668 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
669 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
670 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
671 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
672 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
673 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
674 {
675 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
676 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
677 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
678 {
679 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
680 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
681 },
682 ],
683 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
684 },
685 ],
686 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
687}</pre>
Takashi Matsuo06694102015-09-11 13:55:40 -0700688</div>
689
690<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700691 <code class="details" id="list">list(project, zone, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700692 <pre>Retrieves a list of autoscalers contained within the specified zone.
Takashi Matsuo06694102015-09-11 13:55:40 -0700693
694Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800695 project: string, Project ID for this request. (required)
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700696 zone: string, Name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700697 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700698
Dan O'Mearadd494642020-05-01 07:42:23 -0700699For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700700
Dan O'Mearadd494642020-05-01 07:42:23 -0700701You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800702
Bu Sun Kim65020912020-05-20 12:08:20 -0700703To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = &quot;Intel Skylake&quot;) ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = &quot;Intel Skylake&quot;) OR (cpuPlatform = &quot;Intel Broadwell&quot;) AND (scheduling.automaticRestart = true) ```
704 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
705 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
706
707You can also sort results in descending order based on the creation timestamp using `orderBy=&quot;creationTimestamp desc&quot;`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
708
709Currently, only sorting by `name` or `creationTimestamp desc` is supported.
710 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700711 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
Takashi Matsuo06694102015-09-11 13:55:40 -0700712
713Returns:
714 An object of the form:
715
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700716 { # Contains a list of Autoscaler resources.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800717 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
718 &quot;items&quot;: [ # A list of Autoscaler resources.
719 { # Represents an Autoscaler resource.
720 #
721 # Google Compute Engine has two Autoscaler resources:
722 #
723 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
724 #
725 # 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.
726 #
727 # For zonal managed instance groups resource, use the autoscaler resource.
728 #
729 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
730 &quot;autoscalingPolicy&quot;: { # Cloud Autoscaler policy. # The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization.
Bu Sun Kim65020912020-05-20 12:08:20 -0700731 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800732 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
733 &quot;coolDownPeriodSec&quot;: 42, # The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700734 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800735 # Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
736 &quot;cpuUtilization&quot;: { # CPU utilization policy. # Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
737 &quot;utilizationTarget&quot;: 3.14, # The target CPU utilization that the autoscaler should maintain. Must be a float value in the range (0, 1]. If not specified, the default is 0.6.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700738 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800739 # If the CPU level is below the target utilization, the autoscaler scales down the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization.
740 #
741 # If the average CPU is above the target utilization, the autoscaler scales up until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization.
Takashi Matsuo06694102015-09-11 13:55:40 -0700742 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800743 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
744 { # Custom utilization metric policy.
745 &quot;filter&quot;: &quot;A String&quot;, # A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data.
746 #
747 # For the filter to be valid for autoscaling purposes, the following rules apply:
748 # - You can only use the AND operator for joining selectors.
749 # - You can only use direct equality comparison operator (=) without any functions for each selector.
750 # - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical.
751 # - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels.
752 # If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling.
753 #
754 # If not specified, the type defaults to gce_instance.
755 #
756 # You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
757 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
758 #
759 # The metric must have a value type of INT64 or DOUBLE.
760 &quot;singleInstanceAssignment&quot;: 3.14, # If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing.
761 #
762 # A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances.
763 #
764 # A bad example would be a metric exporting an average or median latency, since this value can&#x27;t include a chunk assignable to a single instance, it could be better used with utilization_target instead.
765 &quot;utilizationTarget&quot;: 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric.
766 #
767 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
768 &quot;utilizationTargetType&quot;: &quot;A String&quot;, # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
Bu Sun Kim65020912020-05-20 12:08:20 -0700769 },
770 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800771 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
772 &quot;utilizationTarget&quot;: 3.14, # Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.
773 },
774 &quot;maxNumReplicas&quot;: 42, # The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.
775 &quot;minNumReplicas&quot;: 42, # The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.
776 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
777 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
778 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
779 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
780 #
781 #
782 # - If the value is fixed, then the calculated value is equal to the fixed value.
783 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
784 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
785 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
786 },
787 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
788 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700789 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800790 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
791 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
792 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
793 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
794 &quot;name&quot;: &quot;A String&quot;, # 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.
795 &quot;recommendedSize&quot;: 42, # [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates recommended MIG size even when autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to the existing managed instance group or autoscaler did not generate its prediction.
796 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
797 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
798 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
799 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
800 # - DELETING: Configuration is being deleted.
801 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
802 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
803 &quot;statusDetails&quot;: [ # [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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700804 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800805 &quot;message&quot;: &quot;A String&quot;, # The status message.
806 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
807 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
808 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
809 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
810 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
811 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
812 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
813 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
814 # - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer.
815 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
816 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
817 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
818 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
819 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
820 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
821 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
822 # - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you&#x27;re using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700823 },
824 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800825 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
826 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700827 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800828 ],
829 &quot;kind&quot;: &quot;compute#autoscalerList&quot;, # [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers.
830 &quot;nextPageToken&quot;: &quot;A String&quot;, # [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.
831 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
832 &quot;warning&quot;: { # [Output Only] Informational warning message.
833 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
834 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
835 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
836 {
837 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
838 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
839 },
840 ],
841 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
842 },
843}</pre>
Takashi Matsuo06694102015-09-11 13:55:40 -0700844</div>
845
846<div class="method">
847 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
848 <pre>Retrieves the next page of results.
849
850Args:
851 previous_request: The request for the previous page. (required)
852 previous_response: The response from the request for the previous page. (required)
853
854Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700855 A request object that you can call &#x27;execute()&#x27; on to request the next
Takashi Matsuo06694102015-09-11 13:55:40 -0700856 page. Returns None if there are no more items in the collection.
857 </pre>
858</div>
859
860<div class="method">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800861 <code class="details" id="patch">patch(project, zone, autoscaler=None, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700862 <pre>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.
Takashi Matsuo06694102015-09-11 13:55:40 -0700863
864Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800865 project: string, Project ID for this request. (required)
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700866 zone: string, Name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700867 body: object, The request body.
Takashi Matsuo06694102015-09-11 13:55:40 -0700868 The object takes the form of:
869
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700870{ # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700871 #
872 # Google Compute Engine has two Autoscaler resources:
873 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700874 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
Bu Sun Kim65020912020-05-20 12:08:20 -0700875 #
876 # 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.
877 #
878 # For zonal managed instance groups resource, use the autoscaler resource.
879 #
880 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
881 &quot;autoscalingPolicy&quot;: { # Cloud Autoscaler policy. # The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700882 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700883 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
884 &quot;coolDownPeriodSec&quot;: 42, # The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds.
885 #
886 # Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
887 &quot;cpuUtilization&quot;: { # CPU utilization policy. # Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
888 &quot;utilizationTarget&quot;: 3.14, # The target CPU utilization that the autoscaler should maintain. Must be a float value in the range (0, 1]. If not specified, the default is 0.6.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700889 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700890 # If the CPU level is below the target utilization, the autoscaler scales down the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization.
891 #
892 # If the average CPU is above the target utilization, the autoscaler scales up until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization.
Takashi Matsuo06694102015-09-11 13:55:40 -0700893 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700894 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
895 { # Custom utilization metric policy.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700896 &quot;filter&quot;: &quot;A String&quot;, # A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data.
897 #
898 # For the filter to be valid for autoscaling purposes, the following rules apply:
899 # - You can only use the AND operator for joining selectors.
900 # - You can only use direct equality comparison operator (=) without any functions for each selector.
901 # - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical.
902 # - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels.
903 # If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling.
904 #
905 # If not specified, the type defaults to gce_instance.
906 #
907 # You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
Bu Sun Kim65020912020-05-20 12:08:20 -0700908 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
909 #
910 # The metric must have a value type of INT64 or DOUBLE.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700911 &quot;singleInstanceAssignment&quot;: 3.14, # If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing.
912 #
913 # A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances.
914 #
915 # A bad example would be a metric exporting an average or median latency, since this value can&#x27;t include a chunk assignable to a single instance, it could be better used with utilization_target instead.
Bu Sun Kim65020912020-05-20 12:08:20 -0700916 &quot;utilizationTarget&quot;: 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric.
917 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700918 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim65020912020-05-20 12:08:20 -0700919 &quot;utilizationTargetType&quot;: &quot;A String&quot;, # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700920 },
921 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700922 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
923 &quot;utilizationTarget&quot;: 3.14, # Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.
924 },
925 &quot;maxNumReplicas&quot;: 42, # The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.
926 &quot;minNumReplicas&quot;: 42, # The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.
927 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700928 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
929 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
930 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
931 #
932 #
933 # - If the value is fixed, then the calculated value is equal to the fixed value.
934 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
935 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
936 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
937 },
938 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
939 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700940 },
941 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
942 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
943 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
944 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
945 &quot;name&quot;: &quot;A String&quot;, # 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.
946 &quot;recommendedSize&quot;: 42, # [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates recommended MIG size even when autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to the existing managed instance group or autoscaler did not generate its prediction.
947 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
948 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
949 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
950 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
951 # - DELETING: Configuration is being deleted.
952 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
953 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
954 &quot;statusDetails&quot;: [ # [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.
955 {
956 &quot;message&quot;: &quot;A String&quot;, # The status message.
957 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
958 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
959 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
960 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
961 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
962 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
963 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
964 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
965 # - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer.
966 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
967 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
968 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
969 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
970 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
971 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
972 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
973 # - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you&#x27;re using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions.
974 },
975 ],
976 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
977 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
978}
Takashi Matsuo06694102015-09-11 13:55:40 -0700979
Bu Sun Kim65020912020-05-20 12:08:20 -0700980 autoscaler: string, Name of the autoscaler to patch.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700981 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
982
983For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
984
985The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Takashi Matsuo06694102015-09-11 13:55:40 -0700986
987Returns:
988 An object of the form:
989
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700990 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800991 #
992 # Google Compute Engine has three Operation resources:
993 #
994 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
995 #
996 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
997 #
998 # Operations can be global, regional or zonal.
999 # - For global operations, use the `globalOperations` resource.
1000 # - For regional operations, use the `regionOperations` resource.
1001 # - For zonal operations, use the `zonalOperations` resource.
1002 #
1003 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1004 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1005 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1006 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1007 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1008 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1009 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001010 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001011 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1012 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1013 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -07001014 },
1015 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001016 },
1017 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
1018 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
1019 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1020 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1021 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1022 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1023 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1024 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
1025 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1026 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1027 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1028 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
1029 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1030 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1031 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
1032 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1033 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1034 {
1035 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1036 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1037 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1038 {
1039 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
1040 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1041 },
1042 ],
1043 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1044 },
1045 ],
1046 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
1047}</pre>
Takashi Matsuo06694102015-09-11 13:55:40 -07001048</div>
1049
1050<div class="method">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001051 <code class="details" id="update">update(project, zone, autoscaler=None, body=None, requestId=None)</code>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001052 <pre>Updates an autoscaler in the specified project using the data included in the request.
Takashi Matsuo06694102015-09-11 13:55:40 -07001053
1054Args:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001055 project: string, Project ID for this request. (required)
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001056 zone: string, Name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001057 body: object, The request body.
Takashi Matsuo06694102015-09-11 13:55:40 -07001058 The object takes the form of:
1059
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001060{ # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -07001061 #
1062 # Google Compute Engine has two Autoscaler resources:
1063 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001064 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
Bu Sun Kim65020912020-05-20 12:08:20 -07001065 #
1066 # 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.
1067 #
1068 # For zonal managed instance groups resource, use the autoscaler resource.
1069 #
1070 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
1071 &quot;autoscalingPolicy&quot;: { # Cloud Autoscaler policy. # The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001072 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001073 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
1074 &quot;coolDownPeriodSec&quot;: 42, # The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds.
1075 #
1076 # Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process.
1077 &quot;cpuUtilization&quot;: { # CPU utilization policy. # Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group.
1078 &quot;utilizationTarget&quot;: 3.14, # The target CPU utilization that the autoscaler should maintain. Must be a float value in the range (0, 1]. If not specified, the default is 0.6.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -07001079 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001080 # If the CPU level is below the target utilization, the autoscaler scales down the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization.
1081 #
1082 # If the average CPU is above the target utilization, the autoscaler scales up until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization.
Takashi Matsuo06694102015-09-11 13:55:40 -07001083 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001084 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
1085 { # Custom utilization metric policy.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001086 &quot;filter&quot;: &quot;A String&quot;, # A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data.
1087 #
1088 # For the filter to be valid for autoscaling purposes, the following rules apply:
1089 # - You can only use the AND operator for joining selectors.
1090 # - You can only use direct equality comparison operator (=) without any functions for each selector.
1091 # - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical.
1092 # - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels.
1093 # If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling.
1094 #
1095 # If not specified, the type defaults to gce_instance.
1096 #
1097 # You should provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value.
Bu Sun Kim65020912020-05-20 12:08:20 -07001098 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
1099 #
1100 # The metric must have a value type of INT64 or DOUBLE.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001101 &quot;singleInstanceAssignment&quot;: 3.14, # If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler will keep the number of instances proportional to the value of this metric, the metric itself should not change value due to group resizing.
1102 #
1103 # A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances.
1104 #
1105 # A bad example would be a metric exporting an average or median latency, since this value can&#x27;t include a chunk assignable to a single instance, it could be better used with utilization_target instead.
Bu Sun Kim65020912020-05-20 12:08:20 -07001106 &quot;utilizationTarget&quot;: 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric.
1107 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001108 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim65020912020-05-20 12:08:20 -07001109 &quot;utilizationTargetType&quot;: &quot;A String&quot;, # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001110 },
1111 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001112 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
1113 &quot;utilizationTarget&quot;: 3.14, # Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8.
1114 },
1115 &quot;maxNumReplicas&quot;: 42, # The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas.
1116 &quot;minNumReplicas&quot;: 42, # The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. If not provided, autoscaler will choose a default value depending on maximum number of instances allowed.
1117 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001118 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
1119 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
1120 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1121 #
1122 #
1123 # - If the value is fixed, then the calculated value is equal to the fixed value.
1124 # - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
1125 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1126 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1127 },
1128 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
1129 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001130 },
1131 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
1132 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
1133 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1134 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
1135 &quot;name&quot;: &quot;A String&quot;, # 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.
1136 &quot;recommendedSize&quot;: 42, # [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates recommended MIG size even when autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to the existing managed instance group or autoscaler did not generate its prediction.
1137 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
1138 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1139 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
1140 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
1141 # - DELETING: Configuration is being deleted.
1142 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
1143 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
1144 &quot;statusDetails&quot;: [ # [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.
1145 {
1146 &quot;message&quot;: &quot;A String&quot;, # The status message.
1147 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
1148 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
1149 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
1150 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
1151 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
1152 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
1153 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
1154 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
1155 # - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer.
1156 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
1157 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
1158 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
1159 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
1160 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
1161 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
1162 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
1163 # - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you&#x27;re using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions.
1164 },
1165 ],
1166 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
1167 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
1168}
Takashi Matsuo06694102015-09-11 13:55:40 -07001169
Bu Sun Kim65020912020-05-20 12:08:20 -07001170 autoscaler: string, Name of the autoscaler to update.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001171 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
1172
1173For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
1174
1175The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Takashi Matsuo06694102015-09-11 13:55:40 -07001176
1177Returns:
1178 An object of the form:
1179
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001180 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001181 #
1182 # Google Compute Engine has three Operation resources:
1183 #
1184 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1185 #
1186 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1187 #
1188 # Operations can be global, regional or zonal.
1189 # - For global operations, use the `globalOperations` resource.
1190 # - For regional operations, use the `regionOperations` resource.
1191 # - For zonal operations, use the `zonalOperations` resource.
1192 #
1193 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1194 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1195 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1196 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1197 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1198 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1199 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001200 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001201 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1202 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1203 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -07001204 },
1205 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001206 },
1207 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
1208 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
1209 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1210 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1211 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1212 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1213 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1214 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
1215 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1216 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1217 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
1218 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
1219 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1220 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1221 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
1222 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1223 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1224 {
1225 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
1226 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1227 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1228 {
1229 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
1230 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1231 },
1232 ],
1233 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1234 },
1235 ],
1236 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
1237}</pre>
Takashi Matsuo06694102015-09-11 13:55:40 -07001238</div>
1239
1240</body></html>