blob: 2cdb3d895ec5a892ffcf2df5746b298941d0d55b [file] [log] [blame]
Sai Cheemalapatidf613972016-10-21 13:59:49 -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_beta.html">Compute Engine API</a> . <a href="compute_beta.autoscalers.html">autoscalers</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070078 <code><a href="#aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070079<p class="firstline">Retrieves an aggregated list of autoscalers.</p>
80<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">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070084 <code><a href="#delete">delete(project, zone, autoscaler, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070085<p class="firstline">Deletes the specified autoscaler.</p>
86<p class="toc_element">
87 <code><a href="#get">get(project, zone, autoscaler)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070088<p class="firstline">Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.</p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070089<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#insert">insert(project, zone, body=None, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070091<p class="firstline">Creates an autoscaler in the specified project using the data included in the request.</p>
92<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070093 <code><a href="#list">list(project, zone, filter=None, maxResults=None, orderBy=None, pageToken=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070094<p class="firstline">Retrieves a list of autoscalers contained within the specified zone.</p>
95<p class="toc_element">
96 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
97<p class="firstline">Retrieves the next page of results.</p>
98<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070099 <code><a href="#patch">patch(project, zone, body=None, autoscaler=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100<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>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700101<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700102 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700103<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
104<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -0700105 <code><a href="#update">update(project, zone, body=None, autoscaler=None, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700106<p class="firstline">Updates an autoscaler in the specified project using the data included in the request.</p>
107<h3>Method Details</h3>
108<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700109 <code class="details" id="aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700110 <pre>Retrieves an aggregated list of autoscalers.
111
112Args:
113 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;`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -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`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700119
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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700129
130Returns:
131 An object of the form:
132
133 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700134 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
135 &quot;items&quot;: { # A list of AutoscalersScopedList resources.
136 &quot;a_key&quot;: { # [Output Only] Name of the scope containing this set of autoscalers.
137 &quot;autoscalers&quot;: [ # [Output Only] A list of autoscalers contained in this scope.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700138 { # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700139 #
140 # Google Compute Engine has two Autoscaler resources:
141 #
142 # * [Global](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
143 #
144 # 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.
145 #
146 # For zonal managed instance groups resource, use the autoscaler resource.
147 #
148 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
149 &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 -0700150 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700151 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
152 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700153 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700154 # 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.
155 &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.
156 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700157 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700158 # 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.
159 #
160 # 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700161 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700162 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
163 { # Custom utilization metric policy.
164 &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.
165 #
166 # For the filter to be valid for autoscaling purposes, the following rules apply:
167 # - You can only use the AND operator for joining selectors.
168 # - You can only use direct equality comparison operator (=) without any functions for each selector.
169 # - 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.
170 # - 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.
171 # 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.
172 #
173 # If not specified, the type defaults to gce_instance.
174 #
175 # 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.
176 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
177 #
178 # The metric must have a value type of INT64 or DOUBLE.
179 &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.
180 #
181 # 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.
182 #
183 # 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.
184 &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.
185 #
186 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
187 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700188 },
189 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700190 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
191 &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.
192 },
193 &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.
194 &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.
195 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
196 &quot;scaleDownControl&quot;: { # Configuration that allows for slower scale down so that even if Autoscaler recommends an abrupt scale down of a MIG, it will be throttled as specified by the parameters below.
197 &quot;maxScaledDownReplicas&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.
198 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
199 #
200 #
201 # - If the value is fixed, then the calculated value is equal to the fixed value.
202 # - 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.
203 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
204 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
205 },
206 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
207 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700208 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700209 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
210 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
211 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
212 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
213 &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.
214 &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.
215 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
216 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
217 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
218 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
219 # - DELETING: Configuration is being deleted.
220 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
221 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
222 &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.
223 {
224 &quot;message&quot;: &quot;A String&quot;, # The status message.
225 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
226 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
227 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
228 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
229 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
230 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
231 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
232 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
233 # - 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.
234 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
235 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
236 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
237 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
238 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
239 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
240 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
241 # - 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.
242 },
243 ],
244 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
245 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
246 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700247 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700248 &quot;warning&quot;: { # [Output Only] Informational warning which replaces the list of autoscalers when the list is empty.
249 &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.
250 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
251 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
252 {
253 &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).
254 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
255 },
256 ],
257 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
258 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700259 },
260 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700261 &quot;kind&quot;: &quot;compute#autoscalerAggregatedList&quot;, # [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers.
262 &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.
263 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
264 &quot;warning&quot;: { # [Output Only] Informational warning message.
265 &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.
266 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
267 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700268 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700269 &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).
270 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700271 },
272 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700273 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700274 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700275 }</pre>
276</div>
277
278<div class="method">
279 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
280 <pre>Retrieves the next page of results.
281
282Args:
283 previous_request: The request for the previous page. (required)
284 previous_response: The response from the request for the previous page. (required)
285
286Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700287 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700288 page. Returns None if there are no more items in the collection.
289 </pre>
290</div>
291
292<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700293 <code class="details" id="delete">delete(project, zone, autoscaler, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700294 <pre>Deletes the specified autoscaler.
295
296Args:
297 project: string, Project ID for this request. (required)
298 zone: string, Name of the zone for this request. (required)
299 autoscaler: string, Name of the autoscaler to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700300 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.
301
302For 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.
303
304The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700305
306Returns:
307 An object of the form:
308
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700309 { # Represents an Operation resource.
310 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700311 # Google Compute Engine has three Operation resources:
312 #
313 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
314 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700315 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
316 #
317 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700318 # - For global operations, use the `globalOperations` resource.
319 # - For regional operations, use the `regionOperations` resource.
320 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700321 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700322 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700323 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
324 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
325 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
326 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
327 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
328 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700329 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700330 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
331 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
332 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700333 },
334 ],
335 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700336 &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`.
337 &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.
338 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
339 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
340 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
341 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
342 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
343 &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.
344 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
345 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
346 &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.
347 &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`.
348 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
349 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
350 &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.
351 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
352 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
353 {
354 &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.
355 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
356 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
357 {
358 &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).
359 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
360 },
361 ],
362 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
363 },
364 ],
365 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700366 }</pre>
367</div>
368
369<div class="method">
370 <code class="details" id="get">get(project, zone, autoscaler)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700371 <pre>Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700372
373Args:
374 project: string, Project ID for this request. (required)
375 zone: string, Name of the zone for this request. (required)
376 autoscaler: string, Name of the autoscaler to return. (required)
377
378Returns:
379 An object of the form:
380
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700381 { # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700382 #
383 # Google Compute Engine has two Autoscaler resources:
384 #
385 # * [Global](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
386 #
387 # 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.
388 #
389 # For zonal managed instance groups resource, use the autoscaler resource.
390 #
391 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
392 &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 -0700393 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700394 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
395 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700396 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700397 # 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.
398 &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.
399 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700400 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700401 # 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.
402 #
403 # 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700404 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700405 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
406 { # Custom utilization metric policy.
407 &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.
408 #
409 # For the filter to be valid for autoscaling purposes, the following rules apply:
410 # - You can only use the AND operator for joining selectors.
411 # - You can only use direct equality comparison operator (=) without any functions for each selector.
412 # - 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.
413 # - 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.
414 # 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.
415 #
416 # If not specified, the type defaults to gce_instance.
417 #
418 # 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.
419 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
420 #
421 # The metric must have a value type of INT64 or DOUBLE.
422 &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.
423 #
424 # 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.
425 #
426 # 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.
427 &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.
428 #
429 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
430 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700431 },
432 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700433 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
434 &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.
435 },
436 &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.
437 &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.
438 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
439 &quot;scaleDownControl&quot;: { # Configuration that allows for slower scale down so that even if Autoscaler recommends an abrupt scale down of a MIG, it will be throttled as specified by the parameters below.
440 &quot;maxScaledDownReplicas&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.
441 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
442 #
443 #
444 # - If the value is fixed, then the calculated value is equal to the fixed value.
445 # - 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.
446 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
447 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
448 },
449 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
450 },
451 },
452 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
453 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
454 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
455 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
456 &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.
457 &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.
458 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
459 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
460 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
461 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
462 # - DELETING: Configuration is being deleted.
463 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
464 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
465 &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.
466 {
467 &quot;message&quot;: &quot;A String&quot;, # The status message.
468 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
469 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
470 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
471 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
472 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
473 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
474 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
475 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
476 # - 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.
477 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
478 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
479 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
480 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
481 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
482 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
483 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
484 # - 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.
485 },
486 ],
487 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
488 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
489 }</pre>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700490</div>
491
492<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700493 <code class="details" id="insert">insert(project, zone, body=None, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700494 <pre>Creates an autoscaler in the specified project using the data included in the request.
495
496Args:
497 project: string, Project ID for this request. (required)
498 zone: string, Name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700499 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700500 The object takes the form of:
501
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700502{ # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700503 #
504 # Google Compute Engine has two Autoscaler resources:
505 #
506 # * [Global](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
507 #
508 # 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.
509 #
510 # For zonal managed instance groups resource, use the autoscaler resource.
511 #
512 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
513 &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 -0700514 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700515 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
516 &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.
517 #
518 # 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.
519 &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.
520 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700521 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700522 # 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.
523 #
524 # 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700525 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700526 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
527 { # Custom utilization metric policy.
528 &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.
529 #
530 # For the filter to be valid for autoscaling purposes, the following rules apply:
531 # - You can only use the AND operator for joining selectors.
532 # - You can only use direct equality comparison operator (=) without any functions for each selector.
533 # - 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.
534 # - 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.
535 # 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.
536 #
537 # If not specified, the type defaults to gce_instance.
538 #
539 # 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.
540 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
541 #
542 # The metric must have a value type of INT64 or DOUBLE.
543 &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.
544 #
545 # 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.
546 #
547 # 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.
548 &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.
549 #
550 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
551 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700552 },
553 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700554 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
555 &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.
556 },
557 &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.
558 &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.
559 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
560 &quot;scaleDownControl&quot;: { # Configuration that allows for slower scale down so that even if Autoscaler recommends an abrupt scale down of a MIG, it will be throttled as specified by the parameters below.
561 &quot;maxScaledDownReplicas&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.
562 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
563 #
564 #
565 # - If the value is fixed, then the calculated value is equal to the fixed value.
566 # - 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.
567 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
568 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
569 },
570 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
571 },
572 },
573 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
574 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
575 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
576 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
577 &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.
578 &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.
579 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
580 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
581 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
582 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
583 # - DELETING: Configuration is being deleted.
584 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
585 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
586 &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.
587 {
588 &quot;message&quot;: &quot;A String&quot;, # The status message.
589 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
590 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
591 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
592 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
593 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
594 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
595 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
596 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
597 # - 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.
598 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
599 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
600 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
601 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
602 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
603 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
604 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
605 # - 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.
606 },
607 ],
608 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
609 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
610}
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700611
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700612 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.
613
614For 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.
615
616The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700617
618Returns:
619 An object of the form:
620
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700621 { # Represents an Operation resource.
622 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700623 # Google Compute Engine has three Operation resources:
624 #
625 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
626 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700627 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
628 #
629 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700630 # - For global operations, use the `globalOperations` resource.
631 # - For regional operations, use the `regionOperations` resource.
632 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700633 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700634 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700635 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
636 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
637 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
638 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
639 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
640 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700641 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700642 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
643 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
644 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700645 },
646 ],
647 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700648 &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`.
649 &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.
650 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
651 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
652 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
653 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
654 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
655 &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.
656 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
657 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
658 &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.
659 &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`.
660 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
661 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
662 &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.
663 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
664 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
665 {
666 &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.
667 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
668 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
669 {
670 &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).
671 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
672 },
673 ],
674 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
675 },
676 ],
677 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700678 }</pre>
679</div>
680
681<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700682 <code class="details" id="list">list(project, zone, filter=None, maxResults=None, orderBy=None, pageToken=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700683 <pre>Retrieves a list of autoscalers contained within the specified zone.
684
685Args:
686 project: string, Project ID for this request. (required)
687 zone: string, Name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700688 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;`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700689
Dan O'Mearadd494642020-05-01 07:42:23 -0700690For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700691
Dan O'Mearadd494642020-05-01 07:42:23 -0700692You 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700693
Bu Sun Kim65020912020-05-20 12:08:20 -0700694To 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) ```
695 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`)
696 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
697
698You 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.
699
700Currently, only sorting by `name` or `creationTimestamp desc` is supported.
701 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700702
703Returns:
704 An object of the form:
705
706 { # Contains a list of Autoscaler resources.
Bu Sun Kim65020912020-05-20 12:08:20 -0700707 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
708 &quot;items&quot;: [ # A list of Autoscaler resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700709 { # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700710 #
711 # Google Compute Engine has two Autoscaler resources:
712 #
713 # * [Global](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
714 #
715 # 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.
716 #
717 # For zonal managed instance groups resource, use the autoscaler resource.
718 #
719 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
720 &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 -0700721 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700722 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
723 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700724 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700725 # 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.
726 &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.
727 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700728 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700729 # 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.
730 #
731 # 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700732 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700733 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
734 { # Custom utilization metric policy.
735 &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.
736 #
737 # For the filter to be valid for autoscaling purposes, the following rules apply:
738 # - You can only use the AND operator for joining selectors.
739 # - You can only use direct equality comparison operator (=) without any functions for each selector.
740 # - 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.
741 # - 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.
742 # 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.
743 #
744 # If not specified, the type defaults to gce_instance.
745 #
746 # 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.
747 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
748 #
749 # The metric must have a value type of INT64 or DOUBLE.
750 &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.
751 #
752 # 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.
753 #
754 # 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.
755 &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.
756 #
757 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
758 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700759 },
760 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700761 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
762 &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.
763 },
764 &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.
765 &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.
766 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
767 &quot;scaleDownControl&quot;: { # Configuration that allows for slower scale down so that even if Autoscaler recommends an abrupt scale down of a MIG, it will be throttled as specified by the parameters below.
768 &quot;maxScaledDownReplicas&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.
769 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
770 #
771 #
772 # - If the value is fixed, then the calculated value is equal to the fixed value.
773 # - 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.
774 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
775 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
776 },
777 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
778 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700779 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700780 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
781 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
782 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
783 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
784 &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.
785 &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.
786 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
787 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
788 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
789 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
790 # - DELETING: Configuration is being deleted.
791 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
792 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
793 &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.
794 {
795 &quot;message&quot;: &quot;A String&quot;, # The status message.
796 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
797 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
798 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
799 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
800 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
801 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
802 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
803 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
804 # - 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.
805 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
806 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
807 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
808 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
809 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
810 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
811 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
812 # - 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.
813 },
814 ],
815 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
816 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
817 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700818 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700819 &quot;kind&quot;: &quot;compute#autoscalerList&quot;, # [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers.
820 &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.
821 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
822 &quot;warning&quot;: { # [Output Only] Informational warning message.
823 &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.
824 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
825 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700826 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700827 &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).
828 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700829 },
830 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700831 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700832 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700833 }</pre>
834</div>
835
836<div class="method">
837 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
838 <pre>Retrieves the next page of results.
839
840Args:
841 previous_request: The request for the previous page. (required)
842 previous_response: The response from the request for the previous page. (required)
843
844Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700845 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700846 page. Returns None if there are no more items in the collection.
847 </pre>
848</div>
849
850<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700851 <code class="details" id="patch">patch(project, zone, body=None, autoscaler=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700852 <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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700853
854Args:
855 project: string, Project ID for this request. (required)
856 zone: string, Name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700857 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700858 The object takes the form of:
859
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700860{ # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700861 #
862 # Google Compute Engine has two Autoscaler resources:
863 #
864 # * [Global](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
865 #
866 # 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.
867 #
868 # For zonal managed instance groups resource, use the autoscaler resource.
869 #
870 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
871 &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 -0700872 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700873 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
874 &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.
875 #
876 # 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.
877 &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.
878 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700879 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700880 # 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.
881 #
882 # 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700883 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700884 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
885 { # Custom utilization metric policy.
886 &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.
887 #
888 # For the filter to be valid for autoscaling purposes, the following rules apply:
889 # - You can only use the AND operator for joining selectors.
890 # - You can only use direct equality comparison operator (=) without any functions for each selector.
891 # - 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.
892 # - 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.
893 # 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.
894 #
895 # If not specified, the type defaults to gce_instance.
896 #
897 # 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.
898 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
899 #
900 # The metric must have a value type of INT64 or DOUBLE.
901 &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.
902 #
903 # 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.
904 #
905 # 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.
906 &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.
907 #
908 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
909 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700910 },
911 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700912 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
913 &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.
914 },
915 &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.
916 &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.
917 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
918 &quot;scaleDownControl&quot;: { # Configuration that allows for slower scale down so that even if Autoscaler recommends an abrupt scale down of a MIG, it will be throttled as specified by the parameters below.
919 &quot;maxScaledDownReplicas&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.
920 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
921 #
922 #
923 # - If the value is fixed, then the calculated value is equal to the fixed value.
924 # - 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.
925 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
926 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
927 },
928 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
929 },
930 },
931 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
932 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
933 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
934 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
935 &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.
936 &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.
937 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
938 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
939 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
940 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
941 # - DELETING: Configuration is being deleted.
942 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
943 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
944 &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.
945 {
946 &quot;message&quot;: &quot;A String&quot;, # The status message.
947 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
948 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
949 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
950 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
951 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
952 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
953 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
954 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
955 # - 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.
956 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
957 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
958 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
959 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
960 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
961 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
962 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
963 # - 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.
964 },
965 ],
966 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
967 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
968}
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700969
Bu Sun Kim65020912020-05-20 12:08:20 -0700970 autoscaler: string, Name of the autoscaler to patch.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700971 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.
972
973For 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.
974
975The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700976
977Returns:
978 An object of the form:
979
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700980 { # Represents an Operation resource.
981 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700982 # Google Compute Engine has three Operation resources:
983 #
984 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
985 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700986 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
987 #
988 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700989 # - For global operations, use the `globalOperations` resource.
990 # - For regional operations, use the `regionOperations` resource.
991 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700992 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700993 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700994 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
995 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
996 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
997 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
998 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
999 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001000 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001001 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1002 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1003 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001004 },
1005 ],
1006 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001007 &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`.
1008 &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.
1009 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1010 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1011 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1012 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1013 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1014 &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.
1015 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1016 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1017 &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.
1018 &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`.
1019 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1020 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1021 &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.
1022 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1023 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1024 {
1025 &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.
1026 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1027 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1028 {
1029 &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).
1030 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1031 },
1032 ],
1033 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1034 },
1035 ],
1036 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001037 }</pre>
1038</div>
1039
1040<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001041 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001042 <pre>Returns permissions that a caller has on the specified resource.
1043
1044Args:
1045 project: string, Project ID for this request. (required)
1046 zone: string, The name of the zone for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001047 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001048 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001049 The object takes the form of:
1050
1051{
Bu Sun Kim65020912020-05-20 12:08:20 -07001052 &quot;permissions&quot;: [ # The set of permissions to check for the &#x27;resource&#x27;. Permissions with wildcards (such as &#x27;*&#x27; or &#x27;storage.*&#x27;) are not allowed.
1053 &quot;A String&quot;,
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001054 ],
1055 }
1056
1057
1058Returns:
1059 An object of the form:
1060
1061 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001062 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
1063 &quot;A String&quot;,
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001064 ],
1065 }</pre>
1066</div>
1067
1068<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -07001069 <code class="details" id="update">update(project, zone, body=None, autoscaler=None, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001070 <pre>Updates an autoscaler in the specified project using the data included in the request.
1071
1072Args:
1073 project: string, Project ID for this request. (required)
1074 zone: string, Name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001075 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001076 The object takes the form of:
1077
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001078{ # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -07001079 #
1080 # Google Compute Engine has two Autoscaler resources:
1081 #
1082 # * [Global](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
1083 #
1084 # 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.
1085 #
1086 # For zonal managed instance groups resource, use the autoscaler resource.
1087 #
1088 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
1089 &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 -07001090 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001091 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
1092 &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.
1093 #
1094 # 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.
1095 &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.
1096 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001097 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001098 # 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.
1099 #
1100 # 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001101 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001102 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
1103 { # Custom utilization metric policy.
1104 &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.
1105 #
1106 # For the filter to be valid for autoscaling purposes, the following rules apply:
1107 # - You can only use the AND operator for joining selectors.
1108 # - You can only use direct equality comparison operator (=) without any functions for each selector.
1109 # - 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.
1110 # - 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.
1111 # 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.
1112 #
1113 # If not specified, the type defaults to gce_instance.
1114 #
1115 # 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.
1116 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
1117 #
1118 # The metric must have a value type of INT64 or DOUBLE.
1119 &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.
1120 #
1121 # 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.
1122 #
1123 # 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.
1124 &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.
1125 #
1126 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
1127 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001128 },
1129 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001130 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
1131 &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.
1132 },
1133 &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.
1134 &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.
1135 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
1136 &quot;scaleDownControl&quot;: { # Configuration that allows for slower scale down so that even if Autoscaler recommends an abrupt scale down of a MIG, it will be throttled as specified by the parameters below.
1137 &quot;maxScaledDownReplicas&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.
1138 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1139 #
1140 #
1141 # - If the value is fixed, then the calculated value is equal to the fixed value.
1142 # - 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.
1143 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1144 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1145 },
1146 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
1147 },
1148 },
1149 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
1150 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
1151 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1152 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
1153 &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.
1154 &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.
1155 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
1156 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1157 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
1158 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
1159 # - DELETING: Configuration is being deleted.
1160 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
1161 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
1162 &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.
1163 {
1164 &quot;message&quot;: &quot;A String&quot;, # The status message.
1165 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
1166 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
1167 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
1168 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
1169 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
1170 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
1171 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
1172 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
1173 # - 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.
1174 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
1175 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
1176 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
1177 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
1178 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
1179 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
1180 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
1181 # - 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.
1182 },
1183 ],
1184 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
1185 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
1186}
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001187
Bu Sun Kim65020912020-05-20 12:08:20 -07001188 autoscaler: string, Name of the autoscaler to update.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001189 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.
1190
1191For 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.
1192
1193The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001194
1195Returns:
1196 An object of the form:
1197
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001198 { # Represents an Operation resource.
1199 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001200 # Google Compute Engine has three Operation resources:
1201 #
1202 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1203 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001204 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1205 #
1206 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001207 # - For global operations, use the `globalOperations` resource.
1208 # - For regional operations, use the `regionOperations` resource.
1209 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001210 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001211 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -07001212 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1213 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1214 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1215 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1216 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1217 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001218 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001219 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1220 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1221 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001222 },
1223 ],
1224 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001225 &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`.
1226 &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.
1227 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1228 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1229 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1230 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1231 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1232 &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.
1233 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1234 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1235 &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.
1236 &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`.
1237 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1238 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1239 &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.
1240 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1241 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1242 {
1243 &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.
1244 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1245 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1246 {
1247 &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).
1248 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1249 },
1250 ],
1251 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1252 },
1253 ],
1254 &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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001255 }</pre>
1256</div>
1257
1258</body></html>