blob: 961db4419500a6628d946909c8a4244d9afdf189 [file] [log] [blame]
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_beta.html">Compute Engine API</a> . <a href="compute_beta.autoscalers.html">autoscalers</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
79<p class="firstline">Retrieves an aggregated list of autoscalers.</p>
80<p class="toc_element">
81 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
82<p class="firstline">Retrieves the next page of results.</p>
83<p class="toc_element">
84 <code><a href="#delete">delete(project, zone, autoscaler)</a></code></p>
85<p class="firstline">Deletes the specified autoscaler.</p>
86<p class="toc_element">
87 <code><a href="#get">get(project, zone, autoscaler)</a></code></p>
88<p class="firstline">Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request.</p>
89<p class="toc_element">
90 <code><a href="#insert">insert(project, zone, body)</a></code></p>
91<p class="firstline">Creates an autoscaler in the specified project using the data included in the request.</p>
92<p class="toc_element">
93 <code><a href="#list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
94<p class="firstline">Retrieves a list of autoscalers contained within the specified zone.</p>
95<p class="toc_element">
96 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
97<p class="firstline">Retrieves the next page of results.</p>
98<p class="toc_element">
99 <code><a href="#patch">patch(project, zone, autoscaler, body)</a></code></p>
100<p class="firstline">Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.</p>
101<p class="toc_element">
102 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body)</a></code></p>
103<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
104<p class="toc_element">
105 <code><a href="#update">update(project, zone, body, autoscaler=None)</a></code></p>
106<p class="firstline">Updates an autoscaler in the specified project using the data included in the request.</p>
107<h3>Method Details</h3>
108<div class="method">
109 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
110 <pre>Retrieves an aggregated list of autoscalers.
111
112Args:
113 project: string, Project ID for this request. (required)
114 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
115
116You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". 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.
117
118Currently, only sorting by name or creationTimestamp desc is supported.
119 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.
120 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.
121 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.
122
123The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.
124
125For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
126
127You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.
128
129To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
130
131Returns:
132 An object of the form:
133
134 {
135 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
136 "items": { # A map of scoped autoscaler lists.
137 "a_key": { # [Output Only] Name of the scope containing this set of autoscalers.
138 "warning": { # [Output Only] Informational warning which replaces the list of autoscalers when the list is empty.
139 "message": "A String", # [Output Only] A human-readable description of the warning code.
140 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
141 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
142 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
143 {
144 "value": "A String", # [Output Only] A warning data value corresponding to the key.
145 "key": "A String", # [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).
146 },
147 ],
148 },
149 "autoscalers": [ # [Output Only] List of autoscalers contained in this scope.
150 { # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.
151 "status": "A String", # [Output Only] The status of the autoscaler configuration.
152 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
153 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
154 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
155 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
156 "autoscalingPolicy": { # 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.
157 #
158 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
159 "maxNumReplicas": 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.
160 "coolDownPeriodSec": 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.
161 #
162 # 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.
163 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
164 "utilizationTarget": 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.
165 },
166 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
167 { # Custom utilization metric policy.
168 "metric": "A String", # The identifier of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. The metric must also have a label of compute.googleapis.com/resource_id with the value of the instance's unique ID, although this alone does not guarantee that the metric is valid.
169 #
170 # For example, the following is a valid metric:
171 # compute.googleapis.com/instance/network/received_bytes_count
172 # The following is not a valid metric because it does not increase or decrease based on usage:
173 # compute.googleapis.com/instance/cpu/reserved_cores
174 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE.
175 "utilizationTarget": 3.14, # Target value of the metric which autoscaler should maintain. Must be a positive value.
176 },
177 ],
178 "cpuUtilization": { # 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.
179 "utilizationTarget": 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.
180 #
181 # 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.
182 #
183 # 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.
184 },
185 "minNumReplicas": 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.
186 },
187 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
188 "statusDetails": [ # [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.
189 {
190 "message": "A String", # The status message.
191 "type": "A String", # The type of error returned.
192 },
193 ],
194 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
195 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
196 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
197 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
198 },
199 ],
200 },
201 },
202 "kind": "compute#autoscalerAggregatedList", # [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers.
203 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
204 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
205 }</pre>
206</div>
207
208<div class="method">
209 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
210 <pre>Retrieves the next page of results.
211
212Args:
213 previous_request: The request for the previous page. (required)
214 previous_response: The response from the request for the previous page. (required)
215
216Returns:
217 A request object that you can call 'execute()' on to request the next
218 page. Returns None if there are no more items in the collection.
219 </pre>
220</div>
221
222<div class="method">
223 <code class="details" id="delete">delete(project, zone, autoscaler)</code>
224 <pre>Deletes the specified autoscaler.
225
226Args:
227 project: string, Project ID for this request. (required)
228 zone: string, Name of the zone for this request. (required)
229 autoscaler: string, Name of the autoscaler to delete. (required)
230
231Returns:
232 An object of the form:
233
234 { # An Operation resource, used to manage asynchronous API requests.
235 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
236 "clientOperationId": "A String", # [Output Only] Reserved for future use.
237 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
238 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
239 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
240 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
241 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
242 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
243 "progress": 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.
244 "httpErrorStatusCode": 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.
245 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
246 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
247 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
248 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
249 {
250 "message": "A String", # [Output Only] A human-readable description of the warning code.
251 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
252 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
253 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
254 {
255 "value": "A String", # [Output Only] A warning data value corresponding to the key.
256 "key": "A String", # [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).
257 },
258 ],
259 },
260 ],
261 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
262 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
263 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
264 "name": "A String", # [Output Only] Name of the resource.
265 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
266 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
267 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
268 {
269 "message": "A String", # [Output Only] An optional, human-readable error message.
270 "code": "A String", # [Output Only] The error type identifier for this error.
271 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
272 },
273 ],
274 },
275 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
276 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
277 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
278 }</pre>
279</div>
280
281<div class="method">
282 <code class="details" id="get">get(project, zone, autoscaler)</code>
283 <pre>Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request.
284
285Args:
286 project: string, Project ID for this request. (required)
287 zone: string, Name of the zone for this request. (required)
288 autoscaler: string, Name of the autoscaler to return. (required)
289
290Returns:
291 An object of the form:
292
293 { # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.
294 "status": "A String", # [Output Only] The status of the autoscaler configuration.
295 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
296 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
297 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
298 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
299 "autoscalingPolicy": { # 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.
300 #
301 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
302 "maxNumReplicas": 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.
303 "coolDownPeriodSec": 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.
304 #
305 # 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.
306 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
307 "utilizationTarget": 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.
308 },
309 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
310 { # Custom utilization metric policy.
311 "metric": "A String", # The identifier of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. The metric must also have a label of compute.googleapis.com/resource_id with the value of the instance's unique ID, although this alone does not guarantee that the metric is valid.
312 #
313 # For example, the following is a valid metric:
314 # compute.googleapis.com/instance/network/received_bytes_count
315 # The following is not a valid metric because it does not increase or decrease based on usage:
316 # compute.googleapis.com/instance/cpu/reserved_cores
317 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE.
318 "utilizationTarget": 3.14, # Target value of the metric which autoscaler should maintain. Must be a positive value.
319 },
320 ],
321 "cpuUtilization": { # 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.
322 "utilizationTarget": 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.
323 #
324 # 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.
325 #
326 # 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.
327 },
328 "minNumReplicas": 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.
329 },
330 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
331 "statusDetails": [ # [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.
332 {
333 "message": "A String", # The status message.
334 "type": "A String", # The type of error returned.
335 },
336 ],
337 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
338 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
339 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
340 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
341 }</pre>
342</div>
343
344<div class="method">
345 <code class="details" id="insert">insert(project, zone, body)</code>
346 <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 zone: string, Name of the zone for this request. (required)
351 body: object, The request body. (required)
352 The object takes the form of:
353
354{ # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.
355 "status": "A String", # [Output Only] The status of the autoscaler configuration.
356 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
357 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
358 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
359 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
360 "autoscalingPolicy": { # 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.
361 #
362 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
363 "maxNumReplicas": 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.
364 "coolDownPeriodSec": 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.
365 #
366 # 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.
367 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
368 "utilizationTarget": 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.
369 },
370 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
371 { # Custom utilization metric policy.
372 "metric": "A String", # The identifier of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. The metric must also have a label of compute.googleapis.com/resource_id with the value of the instance's unique ID, although this alone does not guarantee that the metric is valid.
373 #
374 # For example, the following is a valid metric:
375 # compute.googleapis.com/instance/network/received_bytes_count
376 # The following is not a valid metric because it does not increase or decrease based on usage:
377 # compute.googleapis.com/instance/cpu/reserved_cores
378 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE.
379 "utilizationTarget": 3.14, # Target value of the metric which autoscaler should maintain. Must be a positive value.
380 },
381 ],
382 "cpuUtilization": { # 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.
383 "utilizationTarget": 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.
384 #
385 # 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.
386 #
387 # 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.
388 },
389 "minNumReplicas": 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.
390 },
391 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
392 "statusDetails": [ # [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.
393 {
394 "message": "A String", # The status message.
395 "type": "A String", # The type of error returned.
396 },
397 ],
398 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
399 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
400 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
401 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
402 }
403
404
405Returns:
406 An object of the form:
407
408 { # An Operation resource, used to manage asynchronous API requests.
409 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
410 "clientOperationId": "A String", # [Output Only] Reserved for future use.
411 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
412 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
413 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
414 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
415 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
416 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
417 "progress": 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.
418 "httpErrorStatusCode": 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.
419 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
420 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
421 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
422 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
423 {
424 "message": "A String", # [Output Only] A human-readable description of the warning code.
425 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
426 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
427 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
428 {
429 "value": "A String", # [Output Only] A warning data value corresponding to the key.
430 "key": "A String", # [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).
431 },
432 ],
433 },
434 ],
435 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
436 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
437 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
438 "name": "A String", # [Output Only] Name of the resource.
439 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
440 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
441 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
442 {
443 "message": "A String", # [Output Only] An optional, human-readable error message.
444 "code": "A String", # [Output Only] The error type identifier for this error.
445 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
446 },
447 ],
448 },
449 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
450 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
451 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
452 }</pre>
453</div>
454
455<div class="method">
456 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
457 <pre>Retrieves a list of autoscalers contained within the specified zone.
458
459Args:
460 project: string, Project ID for this request. (required)
461 zone: string, Name of the zone for this request. (required)
462 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
463
464You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". 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.
465
466Currently, only sorting by name or creationTimestamp desc is supported.
467 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.
468 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.
469 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string.
470
471The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.
472
473For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance.
474
475You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values.
476
477To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters.
478
479Returns:
480 An object of the form:
481
482 { # Contains a list of Autoscaler resources.
483 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
484 "items": [ # A list of Autoscaler resources.
485 { # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.
486 "status": "A String", # [Output Only] The status of the autoscaler configuration.
487 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
488 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
489 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
490 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
491 "autoscalingPolicy": { # 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.
492 #
493 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
494 "maxNumReplicas": 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.
495 "coolDownPeriodSec": 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.
496 #
497 # 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.
498 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
499 "utilizationTarget": 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.
500 },
501 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
502 { # Custom utilization metric policy.
503 "metric": "A String", # The identifier of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. The metric must also have a label of compute.googleapis.com/resource_id with the value of the instance's unique ID, although this alone does not guarantee that the metric is valid.
504 #
505 # For example, the following is a valid metric:
506 # compute.googleapis.com/instance/network/received_bytes_count
507 # The following is not a valid metric because it does not increase or decrease based on usage:
508 # compute.googleapis.com/instance/cpu/reserved_cores
509 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE.
510 "utilizationTarget": 3.14, # Target value of the metric which autoscaler should maintain. Must be a positive value.
511 },
512 ],
513 "cpuUtilization": { # 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.
514 "utilizationTarget": 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.
515 #
516 # 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.
517 #
518 # 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.
519 },
520 "minNumReplicas": 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.
521 },
522 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
523 "statusDetails": [ # [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.
524 {
525 "message": "A String", # The status message.
526 "type": "A String", # The type of error returned.
527 },
528 ],
529 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
530 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
531 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
532 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
533 },
534 ],
535 "kind": "compute#autoscalerList", # [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers.
536 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
537 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
538 }</pre>
539</div>
540
541<div class="method">
542 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
543 <pre>Retrieves the next page of results.
544
545Args:
546 previous_request: The request for the previous page. (required)
547 previous_response: The response from the request for the previous page. (required)
548
549Returns:
550 A request object that you can call 'execute()' on to request the next
551 page. Returns None if there are no more items in the collection.
552 </pre>
553</div>
554
555<div class="method">
556 <code class="details" id="patch">patch(project, zone, autoscaler, body)</code>
557 <pre>Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.
558
559Args:
560 project: string, Project ID for this request. (required)
561 zone: string, Name of the zone for this request. (required)
562 autoscaler: string, Name of the autoscaler to update. (required)
563 body: object, The request body. (required)
564 The object takes the form of:
565
566{ # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.
567 "status": "A String", # [Output Only] The status of the autoscaler configuration.
568 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
569 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
570 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
571 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
572 "autoscalingPolicy": { # 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.
573 #
574 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
575 "maxNumReplicas": 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.
576 "coolDownPeriodSec": 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.
577 #
578 # 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.
579 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
580 "utilizationTarget": 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.
581 },
582 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
583 { # Custom utilization metric policy.
584 "metric": "A String", # The identifier of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. The metric must also have a label of compute.googleapis.com/resource_id with the value of the instance's unique ID, although this alone does not guarantee that the metric is valid.
585 #
586 # For example, the following is a valid metric:
587 # compute.googleapis.com/instance/network/received_bytes_count
588 # The following is not a valid metric because it does not increase or decrease based on usage:
589 # compute.googleapis.com/instance/cpu/reserved_cores
590 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE.
591 "utilizationTarget": 3.14, # Target value of the metric which autoscaler should maintain. Must be a positive value.
592 },
593 ],
594 "cpuUtilization": { # 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.
595 "utilizationTarget": 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.
596 #
597 # 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.
598 #
599 # 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.
600 },
601 "minNumReplicas": 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.
602 },
603 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
604 "statusDetails": [ # [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.
605 {
606 "message": "A String", # The status message.
607 "type": "A String", # The type of error returned.
608 },
609 ],
610 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
611 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
612 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
613 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
614 }
615
616
617Returns:
618 An object of the form:
619
620 { # An Operation resource, used to manage asynchronous API requests.
621 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
622 "clientOperationId": "A String", # [Output Only] Reserved for future use.
623 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
624 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
625 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
626 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
627 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
628 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
629 "progress": 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.
630 "httpErrorStatusCode": 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.
631 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
632 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
633 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
634 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
635 {
636 "message": "A String", # [Output Only] A human-readable description of the warning code.
637 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
638 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
639 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
640 {
641 "value": "A String", # [Output Only] A warning data value corresponding to the key.
642 "key": "A String", # [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).
643 },
644 ],
645 },
646 ],
647 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
648 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
649 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
650 "name": "A String", # [Output Only] Name of the resource.
651 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
652 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
653 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
654 {
655 "message": "A String", # [Output Only] An optional, human-readable error message.
656 "code": "A String", # [Output Only] The error type identifier for this error.
657 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
658 },
659 ],
660 },
661 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
662 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
663 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
664 }</pre>
665</div>
666
667<div class="method">
668 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body)</code>
669 <pre>Returns permissions that a caller has on the specified resource.
670
671Args:
672 project: string, Project ID for this request. (required)
673 zone: string, The name of the zone for this request. (required)
674 resource: string, Name of the resource for this request. (required)
675 body: object, The request body. (required)
676 The object takes the form of:
677
678{
679 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
680 "A String",
681 ],
682 }
683
684
685Returns:
686 An object of the form:
687
688 {
689 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
690 "A String",
691 ],
692 }</pre>
693</div>
694
695<div class="method">
696 <code class="details" id="update">update(project, zone, body, autoscaler=None)</code>
697 <pre>Updates an autoscaler in the specified project using the data included in the request.
698
699Args:
700 project: string, Project ID for this request. (required)
701 zone: string, Name of the zone for this request. (required)
702 body: object, The request body. (required)
703 The object takes the form of:
704
705{ # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances.
706 "status": "A String", # [Output Only] The status of the autoscaler configuration.
707 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
708 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
709 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
710 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
711 "autoscalingPolicy": { # 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.
712 #
713 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
714 "maxNumReplicas": 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.
715 "coolDownPeriodSec": 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.
716 #
717 # 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.
718 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
719 "utilizationTarget": 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.
720 },
721 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
722 { # Custom utilization metric policy.
723 "metric": "A String", # The identifier of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. The metric must also have a label of compute.googleapis.com/resource_id with the value of the instance's unique ID, although this alone does not guarantee that the metric is valid.
724 #
725 # For example, the following is a valid metric:
726 # compute.googleapis.com/instance/network/received_bytes_count
727 # The following is not a valid metric because it does not increase or decrease based on usage:
728 # compute.googleapis.com/instance/cpu/reserved_cores
729 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE.
730 "utilizationTarget": 3.14, # Target value of the metric which autoscaler should maintain. Must be a positive value.
731 },
732 ],
733 "cpuUtilization": { # 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.
734 "utilizationTarget": 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.
735 #
736 # 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.
737 #
738 # 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.
739 },
740 "minNumReplicas": 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.
741 },
742 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
743 "statusDetails": [ # [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.
744 {
745 "message": "A String", # The status message.
746 "type": "A String", # The type of error returned.
747 },
748 ],
749 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
750 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
751 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
752 "name": "A String", # Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
753 }
754
755 autoscaler: string, Name of the autoscaler to update.
756
757Returns:
758 An object of the form:
759
760 { # An Operation resource, used to manage asynchronous API requests.
761 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
762 "clientOperationId": "A String", # [Output Only] Reserved for future use.
763 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
764 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
765 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
766 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
767 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
768 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
769 "progress": 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.
770 "httpErrorStatusCode": 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.
771 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
772 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
773 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
774 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
775 {
776 "message": "A String", # [Output Only] A human-readable description of the warning code.
777 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
778 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
779 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
780 {
781 "value": "A String", # [Output Only] A warning data value corresponding to the key.
782 "key": "A String", # [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).
783 },
784 ],
785 },
786 ],
787 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
788 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
789 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
790 "name": "A String", # [Output Only] Name of the resource.
791 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
792 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
793 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
794 {
795 "message": "A String", # [Output Only] An optional, human-readable error message.
796 "code": "A String", # [Output Only] The error type identifier for this error.
797 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
798 },
799 ],
800 },
801 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
802 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
803 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
804 }</pre>
805</div>
806
807</body></html>