1<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.autoscalers.html">autoscalers</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 79<p class="firstline">Retrieves an aggregated list of autoscalers.</p> 80<p class="toc_element"> 81 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p> 82<p class="firstline">Retrieves the next page of results.</p> 83<p class="toc_element"> 84 <code><a href="#delete">delete(project, zone, autoscaler, requestId=None)</a></code></p> 85<p class="firstline">Deletes the specified autoscaler.</p> 86<p class="toc_element"> 87 <code><a href="#get">get(project, zone, autoscaler)</a></code></p> 88<p class="firstline">Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request.</p> 89<p class="toc_element"> 90 <code><a href="#insert">insert(project, zone, body, requestId=None)</a></code></p> 91<p class="firstline">Creates an autoscaler in the specified project using the data included in the request.</p> 92<p class="toc_element"> 93 <code><a href="#list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 94<p class="firstline">Retrieves a list of autoscalers contained within the specified zone.</p> 95<p class="toc_element"> 96 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 97<p class="firstline">Retrieves the next page of results.</p> 98<p class="toc_element"> 99 <code><a href="#patch">patch(project, zone, body, requestId=None, autoscaler=None)</a></code></p> 100<p class="firstline">Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics.</p> 101<p class="toc_element"> 102 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body)</a></code></p> 103<p class="firstline">Returns permissions that a caller has on the specified resource.</p> 104<p class="toc_element"> 105 <code><a href="#update">update(project, zone, body, requestId=None, autoscaler=None)</a></code></p> 106<p class="firstline">Updates an autoscaler in the specified project using the data included in the request.</p> 107<h3>Method Details</h3> 108<div class="method"> 109 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 110 <pre>Retrieves an aggregated list of autoscalers. 111 112Args: 113 project: string, Project ID for this request. (required) 114 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 115 116You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. 117 118Currently, only sorting by name or creationTimestamp desc is supported. 119 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) 120 pageToken: string, Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. 121 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. 122 123The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. 124 125For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. 126 127You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. 128 129To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. 130 131Returns: 132 An object of the form: 133 134 { 135 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. 136 "items": { # A map of scoped autoscaler lists. 137 "a_key": { # [Output Only] Name of the scope containing this set of autoscalers. 138 "warning": { # [Output Only] Informational warning which replaces the list of autoscalers when the list is empty. 139 "message": "A String", # [Output Only] A human-readable description of the warning code. 140 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. 141 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 142 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 143 { 144 "value": "A String", # [Output Only] A warning data value corresponding to the key. 145 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). 146 }, 147 ], 148 }, 149 "autoscalers": [ # [Output Only] List of autoscalers contained in this scope. 150 { # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. 151 "status": "A String", # [Output Only] The status of the autoscaler configuration. 152 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. 153 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 154 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). 155 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). 156 "autoscalingPolicy": { # Cloud Autoscaler policy. # The configuration parameters for the autoscaling algorithm. You can define one or more of the policies for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. 157 # 158 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. 159 "maxNumReplicas": 42, # The maximum number of instances that the autoscaler can scale up to. This is required when creating or updating an autoscaler. The maximum number of replicas should not be lower than minimal number of replicas. 160 "coolDownPeriodSec": 42, # The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. 161 # 162 # Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process. 163 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer. 164 "utilizationTarget": 3.14, # Fraction of backend capacity utilization (set in HTTP(s) load balancing configuration) that autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. 165 }, 166 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system. 167 "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. 168 "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. 169 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue. 170 "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. 171 "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. 172 }, 173 }, 174 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric. 175 { # Custom utilization metric policy. 176 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. 177 # 178 # The metric must have a value type of INT64 or DOUBLE. 179 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE. 180 "utilizationTarget": 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. 181 # 182 # 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. 183 }, 184 ], 185 "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. 186 "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. 187 # 188 # 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. 189 # 190 # 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. 191 }, 192 "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. 193 }, 194 "target": "A String", # URL of the managed instance group that this autoscaler will scale. 195 "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. 196 { 197 "message": "A String", # The status message. 198 "type": "A String", # The type of error returned. 199 }, 200 ], 201 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 202 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 203 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 204 "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. 205 }, 206 ], 207 }, 208 }, 209 "kind": "compute#autoscalerAggregatedList", # [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers. 210 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 211 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 212 }</pre> 213</div> 214 215<div class="method"> 216 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code> 217 <pre>Retrieves the next page of results. 218 219Args: 220 previous_request: The request for the previous page. (required) 221 previous_response: The response from the request for the previous page. (required) 222 223Returns: 224 A request object that you can call 'execute()' on to request the next 225 page. Returns None if there are no more items in the collection. 226 </pre> 227</div> 228 229<div class="method"> 230 <code class="details" id="delete">delete(project, zone, autoscaler, requestId=None)</code> 231 <pre>Deletes the specified autoscaler. 232 233Args: 234 project: string, Project ID for this request. (required) 235 zone: string, Name of the zone for this request. (required) 236 autoscaler: string, Name of the autoscaler to delete. (required) 237 requestId: string, begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. 238 239Returns: 240 An object of the form: 241 242 { # An Operation resource, used to manage asynchronous API requests. 243 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 244 "clientOperationId": "A String", # [Output Only] Reserved for future use. 245 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 246 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 247 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 248 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 249 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 250 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 251 "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. 252 "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. 253 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 254 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 255 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 256 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 257 { 258 "message": "A String", # [Output Only] A human-readable description of the warning code. 259 "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. 260 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 261 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 262 { 263 "value": "A String", # [Output Only] A warning data value corresponding to the key. 264 "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). 265 }, 266 ], 267 }, 268 ], 269 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 270 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 271 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 272 "name": "A String", # [Output Only] Name of the resource. 273 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 274 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 275 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 276 { 277 "message": "A String", # [Output Only] An optional, human-readable error message. 278 "code": "A String", # [Output Only] The error type identifier for this error. 279 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 280 }, 281 ], 282 }, 283 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 284 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 285 "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. 286 }</pre> 287</div> 288 289<div class="method"> 290 <code class="details" id="get">get(project, zone, autoscaler)</code> 291 <pre>Returns the specified autoscaler resource. Get a list of available autoscalers by making a list() request. 292 293Args: 294 project: string, Project ID for this request. (required) 295 zone: string, Name of the zone for this request. (required) 296 autoscaler: string, Name of the autoscaler to return. (required) 297 298Returns: 299 An object of the form: 300 301 { # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. 302 "status": "A String", # [Output Only] The status of the autoscaler configuration. 303 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. 304 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 305 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). 306 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). 307 "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. 308 # 309 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. 310 "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. 311 "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. 312 # 313 # 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. 314 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer. 315 "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. 316 }, 317 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system. 318 "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. 319 "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. 320 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue. 321 "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. 322 "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. 323 }, 324 }, 325 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric. 326 { # Custom utilization metric policy. 327 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. 328 # 329 # The metric must have a value type of INT64 or DOUBLE. 330 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE. 331 "utilizationTarget": 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. 332 # 333 # 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. 334 }, 335 ], 336 "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. 337 "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. 338 # 339 # 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. 340 # 341 # 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. 342 }, 343 "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. 344 }, 345 "target": "A String", # URL of the managed instance group that this autoscaler will scale. 346 "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. 347 { 348 "message": "A String", # The status message. 349 "type": "A String", # The type of error returned. 350 }, 351 ], 352 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 353 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 354 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 355 "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. 356 }</pre> 357</div> 358 359<div class="method"> 360 <code class="details" id="insert">insert(project, zone, body, requestId=None)</code> 361 <pre>Creates an autoscaler in the specified project using the data included in the request. 362 363Args: 364 project: string, Project ID for this request. (required) 365 zone: string, Name of the zone for this request. (required) 366 body: object, The request body. (required) 367 The object takes the form of: 368 369{ # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. 370 "status": "A String", # [Output Only] The status of the autoscaler configuration. 371 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. 372 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 373 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). 374 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). 375 "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. 376 # 377 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. 378 "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. 379 "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. 380 # 381 # 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. 382 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer. 383 "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. 384 }, 385 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system. 386 "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. 387 "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. 388 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue. 389 "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. 390 "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. 391 }, 392 }, 393 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric. 394 { # Custom utilization metric policy. 395 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. 396 # 397 # The metric must have a value type of INT64 or DOUBLE. 398 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE. 399 "utilizationTarget": 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. 400 # 401 # 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. 402 }, 403 ], 404 "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. 405 "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. 406 # 407 # 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. 408 # 409 # 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. 410 }, 411 "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. 412 }, 413 "target": "A String", # URL of the managed instance group that this autoscaler will scale. 414 "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. 415 { 416 "message": "A String", # The status message. 417 "type": "A String", # The type of error returned. 418 }, 419 ], 420 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 421 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 422 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 423 "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. 424 } 425 426 requestId: string, begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. 427 428Returns: 429 An object of the form: 430 431 { # An Operation resource, used to manage asynchronous API requests. 432 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 433 "clientOperationId": "A String", # [Output Only] Reserved for future use. 434 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 435 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 436 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 437 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 438 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 439 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 440 "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. 441 "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. 442 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 443 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 444 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 445 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 446 { 447 "message": "A String", # [Output Only] A human-readable description of the warning code. 448 "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. 449 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 450 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 451 { 452 "value": "A String", # [Output Only] A warning data value corresponding to the key. 453 "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). 454 }, 455 ], 456 }, 457 ], 458 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 459 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 460 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 461 "name": "A String", # [Output Only] Name of the resource. 462 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 463 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 464 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 465 { 466 "message": "A String", # [Output Only] An optional, human-readable error message. 467 "code": "A String", # [Output Only] The error type identifier for this error. 468 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 469 }, 470 ], 471 }, 472 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 473 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 474 "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. 475 }</pre> 476</div> 477 478<div class="method"> 479 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 480 <pre>Retrieves a list of autoscalers contained within the specified zone. 481 482Args: 483 project: string, Project ID for this request. (required) 484 zone: string, Name of the zone for this request. (required) 485 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 486 487You 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. 488 489Currently, only sorting by name or creationTimestamp desc is supported. 490 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) 491 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. 492 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. 493 494The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. 495 496For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. 497 498You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. 499 500To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. 501 502Returns: 503 An object of the form: 504 505 { # Contains a list of Autoscaler resources. 506 "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. 507 "items": [ # A list of Autoscaler resources. 508 { # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. 509 "status": "A String", # [Output Only] The status of the autoscaler configuration. 510 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. 511 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 512 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). 513 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). 514 "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. 515 # 516 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. 517 "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. 518 "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. 519 # 520 # 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. 521 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer. 522 "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. 523 }, 524 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system. 525 "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. 526 "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. 527 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue. 528 "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. 529 "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. 530 }, 531 }, 532 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric. 533 { # Custom utilization metric policy. 534 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. 535 # 536 # The metric must have a value type of INT64 or DOUBLE. 537 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE. 538 "utilizationTarget": 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. 539 # 540 # 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. 541 }, 542 ], 543 "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. 544 "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. 545 # 546 # 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. 547 # 548 # 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. 549 }, 550 "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. 551 }, 552 "target": "A String", # URL of the managed instance group that this autoscaler will scale. 553 "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. 554 { 555 "message": "A String", # The status message. 556 "type": "A String", # The type of error returned. 557 }, 558 ], 559 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 560 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 561 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 562 "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. 563 }, 564 ], 565 "kind": "compute#autoscalerList", # [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers. 566 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 567 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 568 }</pre> 569</div> 570 571<div class="method"> 572 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 573 <pre>Retrieves the next page of results. 574 575Args: 576 previous_request: The request for the previous page. (required) 577 previous_response: The response from the request for the previous page. (required) 578 579Returns: 580 A request object that you can call 'execute()' on to request the next 581 page. Returns None if there are no more items in the collection. 582 </pre> 583</div> 584 585<div class="method"> 586 <code class="details" id="patch">patch(project, zone, body, requestId=None, autoscaler=None)</code> 587 <pre>Updates an autoscaler in the specified project using the data included in the request. This method supports patch semantics. 588 589Args: 590 project: string, Project ID for this request. (required) 591 zone: string, Name of the zone for this request. (required) 592 body: object, The request body. (required) 593 The object takes the form of: 594 595{ # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. 596 "status": "A String", # [Output Only] The status of the autoscaler configuration. 597 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. 598 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 599 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). 600 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). 601 "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. 602 # 603 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. 604 "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. 605 "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. 606 # 607 # 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. 608 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer. 609 "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. 610 }, 611 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system. 612 "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. 613 "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. 614 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue. 615 "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. 616 "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. 617 }, 618 }, 619 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric. 620 { # Custom utilization metric policy. 621 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. 622 # 623 # The metric must have a value type of INT64 or DOUBLE. 624 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE. 625 "utilizationTarget": 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. 626 # 627 # 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. 628 }, 629 ], 630 "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. 631 "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. 632 # 633 # 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. 634 # 635 # 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. 636 }, 637 "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. 638 }, 639 "target": "A String", # URL of the managed instance group that this autoscaler will scale. 640 "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. 641 { 642 "message": "A String", # The status message. 643 "type": "A String", # The type of error returned. 644 }, 645 ], 646 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 647 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 648 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 649 "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. 650 } 651 652 requestId: string, begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. 653 autoscaler: string, Name of the autoscaler to patch. 654 655Returns: 656 An object of the form: 657 658 { # An Operation resource, used to manage asynchronous API requests. 659 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 660 "clientOperationId": "A String", # [Output Only] Reserved for future use. 661 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 662 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 663 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 664 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 665 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 666 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 667 "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. 668 "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. 669 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 670 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 671 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 672 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 673 { 674 "message": "A String", # [Output Only] A human-readable description of the warning code. 675 "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. 676 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 677 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 678 { 679 "value": "A String", # [Output Only] A warning data value corresponding to the key. 680 "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). 681 }, 682 ], 683 }, 684 ], 685 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 686 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 687 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 688 "name": "A String", # [Output Only] Name of the resource. 689 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 690 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 691 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 692 { 693 "message": "A String", # [Output Only] An optional, human-readable error message. 694 "code": "A String", # [Output Only] The error type identifier for this error. 695 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 696 }, 697 ], 698 }, 699 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 700 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 701 "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. 702 }</pre> 703</div> 704 705<div class="method"> 706 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body)</code> 707 <pre>Returns permissions that a caller has on the specified resource. 708 709Args: 710 project: string, Project ID for this request. (required) 711 zone: string, The name of the zone for this request. (required) 712 resource: string, Name of the resource for this request. (required) 713 body: object, The request body. (required) 714 The object takes the form of: 715 716{ 717 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. 718 "A String", 719 ], 720 } 721 722 723Returns: 724 An object of the form: 725 726 { 727 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed. 728 "A String", 729 ], 730 }</pre> 731</div> 732 733<div class="method"> 734 <code class="details" id="update">update(project, zone, body, requestId=None, autoscaler=None)</code> 735 <pre>Updates an autoscaler in the specified project using the data included in the request. 736 737Args: 738 project: string, Project ID for this request. (required) 739 zone: string, Name of the zone for this request. (required) 740 body: object, The request body. (required) 741 The object takes the form of: 742 743{ # Represents an Autoscaler resource. Autoscalers allow you to automatically scale virtual machine instances in managed instance groups according to an autoscaling policy that you define. For more information, read Autoscaling Groups of Instances. 744 "status": "A String", # [Output Only] The status of the autoscaler configuration. 745 "kind": "compute#autoscaler", # [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. 746 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 747 "zone": "A String", # [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). 748 "region": "A String", # [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). 749 "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. 750 # 751 # If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. 752 "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. 753 "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. 754 # 755 # 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. 756 "loadBalancingUtilization": { # Configuration parameters of autoscaling based on load balancing. # Configuration parameters of autoscaling based on load balancer. 757 "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. 758 }, 759 "queueBasedScaling": { # Configuration parameters of autoscaling based on queuing system. # Configuration parameters of autoscaling based on queuing system. 760 "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. 761 "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. 762 "cloudPubSub": { # Configuration parameters for scaling based on Cloud Pub/Sub subscription queue. # Configuration for Cloud Pub/Sub subscription queue. 763 "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. 764 "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. 765 }, 766 }, 767 "customMetricUtilizations": [ # Configuration parameters of autoscaling based on a custom metric. 768 { # Custom utilization metric policy. 769 "metric": "A String", # The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values and should be a utilization metric, which means that the number of virtual machines handling requests should increase or decrease proportionally to the metric. 770 # 771 # The metric must have a value type of INT64 or DOUBLE. 772 "utilizationTargetType": "A String", # Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If not specified, the default is GAUGE. 773 "utilizationTarget": 3.14, # The target value of the metric that autoscaler should maintain. This must be a positive value. 774 # 775 # 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. 776 }, 777 ], 778 "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. 779 "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. 780 # 781 # 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. 782 # 783 # 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. 784 }, 785 "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. 786 }, 787 "target": "A String", # URL of the managed instance group that this autoscaler will scale. 788 "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. 789 { 790 "message": "A String", # The status message. 791 "type": "A String", # The type of error returned. 792 }, 793 ], 794 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 795 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 796 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 797 "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. 798 } 799 800 requestId: string, begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. 801 autoscaler: string, Name of the autoscaler to update. 802 803Returns: 804 An object of the form: 805 806 { # An Operation resource, used to manage asynchronous API requests. 807 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 808 "clientOperationId": "A String", # [Output Only] Reserved for future use. 809 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 810 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 811 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 812 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 813 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 814 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 815 "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. 816 "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. 817 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 818 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 819 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 820 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 821 { 822 "message": "A String", # [Output Only] A human-readable description of the warning code. 823 "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. 824 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 825 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 826 { 827 "value": "A String", # [Output Only] A warning data value corresponding to the key. 828 "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). 829 }, 830 ], 831 }, 832 ], 833 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 834 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 835 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 836 "name": "A String", # [Output Only] Name of the resource. 837 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 838 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 839 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 840 { 841 "message": "A String", # [Output Only] An optional, human-readable error message. 842 "code": "A String", # [Output Only] The error type identifier for this error. 843 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 844 }, 845 ], 846 }, 847 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 848 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 849 "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. 850 }</pre> 851</div> 852 853</body></html>