blob: d5334c6c3096213672658d658e0f91441d3ea429 [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_alpha.html">Compute Engine API</a> . <a href="compute_alpha.regionAutoscalers.html">regionAutoscalers</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040081 <code><a href="#delete">delete(project, region, autoscaler, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070082<p class="firstline">Deletes the specified autoscaler.</p>
83<p class="toc_element">
84 <code><a href="#get">get(project, region, autoscaler)</a></code></p>
85<p class="firstline">Returns the specified autoscaler.</p>
86<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#insert">insert(project, region, body=None, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070088<p class="firstline">Creates an autoscaler in the specified project using the data included in the request.</p>
89<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070090 <code><a href="#list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070091<p class="firstline">Retrieves a list of autoscalers contained within the specified region.</p>
92<p class="toc_element">
93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -080096 <code><a href="#patch">patch(project, region, autoscaler=None, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097<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 -070098<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070099 <code><a href="#testIamPermissions">testIamPermissions(project, region, resource, body=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700100<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
101<p class="toc_element">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800102 <code><a href="#update">update(project, region, autoscaler=None, body=None, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700103<p class="firstline">Updates an autoscaler in the specified project using the data included in the request.</p>
104<h3>Method Details</h3>
105<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700106 <code class="details" id="close">close()</code>
107 <pre>Close httplib2 connections.</pre>
108</div>
109
110<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400111 <code class="details" id="delete">delete(project, region, autoscaler, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700112 <pre>Deletes the specified autoscaler.
113
114Args:
115 project: string, Project ID for this request. (required)
116 region: string, Name of the region scoping this request. (required)
117 autoscaler: string, Name of the autoscaler to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118 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.
119
120For 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.
121
122The 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 -0700123
124Returns:
125 An object of the form:
126
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700127 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800128 #
129 # Google Compute Engine has three Operation resources:
130 #
131 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
132 #
133 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
134 #
135 # Operations can be global, regional or zonal.
136 # - For global operations, use the `globalOperations` resource.
137 # - For regional operations, use the `regionOperations` resource.
138 # - For zonal operations, use the `zonalOperations` resource.
139 #
140 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
141 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
142 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
143 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
144 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
145 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
146 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700147 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800148 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
149 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
150 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700151 },
152 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800153 },
154 &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`.
155 &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.
156 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
157 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
158 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
159 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
160 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
161 &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.
162 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
163 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
164 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
165 &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.
166 &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`.
167 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
168 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
169 &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.
170 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
171 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
172 {
173 &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.
174 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
175 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
176 {
177 &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).
178 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
179 },
180 ],
181 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
182 },
183 ],
184 &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.
185}</pre>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700186</div>
187
188<div class="method">
189 <code class="details" id="get">get(project, region, autoscaler)</code>
190 <pre>Returns the specified autoscaler.
191
192Args:
193 project: string, Project ID for this request. (required)
194 region: string, Name of the region scoping this request. (required)
195 autoscaler: string, Name of the autoscaler to return. (required)
196
197Returns:
198 An object of the form:
199
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700200 { # Represents an Autoscaler resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800201 #
202 # Google Compute Engine has two Autoscaler resources:
203 #
204 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
205 #
206 # 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.
207 #
208 # For zonal managed instance groups resource, use the autoscaler resource.
209 #
210 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
211 &quot;autoscalingPolicy&quot;: { # Cloud Autoscaler policy. # The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization.
Bu Sun Kim65020912020-05-20 12:08:20 -0700212 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800213 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
214 &quot;coolDownPeriodSec&quot;: 42, # The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700215 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800216 # 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.
217 &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.
218 &quot;predictiveMethod&quot;: &quot;A String&quot;, # Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are:
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700219 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800220 # * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand.
221 &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.
222 #
223 # 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.
224 #
225 # If the average CPU is above the target utilization, the autoscaler scales up until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization.
Bu Sun Kim65020912020-05-20 12:08:20 -0700226 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800227 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
228 { # Custom utilization metric policy.
229 &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.
230 #
231 # For the filter to be valid for autoscaling purposes, the following rules apply:
232 # - You can only use the AND operator for joining selectors.
233 # - You can only use direct equality comparison operator (=) without any functions for each selector.
234 # - 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.
235 # - 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.
236 # 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.
237 #
238 # If not specified, the type defaults to gce_instance.
239 #
240 # 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.
241 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
242 #
243 # The metric must have a value type of INT64 or DOUBLE.
244 &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.
245 #
246 # 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.
247 #
248 # 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.
249 &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.
250 #
251 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
252 &quot;utilizationTargetType&quot;: &quot;A String&quot;, # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
Bu Sun Kim65020912020-05-20 12:08:20 -0700253 },
254 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800255 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
256 &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.
257 },
258 &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.
259 &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.
260 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
261 &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.
262 &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.
263 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
264 #
265 #
266 # - If the value is fixed, then the calculated value is equal to the fixed value.
267 # - 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.
268 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
269 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
270 },
271 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
272 },
273 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
274 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
275 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
276 #
277 #
278 # - If the value is fixed, then the calculated value is equal to the fixed value.
279 # - 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.
280 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
281 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
282 },
283 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
284 },
285 &quot;scalingSchedules&quot;: { # Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules will be applied. Up to 128 scaling schedules are allowed.
286 &quot;a_key&quot;: { # Scaling based on user-defined schedule. The message describes a single scaling schedule. A scaling schedule changes the minimum number of VM instances an autoscaler can recommend, which can trigger scaling out.
287 &quot;description&quot;: &quot;A String&quot;, # A description of a scaling schedule.
288 &quot;disabled&quot;: True or False, # A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional and its value is false by default.
289 &quot;durationSec&quot;: 42, # The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. This field is required.
290 &quot;minRequiredReplicas&quot;: 42, # Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. This field is required.
291 &quot;schedule&quot;: &quot;A String&quot;, # The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). The expression may describe a single timestamp if the optional year is set, in which case a scaling schedule will run once. schedule is interpreted with respect to time_zone. This field is required. NOTE: these timestamps only describe when autoscaler will start providing the scaling signal. The VMs will need additional time to become serving.
292 &quot;timeZone&quot;: &quot;A String&quot;, # The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field will be assigned a default value of ?UTC? if left empty.
293 },
294 },
295 },
296 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
297 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
298 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
299 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
300 &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.
301 &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.
302 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
303 &quot;scalingScheduleStatus&quot;: { # [Output Only] Status information of existing scaling schedules.
304 &quot;a_key&quot;: {
305 &quot;lastStartTime&quot;: &quot;A String&quot;, # [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is an RFC3339 string in RFC3339 text format.
306 &quot;nextStartTime&quot;: &quot;A String&quot;, # [Output Only] The next time the scaling schedule will become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is an RFC3339 string in RFC3339 text format.
307 &quot;state&quot;: &quot;A String&quot;, # [Output Only] The current state of a scaling schedule.
308 },
309 },
310 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
311 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
312 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
313 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
314 # - DELETING: Configuration is being deleted.
315 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
316 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
317 &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.
318 {
319 &quot;message&quot;: &quot;A String&quot;, # The status message.
320 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
321 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
322 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
323 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
324 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
325 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
326 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
327 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
328 # - 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.
329 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
330 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
331 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
332 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
333 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
334 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
335 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
336 # - 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.
337 },
338 ],
339 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
340 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
341}</pre>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700342</div>
343
344<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700345 <code class="details" id="insert">insert(project, region, body=None, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700346 <pre>Creates an autoscaler in the specified project using the data included in the request.
347
348Args:
349 project: string, Project ID for this request. (required)
350 region: string, Name of the region scoping this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700351 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700352 The object takes the form of:
353
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700354{ # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700355 #
356 # Google Compute Engine has two Autoscaler resources:
357 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700358 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
Bu Sun Kim65020912020-05-20 12:08:20 -0700359 #
360 # 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.
361 #
362 # For zonal managed instance groups resource, use the autoscaler resource.
363 #
364 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
365 &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 -0700366 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700367 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
368 &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.
369 #
370 # 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.
371 &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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700372 &quot;predictiveMethod&quot;: &quot;A String&quot;, # Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are:
373 #
374 # * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand.
Bu Sun Kim65020912020-05-20 12:08:20 -0700375 &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 -0700376 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700377 # 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.
378 #
379 # 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 -0700380 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700381 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
382 { # Custom utilization metric policy.
383 &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.
384 #
385 # For the filter to be valid for autoscaling purposes, the following rules apply:
386 # - You can only use the AND operator for joining selectors.
387 # - You can only use direct equality comparison operator (=) without any functions for each selector.
388 # - 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.
389 # - 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.
390 # 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.
391 #
392 # If not specified, the type defaults to gce_instance.
393 #
394 # 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.
395 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
396 #
397 # The metric must have a value type of INT64 or DOUBLE.
398 &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.
399 #
400 # 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.
401 #
402 # 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.
403 &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.
404 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700405 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim65020912020-05-20 12:08:20 -0700406 &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 -0700407 },
408 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700409 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
410 &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.
411 },
412 &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.
413 &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.
414 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
Bu Sun Kim65020912020-05-20 12:08:20 -0700415 &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.
416 &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.
417 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
418 #
419 #
420 # - If the value is fixed, then the calculated value is equal to the fixed value.
421 # - 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.
422 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
423 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
424 },
425 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
426 },
427 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
428 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
429 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
430 #
431 #
432 # - If the value is fixed, then the calculated value is equal to the fixed value.
433 # - 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.
434 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
435 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
436 },
437 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
438 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700439 &quot;scalingSchedules&quot;: { # Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules will be applied. Up to 128 scaling schedules are allowed.
440 &quot;a_key&quot;: { # Scaling based on user-defined schedule. The message describes a single scaling schedule. A scaling schedule changes the minimum number of VM instances an autoscaler can recommend, which can trigger scaling out.
441 &quot;description&quot;: &quot;A String&quot;, # A description of a scaling schedule.
442 &quot;disabled&quot;: True or False, # A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional and its value is false by default.
443 &quot;durationSec&quot;: 42, # The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. This field is required.
444 &quot;minRequiredReplicas&quot;: 42, # Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. This field is required.
445 &quot;schedule&quot;: &quot;A String&quot;, # The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). The expression may describe a single timestamp if the optional year is set, in which case a scaling schedule will run once. schedule is interpreted with respect to time_zone. This field is required. NOTE: these timestamps only describe when autoscaler will start providing the scaling signal. The VMs will need additional time to become serving.
446 &quot;timeZone&quot;: &quot;A String&quot;, # The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field will be assigned a default value of ?UTC? if left empty.
447 },
448 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700449 },
450 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
451 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
452 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
453 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
454 &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.
455 &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.
456 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700457 &quot;scalingScheduleStatus&quot;: { # [Output Only] Status information of existing scaling schedules.
458 &quot;a_key&quot;: {
459 &quot;lastStartTime&quot;: &quot;A String&quot;, # [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is an RFC3339 string in RFC3339 text format.
460 &quot;nextStartTime&quot;: &quot;A String&quot;, # [Output Only] The next time the scaling schedule will become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is an RFC3339 string in RFC3339 text format.
461 &quot;state&quot;: &quot;A String&quot;, # [Output Only] The current state of a scaling schedule.
462 },
463 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700464 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
465 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
466 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
467 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
468 # - DELETING: Configuration is being deleted.
469 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
470 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
471 &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.
472 {
473 &quot;message&quot;: &quot;A String&quot;, # The status message.
474 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
475 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
476 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
477 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
478 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
479 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
480 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
481 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
482 # - 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.
483 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
484 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
485 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
486 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
487 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
488 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
489 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
490 # - 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.
491 },
492 ],
493 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
494 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
495}
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700496
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700497 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.
498
499For 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.
500
501The 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 -0700502
503Returns:
504 An object of the form:
505
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700506 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800507 #
508 # Google Compute Engine has three Operation resources:
509 #
510 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
511 #
512 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
513 #
514 # Operations can be global, regional or zonal.
515 # - For global operations, use the `globalOperations` resource.
516 # - For regional operations, use the `regionOperations` resource.
517 # - For zonal operations, use the `zonalOperations` resource.
518 #
519 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
520 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
521 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
522 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
523 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
524 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
525 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700526 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800527 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
528 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
529 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700530 },
531 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800532 },
533 &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`.
534 &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.
535 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
536 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
537 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
538 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
539 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
540 &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.
541 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
542 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
543 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
544 &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.
545 &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`.
546 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
547 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
548 &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.
549 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
550 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
551 {
552 &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.
553 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
554 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
555 {
556 &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).
557 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
558 },
559 ],
560 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
561 },
562 ],
563 &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.
564}</pre>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700565</div>
566
567<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700568 <code class="details" id="list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700569 <pre>Retrieves a list of autoscalers contained within the specified region.
570
571Args:
572 project: string, Project ID for this request. (required)
573 region: string, Name of the region scoping this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700574 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 -0700575
Dan O'Mearadd494642020-05-01 07:42:23 -0700576For 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 -0700577
Dan O'Mearadd494642020-05-01 07:42:23 -0700578You 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 -0700579
Bu Sun Kim65020912020-05-20 12:08:20 -0700580To 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) ```
581 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`)
582 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
583
584You 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.
585
586Currently, only sorting by `name` or `creationTimestamp desc` is supported.
587 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.
588 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700589
590Returns:
591 An object of the form:
592
593 { # Contains a list of autoscalers.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800594 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
595 &quot;items&quot;: [ # A list of Autoscaler resources.
596 { # Represents an Autoscaler resource.
597 #
598 # Google Compute Engine has two Autoscaler resources:
599 #
600 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
601 #
602 # 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.
603 #
604 # For zonal managed instance groups resource, use the autoscaler resource.
605 #
606 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
607 &quot;autoscalingPolicy&quot;: { # Cloud Autoscaler policy. # The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization.
Bu Sun Kim65020912020-05-20 12:08:20 -0700608 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800609 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
610 &quot;coolDownPeriodSec&quot;: 42, # The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700611 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800612 # 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.
613 &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.
614 &quot;predictiveMethod&quot;: &quot;A String&quot;, # Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are:
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700615 #
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800616 # * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand.
617 &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.
618 #
619 # 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.
620 #
621 # 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 -0700622 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800623 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
624 { # Custom utilization metric policy.
625 &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.
626 #
627 # For the filter to be valid for autoscaling purposes, the following rules apply:
628 # - You can only use the AND operator for joining selectors.
629 # - You can only use direct equality comparison operator (=) without any functions for each selector.
630 # - 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.
631 # - 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.
632 # 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.
633 #
634 # If not specified, the type defaults to gce_instance.
635 #
636 # 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.
637 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
638 #
639 # The metric must have a value type of INT64 or DOUBLE.
640 &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.
641 #
642 # 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.
643 #
644 # 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.
645 &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.
646 #
647 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
648 &quot;utilizationTargetType&quot;: &quot;A String&quot;, # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
Bu Sun Kim65020912020-05-20 12:08:20 -0700649 },
650 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800651 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
652 &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.
653 },
654 &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.
655 &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.
656 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
657 &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.
658 &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.
659 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
660 #
661 #
662 # - If the value is fixed, then the calculated value is equal to the fixed value.
663 # - 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.
664 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
665 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
666 },
667 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
668 },
669 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
670 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
671 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
672 #
673 #
674 # - If the value is fixed, then the calculated value is equal to the fixed value.
675 # - 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.
676 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
677 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
678 },
679 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
680 },
681 &quot;scalingSchedules&quot;: { # Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules will be applied. Up to 128 scaling schedules are allowed.
682 &quot;a_key&quot;: { # Scaling based on user-defined schedule. The message describes a single scaling schedule. A scaling schedule changes the minimum number of VM instances an autoscaler can recommend, which can trigger scaling out.
683 &quot;description&quot;: &quot;A String&quot;, # A description of a scaling schedule.
684 &quot;disabled&quot;: True or False, # A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional and its value is false by default.
685 &quot;durationSec&quot;: 42, # The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. This field is required.
686 &quot;minRequiredReplicas&quot;: 42, # Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. This field is required.
687 &quot;schedule&quot;: &quot;A String&quot;, # The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). The expression may describe a single timestamp if the optional year is set, in which case a scaling schedule will run once. schedule is interpreted with respect to time_zone. This field is required. NOTE: these timestamps only describe when autoscaler will start providing the scaling signal. The VMs will need additional time to become serving.
688 &quot;timeZone&quot;: &quot;A String&quot;, # The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field will be assigned a default value of ?UTC? if left empty.
689 },
690 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700691 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800692 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
693 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
694 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
695 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
696 &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.
697 &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.
698 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
699 &quot;scalingScheduleStatus&quot;: { # [Output Only] Status information of existing scaling schedules.
700 &quot;a_key&quot;: {
701 &quot;lastStartTime&quot;: &quot;A String&quot;, # [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is an RFC3339 string in RFC3339 text format.
702 &quot;nextStartTime&quot;: &quot;A String&quot;, # [Output Only] The next time the scaling schedule will become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is an RFC3339 string in RFC3339 text format.
703 &quot;state&quot;: &quot;A String&quot;, # [Output Only] The current state of a scaling schedule.
704 },
705 },
706 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
707 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
708 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
709 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
710 # - DELETING: Configuration is being deleted.
711 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
712 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
713 &quot;statusDetails&quot;: [ # [Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700714 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800715 &quot;message&quot;: &quot;A String&quot;, # The status message.
716 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
717 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
718 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
719 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
720 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
721 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
722 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
723 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
724 # - 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.
725 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
726 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
727 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
728 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
729 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
730 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
731 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
732 # - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you&#x27;re using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700733 },
734 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800735 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
736 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700737 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800738 ],
739 &quot;kind&quot;: &quot;compute#regionAutoscalerList&quot;, # Type of resource.
740 &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.
741 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
742 &quot;warning&quot;: { # [Output Only] Informational warning message.
743 &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.
744 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
745 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
746 {
747 &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).
748 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
749 },
750 ],
751 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
752 },
753}</pre>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700754</div>
755
756<div class="method">
757 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
758 <pre>Retrieves the next page of results.
759
760Args:
761 previous_request: The request for the previous page. (required)
762 previous_response: The response from the request for the previous page. (required)
763
764Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700765 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700766 page. Returns None if there are no more items in the collection.
767 </pre>
768</div>
769
770<div class="method">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800771 <code class="details" id="patch">patch(project, region, autoscaler=None, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700772 <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 -0700773
774Args:
775 project: string, Project ID for this request. (required)
776 region: string, Name of the region scoping this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700777 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700778 The object takes the form of:
779
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700780{ # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700781 #
782 # Google Compute Engine has two Autoscaler resources:
783 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700784 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
Bu Sun Kim65020912020-05-20 12:08:20 -0700785 #
786 # 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.
787 #
788 # For zonal managed instance groups resource, use the autoscaler resource.
789 #
790 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
791 &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 -0700792 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700793 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
794 &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.
795 #
796 # 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.
797 &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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700798 &quot;predictiveMethod&quot;: &quot;A String&quot;, # Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are:
799 #
800 # * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand.
Bu Sun Kim65020912020-05-20 12:08:20 -0700801 &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 -0700802 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700803 # 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.
804 #
805 # 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 -0700806 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700807 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
808 { # Custom utilization metric policy.
809 &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.
810 #
811 # For the filter to be valid for autoscaling purposes, the following rules apply:
812 # - You can only use the AND operator for joining selectors.
813 # - You can only use direct equality comparison operator (=) without any functions for each selector.
814 # - 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.
815 # - 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.
816 # 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.
817 #
818 # If not specified, the type defaults to gce_instance.
819 #
820 # 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.
821 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
822 #
823 # The metric must have a value type of INT64 or DOUBLE.
824 &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.
825 #
826 # 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.
827 #
828 # 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.
829 &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.
830 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700831 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim65020912020-05-20 12:08:20 -0700832 &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 -0700833 },
834 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700835 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
836 &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.
837 },
838 &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.
839 &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.
840 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
Bu Sun Kim65020912020-05-20 12:08:20 -0700841 &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.
842 &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.
843 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
844 #
845 #
846 # - If the value is fixed, then the calculated value is equal to the fixed value.
847 # - 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.
848 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
849 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
850 },
851 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
852 },
853 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
854 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
855 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
856 #
857 #
858 # - If the value is fixed, then the calculated value is equal to the fixed value.
859 # - 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.
860 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
861 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
862 },
863 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
864 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700865 &quot;scalingSchedules&quot;: { # Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules will be applied. Up to 128 scaling schedules are allowed.
866 &quot;a_key&quot;: { # Scaling based on user-defined schedule. The message describes a single scaling schedule. A scaling schedule changes the minimum number of VM instances an autoscaler can recommend, which can trigger scaling out.
867 &quot;description&quot;: &quot;A String&quot;, # A description of a scaling schedule.
868 &quot;disabled&quot;: True or False, # A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional and its value is false by default.
869 &quot;durationSec&quot;: 42, # The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. This field is required.
870 &quot;minRequiredReplicas&quot;: 42, # Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. This field is required.
871 &quot;schedule&quot;: &quot;A String&quot;, # The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). The expression may describe a single timestamp if the optional year is set, in which case a scaling schedule will run once. schedule is interpreted with respect to time_zone. This field is required. NOTE: these timestamps only describe when autoscaler will start providing the scaling signal. The VMs will need additional time to become serving.
872 &quot;timeZone&quot;: &quot;A String&quot;, # The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field will be assigned a default value of ?UTC? if left empty.
873 },
874 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700875 },
876 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
877 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
878 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
879 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
880 &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.
881 &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.
882 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700883 &quot;scalingScheduleStatus&quot;: { # [Output Only] Status information of existing scaling schedules.
884 &quot;a_key&quot;: {
885 &quot;lastStartTime&quot;: &quot;A String&quot;, # [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is an RFC3339 string in RFC3339 text format.
886 &quot;nextStartTime&quot;: &quot;A String&quot;, # [Output Only] The next time the scaling schedule will become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is an RFC3339 string in RFC3339 text format.
887 &quot;state&quot;: &quot;A String&quot;, # [Output Only] The current state of a scaling schedule.
888 },
889 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700890 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
891 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
892 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
893 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
894 # - DELETING: Configuration is being deleted.
895 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
896 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
897 &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.
898 {
899 &quot;message&quot;: &quot;A String&quot;, # The status message.
900 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
901 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
902 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
903 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
904 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
905 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
906 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
907 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
908 # - 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.
909 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
910 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
911 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
912 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
913 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
914 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
915 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
916 # - 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.
917 },
918 ],
919 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
920 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
921}
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700922
Bu Sun Kim65020912020-05-20 12:08:20 -0700923 autoscaler: string, Name of the autoscaler to patch.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700924 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.
925
926For 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.
927
928The 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 -0700929
930Returns:
931 An object of the form:
932
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700933 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800934 #
935 # Google Compute Engine has three Operation resources:
936 #
937 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
938 #
939 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
940 #
941 # Operations can be global, regional or zonal.
942 # - For global operations, use the `globalOperations` resource.
943 # - For regional operations, use the `regionOperations` resource.
944 # - For zonal operations, use the `zonalOperations` resource.
945 #
946 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
947 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
948 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
949 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
950 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
951 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
952 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700953 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800954 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
955 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
956 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -0700957 },
958 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800959 },
960 &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`.
961 &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.
962 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
963 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
964 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
965 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
966 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
967 &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.
968 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
969 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
970 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
971 &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.
972 &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`.
973 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
974 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
975 &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.
976 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
977 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
978 {
979 &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.
980 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
981 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
982 {
983 &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).
984 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
985 },
986 ],
987 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
988 },
989 ],
990 &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.
991}</pre>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700992</div>
993
994<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700995 <code class="details" id="testIamPermissions">testIamPermissions(project, region, resource, body=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700996 <pre>Returns permissions that a caller has on the specified resource.
997
998Args:
999 project: string, Project ID for this request. (required)
1000 region: string, The name of the region for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001001 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001002 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001003 The object takes the form of:
1004
1005{
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001006 &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.
1007 &quot;A String&quot;,
1008 ],
1009}
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001010
1011
1012Returns:
1013 An object of the form:
1014
1015 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001016 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
1017 &quot;A String&quot;,
1018 ],
1019}</pre>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001020</div>
1021
1022<div class="method">
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001023 <code class="details" id="update">update(project, region, autoscaler=None, body=None, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001024 <pre>Updates an autoscaler in the specified project using the data included in the request.
1025
1026Args:
1027 project: string, Project ID for this request. (required)
1028 region: string, Name of the region scoping this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001029 body: object, The request body.
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001030 The object takes the form of:
1031
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001032{ # Represents an Autoscaler resource.
Bu Sun Kim65020912020-05-20 12:08:20 -07001033 #
1034 # Google Compute Engine has two Autoscaler resources:
1035 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001036 # * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers)
Bu Sun Kim65020912020-05-20 12:08:20 -07001037 #
1038 # 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.
1039 #
1040 # For zonal managed instance groups resource, use the autoscaler resource.
1041 #
1042 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==)
1043 &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 -07001044 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001045 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
1046 &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.
1047 #
1048 # 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.
1049 &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.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001050 &quot;predictiveMethod&quot;: &quot;A String&quot;, # Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are:
1051 #
1052 # * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand.
Bu Sun Kim65020912020-05-20 12:08:20 -07001053 &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 -07001054 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001055 # 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.
1056 #
1057 # 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 -07001058 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001059 &quot;customMetricUtilizations&quot;: [ # Configuration parameters of autoscaling based on a custom metric.
1060 { # Custom utilization metric policy.
1061 &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.
1062 #
1063 # For the filter to be valid for autoscaling purposes, the following rules apply:
1064 # - You can only use the AND operator for joining selectors.
1065 # - You can only use direct equality comparison operator (=) without any functions for each selector.
1066 # - 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.
1067 # - 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.
1068 # 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.
1069 #
1070 # If not specified, the type defaults to gce_instance.
1071 #
1072 # 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.
1073 &quot;metric&quot;: &quot;A String&quot;, # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
1074 #
1075 # The metric must have a value type of INT64 or DOUBLE.
1076 &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.
1077 #
1078 # 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.
1079 #
1080 # 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.
1081 &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.
1082 #
Bu Sun Kim673ec5c2020-11-16 11:05:03 -07001083 # For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim65020912020-05-20 12:08:20 -07001084 &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 -07001085 },
1086 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001087 &quot;loadBalancingUtilization&quot;: { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
1088 &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.
1089 },
1090 &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.
1091 &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.
1092 &quot;mode&quot;: &quot;A String&quot;, # Defines operating mode for this policy.
Bu Sun Kim65020912020-05-20 12:08:20 -07001093 &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.
1094 &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.
1095 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1096 #
1097 #
1098 # - If the value is fixed, then the calculated value is equal to the fixed value.
1099 # - 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.
1100 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1101 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1102 },
1103 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
1104 },
1105 &quot;scaleInControl&quot;: { # Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below.
1106 &quot;maxScaledInReplicas&quot;: { # Encapsulates numeric value that can be either absolute or relative. # Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step.
1107 &quot;calculated&quot;: 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
1108 #
1109 #
1110 # - If the value is fixed, then the calculated value is equal to the fixed value.
1111 # - 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.
1112 &quot;fixed&quot;: 42, # Specifies a fixed number of VM instances. This must be a positive integer.
1113 &quot;percent&quot;: 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
1114 },
1115 &quot;timeWindowSec&quot;: 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale in, as described above.
1116 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001117 &quot;scalingSchedules&quot;: { # Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules will be applied. Up to 128 scaling schedules are allowed.
1118 &quot;a_key&quot;: { # Scaling based on user-defined schedule. The message describes a single scaling schedule. A scaling schedule changes the minimum number of VM instances an autoscaler can recommend, which can trigger scaling out.
1119 &quot;description&quot;: &quot;A String&quot;, # A description of a scaling schedule.
1120 &quot;disabled&quot;: True or False, # A boolean value that specifies if a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional and its value is false by default.
1121 &quot;durationSec&quot;: 42, # The duration of time intervals (in seconds) for which this scaling schedule will be running. The minimum allowed value is 300. This field is required.
1122 &quot;minRequiredReplicas&quot;: 42, # Minimum number of VM instances that autoscaler will recommend in time intervals starting according to schedule. This field is required.
1123 &quot;schedule&quot;: &quot;A String&quot;, # The start timestamps of time intervals when this scaling schedule should provide a scaling signal. This field uses the extended cron format (with an optional year field). The expression may describe a single timestamp if the optional year is set, in which case a scaling schedule will run once. schedule is interpreted with respect to time_zone. This field is required. NOTE: these timestamps only describe when autoscaler will start providing the scaling signal. The VMs will need additional time to become serving.
1124 &quot;timeZone&quot;: &quot;A String&quot;, # The time zone to be used when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field will be assigned a default value of ?UTC? if left empty.
1125 },
1126 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001127 },
1128 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
1129 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
1130 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1131 &quot;kind&quot;: &quot;compute#autoscaler&quot;, # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
1132 &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.
1133 &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.
1134 &quot;region&quot;: &quot;A String&quot;, # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001135 &quot;scalingScheduleStatus&quot;: { # [Output Only] Status information of existing scaling schedules.
1136 &quot;a_key&quot;: {
1137 &quot;lastStartTime&quot;: &quot;A String&quot;, # [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is an RFC3339 string in RFC3339 text format.
1138 &quot;nextStartTime&quot;: &quot;A String&quot;, # [Output Only] The next time the scaling schedule will become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is an RFC3339 string in RFC3339 text format.
1139 &quot;state&quot;: &quot;A String&quot;, # [Output Only] The current state of a scaling schedule.
1140 },
1141 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001142 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1143 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
1144 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the autoscaler configuration. Current set of possible values:
1145 # - PENDING: Autoscaler backend hasn&#x27;t read new/updated configuration.
1146 # - DELETING: Configuration is being deleted.
1147 # - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field.
1148 # - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future.
1149 &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.
1150 {
1151 &quot;message&quot;: &quot;A String&quot;, # The status message.
1152 &quot;type&quot;: &quot;A String&quot;, # The type of error, warning, or notice returned. Current set of possible values:
1153 # - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state).
1154 # - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group.
1155 # - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas.
1156 # - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling.
1157 # - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels.
1158 # - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group.
1159 # - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling.
1160 # - 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.
1161 # - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won&#x27;t change automatically. The autoscaling configuration is preserved.
1162 # - MODE_ONLY_UP (WARNING): Autoscaling is in the &quot;Autoscale only up&quot; mode. The autoscaler can add instances but not remove any.
1163 # - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it.
1164 # - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances.
1165 # - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region.
1166 # - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist.
1167 # - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate.
1168 # - 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.
1169 },
1170 ],
1171 &quot;target&quot;: &quot;A String&quot;, # URL of the managed instance group that this autoscaler will scale.
1172 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
1173}
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001174
Bu Sun Kim65020912020-05-20 12:08:20 -07001175 autoscaler: string, Name of the autoscaler to update.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001176 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.
1177
1178For 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.
1179
1180The 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 -07001181
1182Returns:
1183 An object of the form:
1184
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001185 { # Represents an Operation resource.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001186 #
1187 # Google Compute Engine has three Operation resources:
1188 #
1189 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1190 #
1191 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1192 #
1193 # Operations can be global, regional or zonal.
1194 # - For global operations, use the `globalOperations` resource.
1195 # - For regional operations, use the `regionOperations` resource.
1196 # - For zonal operations, use the `zonalOperations` resource.
1197 #
1198 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1199 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1200 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1201 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1202 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1203 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1204 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001205 {
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001206 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1207 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1208 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim65020912020-05-20 12:08:20 -07001209 },
1210 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -08001211 },
1212 &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`.
1213 &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.
1214 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1215 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1216 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1217 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1218 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1219 &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.
1220 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1221 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1222 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
1223 &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.
1224 &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`.
1225 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1226 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1227 &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.
1228 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1229 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1230 {
1231 &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.
1232 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1233 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1234 {
1235 &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).
1236 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1237 },
1238 ],
1239 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1240 },
1241 ],
1242 &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.
1243}</pre>
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001244</div>
1245
1246</body></html>