blob: a1a2f8a89830813e811d7e82f4196234c4a6cc36 [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">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040078 <code><a href="#delete">delete(project, region, autoscaler, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070079<p class="firstline">Deletes the specified autoscaler.</p>
80<p class="toc_element">
81 <code><a href="#get">get(project, region, autoscaler)</a></code></p>
82<p class="firstline">Returns the specified autoscaler.</p>
83<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040084 <code><a href="#insert">insert(project, region, body, requestId=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -070085<p class="firstline">Creates an autoscaler in the specified project using the data included in the request.</p>
86<p class="toc_element">
87 <code><a href="#list">list(project, region, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
88<p class="firstline">Retrieves a list of autoscalers contained within the specified region.</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
Sai Cheemalapatie833b792017-03-24 15:06:46 -070093 <code><a href="#patch">patch(project, region, body, requestId=None, autoscaler=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<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 -070095<p class="toc_element">
96 <code><a href="#testIamPermissions">testIamPermissions(project, region, resource, body)</a></code></p>
97<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
98<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040099 <code><a href="#update">update(project, region, body, requestId=None, autoscaler=None)</a></code></p>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700100<p class="firstline">Updates an autoscaler in the specified project using the data included in the request.</p>
101<h3>Method Details</h3>
102<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400103 <code class="details" id="delete">delete(project, region, autoscaler, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700104 <pre>Deletes the specified autoscaler.
105
106Args:
107 project: string, Project ID for this request. (required)
108 region: string, Name of the region scoping this request. (required)
109 autoscaler: string, Name of the autoscaler to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700110 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.
111
112For 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.
113
114The 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 -0700115
116Returns:
117 An object of the form:
118
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700119 { # Represents an Operation resource.
120 #
121 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
122 #
123 # Operations can be global, regional or zonal.
124 # - For global operations, use the globalOperations resource.
125 # - For regional operations, use the regionOperations resource.
126 # - For zonal operations, use the zonalOperations resource.
127 #
128 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700129 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700130 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400131 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700132 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700133 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700134 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
135 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
136 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
137 "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.
138 "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.
139 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
140 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
141 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
142 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
143 {
144 "message": "A String", # [Output Only] A human-readable description of the warning code.
145 "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.
146 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
147 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
148 {
149 "value": "A String", # [Output Only] A warning data value corresponding to the key.
150 "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).
151 },
152 ],
153 },
154 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700155 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700156 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
157 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
158 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
159 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700160 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700161 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
162 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
163 {
164 "message": "A String", # [Output Only] An optional, human-readable error message.
165 "code": "A String", # [Output Only] The error type identifier for this error.
166 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
167 },
168 ],
169 },
170 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
171 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800172 "targetLink": "A String", # [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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700173 }</pre>
174</div>
175
176<div class="method">
177 <code class="details" id="get">get(project, region, autoscaler)</code>
178 <pre>Returns the specified autoscaler.
179
180Args:
181 project: string, Project ID for this request. (required)
182 region: string, Name of the region scoping this request. (required)
183 autoscaler: string, Name of the autoscaler to return. (required)
184
185Returns:
186 An object of the form:
187
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700188 { # Represents an Autoscaler resource.
189 #
190 #
191 #
192 # 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.
193 #
194 # For zonal managed instance groups resource, use the autoscaler resource.
195 #
196 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700197 "status": "A String", # [Output Only] The status of the autoscaler configuration.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700198 "recommendedSize": 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700199 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
200 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
201 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
202 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
203 "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.
204 #
205 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
206 "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.
207 "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.
208 #
209 # 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.
210 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700211 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700212 },
213 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system.
214 "acceptableBacklogPerInstance": 3.14, # Scaling based on the average number of tasks in the queue per each active instance. The autoscaler keeps the average number of tasks per instance below this number, based on data collected in the last couple of minutes. The autoscaler will also take into account incoming tasks when calculating when to scale.
215 "singleWorkerThroughputPerSec": 3.14, # The scaling algorithm will also calculate throughput estimates on its own; if you explicitly provide this value, the autoscaler will take into account your value as well as automatic estimates when deciding how to scale.
216 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue.
217 "topic": "A String", # Cloud Pub/Sub topic used for scaling. Provide the partial URL or partial URL (starting with projects/) or just the topic name. The topic must belong to the same project as the Autoscaler resource.
218 "subscription": "A String", # Cloud Pub/Sub subscription used for scaling. Provide the partial URL (starting with projects/) or just the subscription name. The subscription must be assigned to the topic specified in topicName and must be in a pull configuration. The subscription must belong to the same project as the Autoscaler.
219 },
220 },
221 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
222 { # Custom utilization metric policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700223 "filter": "A String", # 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.
224 #
225 # For the filter to be valid for autoscaling purposes, the following rules apply:
226 # - You can only use the AND operator for joining selectors.
227 # - You can only use direct equality comparison operator (=) without any functions for each selector.
228 # - 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.
229 # - 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.
230 # 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.
231 #
232 # If not specified, the type defaults to gce_instance.
233 #
234 # 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.
235 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700236 #
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400237 # The metric must have a value type of INT64 or DOUBLE.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700238 "singleInstanceAssignment": 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.
239 #
240 # 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.
241 #
242 # A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
243 "utilizationTarget": 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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400244 #
245 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700246 "utilizationTargetType": "A String", # 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 -0700247 },
248 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700249 "mode": "A String", # Defines operating mode for this policy.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700250 "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.
251 "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.
252 #
253 # 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.
254 #
255 # 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.
256 },
257 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700258 "scaleDownControl": { # 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.
259 "maxScaledDownReplicas": { # 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.
260 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
261 #
262 #
263 # - If the value is fixed, then the calculated value is equal to the fixed value.
264 # - 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.
265 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
266 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
267 },
268 "timeWindowSec": 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
269 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700270 },
271 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
272 "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.
273 {
274 "message": "A String", # The status message.
275 "type": "A String", # The type of error returned.
276 },
277 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700278 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700279 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
280 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
281 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700282 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700283 }</pre>
284</div>
285
286<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400287 <code class="details" id="insert">insert(project, region, body, requestId=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700288 <pre>Creates an autoscaler in the specified project using the data included in the request.
289
290Args:
291 project: string, Project ID for this request. (required)
292 region: string, Name of the region scoping this request. (required)
293 body: object, The request body. (required)
294 The object takes the form of:
295
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700296{ # Represents an Autoscaler resource.
297 #
298 #
299 #
300 # 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.
301 #
302 # For zonal managed instance groups resource, use the autoscaler resource.
303 #
304 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700305 "status": "A String", # [Output Only] The status of the autoscaler configuration.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700306 "recommendedSize": 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700307 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
308 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
309 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
310 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
311 "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.
312 #
313 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
314 "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.
315 "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.
316 #
317 # 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.
318 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700319 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700320 },
321 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system.
322 "acceptableBacklogPerInstance": 3.14, # Scaling based on the average number of tasks in the queue per each active instance. The autoscaler keeps the average number of tasks per instance below this number, based on data collected in the last couple of minutes. The autoscaler will also take into account incoming tasks when calculating when to scale.
323 "singleWorkerThroughputPerSec": 3.14, # The scaling algorithm will also calculate throughput estimates on its own; if you explicitly provide this value, the autoscaler will take into account your value as well as automatic estimates when deciding how to scale.
324 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue.
325 "topic": "A String", # Cloud Pub/Sub topic used for scaling. Provide the partial URL or partial URL (starting with projects/) or just the topic name. The topic must belong to the same project as the Autoscaler resource.
326 "subscription": "A String", # Cloud Pub/Sub subscription used for scaling. Provide the partial URL (starting with projects/) or just the subscription name. The subscription must be assigned to the topic specified in topicName and must be in a pull configuration. The subscription must belong to the same project as the Autoscaler.
327 },
328 },
329 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
330 { # Custom utilization metric policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700331 "filter": "A String", # 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.
332 #
333 # For the filter to be valid for autoscaling purposes, the following rules apply:
334 # - You can only use the AND operator for joining selectors.
335 # - You can only use direct equality comparison operator (=) without any functions for each selector.
336 # - 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.
337 # - 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.
338 # 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.
339 #
340 # If not specified, the type defaults to gce_instance.
341 #
342 # 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.
343 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700344 #
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400345 # The metric must have a value type of INT64 or DOUBLE.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700346 "singleInstanceAssignment": 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.
347 #
348 # 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.
349 #
350 # A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
351 "utilizationTarget": 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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400352 #
353 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700354 "utilizationTargetType": "A String", # 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 -0700355 },
356 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700357 "mode": "A String", # Defines operating mode for this policy.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700358 "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.
359 "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.
360 #
361 # 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.
362 #
363 # 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.
364 },
365 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700366 "scaleDownControl": { # 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.
367 "maxScaledDownReplicas": { # 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.
368 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
369 #
370 #
371 # - If the value is fixed, then the calculated value is equal to the fixed value.
372 # - 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.
373 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
374 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
375 },
376 "timeWindowSec": 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
377 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700378 },
379 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
380 "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.
381 {
382 "message": "A String", # The status message.
383 "type": "A String", # The type of error returned.
384 },
385 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700386 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700387 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
388 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
389 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700390 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700391 }
392
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700393 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.
394
395For 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.
396
397The 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 -0700398
399Returns:
400 An object of the form:
401
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700402 { # Represents an Operation resource.
403 #
404 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
405 #
406 # Operations can be global, regional or zonal.
407 # - For global operations, use the globalOperations resource.
408 # - For regional operations, use the regionOperations resource.
409 # - For zonal operations, use the zonalOperations resource.
410 #
411 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700412 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700413 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400414 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700415 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700416 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700417 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
418 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
419 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
420 "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.
421 "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.
422 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
423 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
424 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
425 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
426 {
427 "message": "A String", # [Output Only] A human-readable description of the warning code.
428 "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.
429 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
430 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
431 {
432 "value": "A String", # [Output Only] A warning data value corresponding to the key.
433 "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).
434 },
435 ],
436 },
437 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700438 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700439 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
440 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
441 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
442 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700443 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700444 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
445 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
446 {
447 "message": "A String", # [Output Only] An optional, human-readable error message.
448 "code": "A String", # [Output Only] The error type identifier for this error.
449 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
450 },
451 ],
452 },
453 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
454 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800455 "targetLink": "A String", # [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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700456 }</pre>
457</div>
458
459<div class="method">
460 <code class="details" id="list">list(project, region, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
461 <pre>Retrieves a list of autoscalers contained within the specified region.
462
463Args:
464 project: string, Project ID for this request. (required)
465 region: string, Name of the region scoping this request. (required)
466 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
467
468You 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.
469
470Currently, only sorting by name or creationTimestamp desc is supported.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400471 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)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700472 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700473 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 =, !=, >, or <.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700474
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700475For 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 -0700476
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700477You 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 -0700478
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700479To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true).
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700480
481Returns:
482 An object of the form:
483
484 { # Contains a list of autoscalers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700485 "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.
486 "kind": "compute#regionAutoscalerList", # Type of resource.
487 "items": [ # A list of Autoscaler resources.
488 { # Represents an Autoscaler resource.
489 #
490 #
491 #
492 # 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.
493 #
494 # For zonal managed instance groups resource, use the autoscaler resource.
495 #
496 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700497 "status": "A String", # [Output Only] The status of the autoscaler configuration.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700498 "recommendedSize": 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700499 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
500 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
501 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
502 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
503 "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.
504 #
505 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
506 "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.
507 "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.
508 #
509 # 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.
510 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700511 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700512 },
513 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system.
514 "acceptableBacklogPerInstance": 3.14, # Scaling based on the average number of tasks in the queue per each active instance. The autoscaler keeps the average number of tasks per instance below this number, based on data collected in the last couple of minutes. The autoscaler will also take into account incoming tasks when calculating when to scale.
515 "singleWorkerThroughputPerSec": 3.14, # The scaling algorithm will also calculate throughput estimates on its own; if you explicitly provide this value, the autoscaler will take into account your value as well as automatic estimates when deciding how to scale.
516 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue.
517 "topic": "A String", # Cloud Pub/Sub topic used for scaling. Provide the partial URL or partial URL (starting with projects/) or just the topic name. The topic must belong to the same project as the Autoscaler resource.
518 "subscription": "A String", # Cloud Pub/Sub subscription used for scaling. Provide the partial URL (starting with projects/) or just the subscription name. The subscription must be assigned to the topic specified in topicName and must be in a pull configuration. The subscription must belong to the same project as the Autoscaler.
519 },
520 },
521 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
522 { # Custom utilization metric policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700523 "filter": "A String", # 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.
524 #
525 # For the filter to be valid for autoscaling purposes, the following rules apply:
526 # - You can only use the AND operator for joining selectors.
527 # - You can only use direct equality comparison operator (=) without any functions for each selector.
528 # - 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.
529 # - 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.
530 # 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.
531 #
532 # If not specified, the type defaults to gce_instance.
533 #
534 # 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.
535 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700536 #
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400537 # The metric must have a value type of INT64 or DOUBLE.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700538 "singleInstanceAssignment": 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.
539 #
540 # 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.
541 #
542 # A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
543 "utilizationTarget": 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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400544 #
545 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700546 "utilizationTargetType": "A String", # 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 -0700547 },
548 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700549 "mode": "A String", # Defines operating mode for this policy.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700550 "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.
551 "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.
552 #
553 # 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.
554 #
555 # 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.
556 },
557 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700558 "scaleDownControl": { # 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.
559 "maxScaledDownReplicas": { # 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.
560 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
561 #
562 #
563 # - If the value is fixed, then the calculated value is equal to the fixed value.
564 # - 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.
565 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
566 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
567 },
568 "timeWindowSec": 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
569 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700570 },
571 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
572 "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.
573 {
574 "message": "A String", # The status message.
575 "type": "A String", # The type of error returned.
576 },
577 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700578 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700579 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
580 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
581 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700582 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700583 },
584 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700585 "warning": { # [Output Only] Informational warning message.
586 "message": "A String", # [Output Only] A human-readable description of the warning code.
587 "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.
588 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
589 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
590 {
591 "value": "A String", # [Output Only] A warning data value corresponding to the key.
592 "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).
593 },
594 ],
595 },
596 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700597 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
598 }</pre>
599</div>
600
601<div class="method">
602 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
603 <pre>Retrieves the next page of results.
604
605Args:
606 previous_request: The request for the previous page. (required)
607 previous_response: The response from the request for the previous page. (required)
608
609Returns:
610 A request object that you can call 'execute()' on to request the next
611 page. Returns None if there are no more items in the collection.
612 </pre>
613</div>
614
615<div class="method">
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700616 <code class="details" id="patch">patch(project, region, body, requestId=None, autoscaler=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700617 <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 -0700618
619Args:
620 project: string, Project ID for this request. (required)
621 region: string, Name of the region scoping this request. (required)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700622 body: object, The request body. (required)
623 The object takes the form of:
624
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700625{ # Represents an Autoscaler resource.
626 #
627 #
628 #
629 # 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.
630 #
631 # For zonal managed instance groups resource, use the autoscaler resource.
632 #
633 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700634 "status": "A String", # [Output Only] The status of the autoscaler configuration.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700635 "recommendedSize": 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700636 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
637 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
638 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
639 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
640 "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.
641 #
642 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
643 "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.
644 "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.
645 #
646 # 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.
647 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700648 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700649 },
650 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system.
651 "acceptableBacklogPerInstance": 3.14, # Scaling based on the average number of tasks in the queue per each active instance. The autoscaler keeps the average number of tasks per instance below this number, based on data collected in the last couple of minutes. The autoscaler will also take into account incoming tasks when calculating when to scale.
652 "singleWorkerThroughputPerSec": 3.14, # The scaling algorithm will also calculate throughput estimates on its own; if you explicitly provide this value, the autoscaler will take into account your value as well as automatic estimates when deciding how to scale.
653 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue.
654 "topic": "A String", # Cloud Pub/Sub topic used for scaling. Provide the partial URL or partial URL (starting with projects/) or just the topic name. The topic must belong to the same project as the Autoscaler resource.
655 "subscription": "A String", # Cloud Pub/Sub subscription used for scaling. Provide the partial URL (starting with projects/) or just the subscription name. The subscription must be assigned to the topic specified in topicName and must be in a pull configuration. The subscription must belong to the same project as the Autoscaler.
656 },
657 },
658 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
659 { # Custom utilization metric policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700660 "filter": "A String", # 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.
661 #
662 # For the filter to be valid for autoscaling purposes, the following rules apply:
663 # - You can only use the AND operator for joining selectors.
664 # - You can only use direct equality comparison operator (=) without any functions for each selector.
665 # - 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.
666 # - 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.
667 # 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.
668 #
669 # If not specified, the type defaults to gce_instance.
670 #
671 # 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.
672 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700673 #
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400674 # The metric must have a value type of INT64 or DOUBLE.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700675 "singleInstanceAssignment": 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.
676 #
677 # 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.
678 #
679 # A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
680 "utilizationTarget": 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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400681 #
682 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700683 "utilizationTargetType": "A String", # 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 -0700684 },
685 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700686 "mode": "A String", # Defines operating mode for this policy.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700687 "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.
688 "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.
689 #
690 # 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.
691 #
692 # 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.
693 },
694 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700695 "scaleDownControl": { # 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.
696 "maxScaledDownReplicas": { # 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.
697 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
698 #
699 #
700 # - If the value is fixed, then the calculated value is equal to the fixed value.
701 # - 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.
702 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
703 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
704 },
705 "timeWindowSec": 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
706 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700707 },
708 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
709 "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.
710 {
711 "message": "A String", # The status message.
712 "type": "A String", # The type of error returned.
713 },
714 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700715 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700716 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
717 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
718 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700719 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700720 }
721
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700722 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.
723
724For 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.
725
726The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
Sai Cheemalapatie833b792017-03-24 15:06:46 -0700727 autoscaler: string, Name of the autoscaler to patch.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700728
729Returns:
730 An object of the form:
731
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700732 { # Represents an Operation resource.
733 #
734 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
735 #
736 # Operations can be global, regional or zonal.
737 # - For global operations, use the globalOperations resource.
738 # - For regional operations, use the regionOperations resource.
739 # - For zonal operations, use the zonalOperations resource.
740 #
741 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700742 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700743 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400744 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700745 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700746 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700747 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
748 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
749 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
750 "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.
751 "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.
752 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
753 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
754 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
755 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
756 {
757 "message": "A String", # [Output Only] A human-readable description of the warning code.
758 "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.
759 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
760 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
761 {
762 "value": "A String", # [Output Only] A warning data value corresponding to the key.
763 "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).
764 },
765 ],
766 },
767 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700768 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700769 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
770 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
771 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
772 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700773 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700774 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
775 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
776 {
777 "message": "A String", # [Output Only] An optional, human-readable error message.
778 "code": "A String", # [Output Only] The error type identifier for this error.
779 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
780 },
781 ],
782 },
783 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
784 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800785 "targetLink": "A String", # [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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700786 }</pre>
787</div>
788
789<div class="method">
790 <code class="details" id="testIamPermissions">testIamPermissions(project, region, resource, body)</code>
791 <pre>Returns permissions that a caller has on the specified resource.
792
793Args:
794 project: string, Project ID for this request. (required)
795 region: string, The name of the region for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700796 resource: string, Name or id of the resource for this request. (required)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700797 body: object, The request body. (required)
798 The object takes the form of:
799
800{
801 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
802 "A String",
803 ],
804 }
805
806
807Returns:
808 An object of the form:
809
810 {
811 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
812 "A String",
813 ],
814 }</pre>
815</div>
816
817<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400818 <code class="details" id="update">update(project, region, body, requestId=None, autoscaler=None)</code>
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700819 <pre>Updates an autoscaler in the specified project using the data included in the request.
820
821Args:
822 project: string, Project ID for this request. (required)
823 region: string, Name of the region scoping this request. (required)
824 body: object, The request body. (required)
825 The object takes the form of:
826
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700827{ # Represents an Autoscaler resource.
828 #
829 #
830 #
831 # 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.
832 #
833 # For zonal managed instance groups resource, use the autoscaler resource.
834 #
835 # For regional managed instance groups, use the regionAutoscalers resource. (== resource_for beta.autoscalers ==) (== resource_for v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== resource_for v1.regionAutoscalers ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700836 "status": "A String", # [Output Only] The status of the autoscaler configuration.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700837 "recommendedSize": 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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700838 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers.
839 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
840 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope).
841 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope).
842 "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.
843 #
844 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%.
845 "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.
846 "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.
847 #
848 # 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.
849 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700850 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700851 },
852 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system.
853 "acceptableBacklogPerInstance": 3.14, # Scaling based on the average number of tasks in the queue per each active instance. The autoscaler keeps the average number of tasks per instance below this number, based on data collected in the last couple of minutes. The autoscaler will also take into account incoming tasks when calculating when to scale.
854 "singleWorkerThroughputPerSec": 3.14, # The scaling algorithm will also calculate throughput estimates on its own; if you explicitly provide this value, the autoscaler will take into account your value as well as automatic estimates when deciding how to scale.
855 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue.
856 "topic": "A String", # Cloud Pub/Sub topic used for scaling. Provide the partial URL or partial URL (starting with projects/) or just the topic name. The topic must belong to the same project as the Autoscaler resource.
857 "subscription": "A String", # Cloud Pub/Sub subscription used for scaling. Provide the partial URL (starting with projects/) or just the subscription name. The subscription must be assigned to the topic specified in topicName and must be in a pull configuration. The subscription must belong to the same project as the Autoscaler.
858 },
859 },
860 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric.
861 { # Custom utilization metric policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700862 "filter": "A String", # 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.
863 #
864 # For the filter to be valid for autoscaling purposes, the following rules apply:
865 # - You can only use the AND operator for joining selectors.
866 # - You can only use direct equality comparison operator (=) without any functions for each selector.
867 # - 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.
868 # - 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.
869 # 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.
870 #
871 # If not specified, the type defaults to gce_instance.
872 #
873 # 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.
874 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700875 #
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400876 # The metric must have a value type of INT64 or DOUBLE.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700877 "singleInstanceAssignment": 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.
878 #
879 # 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.
880 #
881 # A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead.
882 "utilizationTarget": 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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400883 #
884 # For example, a good metric to use as a utilization_target is compute.googleapis.com/instance/network/received_bytes_count. The autoscaler will work to keep this value constant for each of the instances.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700885 "utilizationTargetType": "A String", # 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 -0700886 },
887 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700888 "mode": "A String", # Defines operating mode for this policy.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700889 "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.
890 "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.
891 #
892 # 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.
893 #
894 # 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.
895 },
896 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700897 "scaleDownControl": { # 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.
898 "maxScaledDownReplicas": { # 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.
899 "calculated": 42, # [Output Only] Absolute value of VM instances calculated based on the specific mode.
900 #
901 #
902 # - If the value is fixed, then the calculated value is equal to the fixed value.
903 # - 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.
904 "fixed": 42, # Specifies a fixed number of VM instances. This must be a positive integer.
905 "percent": 42, # Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.
906 },
907 "timeWindowSec": 42, # How long back autoscaling should look when computing recommendations to include directives regarding slower scale down, as described above.
908 },
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700909 },
910 "target": "A String", # URL of the managed instance group that this autoscaler will scale.
911 "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.
912 {
913 "message": "A String", # The status message.
914 "type": "A String", # The type of error returned.
915 },
916 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700917 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700918 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
919 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
920 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700921 "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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700922 }
923
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 autoscaler: string, Name of the autoscaler to update.
930
931Returns:
932 An object of the form:
933
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700934 { # Represents an Operation resource.
935 #
936 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
937 #
938 # Operations can be global, regional or zonal.
939 # - For global operations, use the globalOperations resource.
940 # - For regional operations, use the regionOperations resource.
941 # - For zonal operations, use the zonalOperations resource.
942 #
943 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700944 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700945 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400946 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700947 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700948 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700949 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
950 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
951 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
952 "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.
953 "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.
954 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
955 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
956 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
957 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
958 {
959 "message": "A String", # [Output Only] A human-readable description of the warning code.
960 "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.
961 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
962 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
963 {
964 "value": "A String", # [Output Only] A warning data value corresponding to the key.
965 "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).
966 },
967 ],
968 },
969 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700970 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700971 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
972 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
973 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
974 "name": "A String", # [Output Only] Name of the resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700975 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700976 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
977 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
978 {
979 "message": "A String", # [Output Only] An optional, human-readable error message.
980 "code": "A String", # [Output Only] The error type identifier for this error.
981 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
982 },
983 ],
984 },
985 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
986 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800987 "targetLink": "A String", # [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.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700988 }</pre>
989</div>
990
991</body></html>