1 <html><body> 2 <style> 3 4 body, 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 15 body { 16 font-size: 13px; 17 padding: 1em; 18 } 19 20 h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23 } 24 25 h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28 } 29 30 h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34 } 35 36 pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39 } 40 41 pre { 42 margin-top: 0.5em; 43 } 44 45 h1, h2, h3, p { 46 font-family: Arial, sans serif; 47 } 48 49 h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51 } 52 53 .toc_element { 54 margin-top: 0.5em; 55 } 56 57 .firstline { 58 margin-left: 2 em; 59 } 60 61 .method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66 } 67 68 .details { 69 font-weight: bold; 70 font-size: 14px; 71 } 72 73 </style> 74 75 <h1><a href="compute_beta.html">Compute Engine API</a> . <a href="compute_beta.instanceGroups.html">instanceGroups</a></h1> 76 <h2>Instance Methods</h2> 77 <p class="toc_element"> 78 <code><a href="#addInstances">addInstances(project, zone, instanceGroup, body)</a></code></p> 79 <p class="firstline">Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information.</p> 80 <p class="toc_element"> 81 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 82 <p class="firstline">Retrieves the list of instance groups and sorts them by zone.</p> 83 <p class="toc_element"> 84 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p> 85 <p class="firstline">Retrieves the next page of results.</p> 86 <p class="toc_element"> 87 <code><a href="#delete">delete(project, zone, instanceGroup)</a></code></p> 88 <p class="firstline">Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.</p> 89 <p class="toc_element"> 90 <code><a href="#get">get(project, zone, instanceGroup)</a></code></p> 91 <p class="firstline">Returns the specified instance group. Get a list of available instance groups by making a list() request.</p> 92 <p class="toc_element"> 93 <code><a href="#insert">insert(project, zone, body)</a></code></p> 94 <p class="firstline">Creates an instance group in the specified project using the parameters that are included in the request.</p> 95 <p class="toc_element"> 96 <code><a href="#list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 97 <p class="firstline">Retrieves the list of instance groups that are located in the specified project and zone.</p> 98 <p class="toc_element"> 99 <code><a href="#listInstances">listInstances(project, zone, instanceGroup, body, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 100 <p class="firstline">Lists the instances in the specified instance group.</p> 101 <p class="toc_element"> 102 <code><a href="#listInstances_next">listInstances_next(previous_request, previous_response)</a></code></p> 103 <p class="firstline">Retrieves the next page of results.</p> 104 <p class="toc_element"> 105 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 106 <p class="firstline">Retrieves the next page of results.</p> 107 <p class="toc_element"> 108 <code><a href="#removeInstances">removeInstances(project, zone, instanceGroup, body)</a></code></p> 109 <p class="firstline">Removes one or more instances from the specified instance group, but does not delete those instances.</p> 110 <p class="toc_element"> 111 <code><a href="#setNamedPorts">setNamedPorts(project, zone, instanceGroup, body)</a></code></p> 112 <p class="firstline">Sets the named ports for the specified instance group.</p> 113 <p class="toc_element"> 114 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body)</a></code></p> 115 <p class="firstline">Returns permissions that a caller has on the specified resource.</p> 116 <h3>Method Details</h3> 117 <div class="method"> 118 <code class="details" id="addInstances">addInstances(project, zone, instanceGroup, body)</code> 119 <pre>Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. 120 121 Args: 122 project: string, Project ID for this request. (required) 123 zone: string, The name of the zone where the instance group is located. (required) 124 instanceGroup: string, The name of the instance group where you are adding instances. (required) 125 body: object, The request body. (required) 126 The object takes the form of: 127 128 { 129 "instances": [ # The list of instances to add to the instance group. 130 { 131 "instance": "A String", # The URL for a specific instance. 132 }, 133 ], 134 } 135 136 137 Returns: 138 An object of the form: 139 140 { # An Operation resource, used to manage asynchronous API requests. 141 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 142 "clientOperationId": "A String", # [Output Only] Reserved for future use. 143 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 144 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 145 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 146 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 147 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 148 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 149 "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. 150 "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. 151 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 152 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 153 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 154 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 155 { 156 "message": "A String", # [Output Only] A human-readable description of the warning code. 157 "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. 158 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 159 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 160 { 161 "value": "A String", # [Output Only] A warning data value corresponding to the key. 162 "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). 163 }, 164 ], 165 }, 166 ], 167 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 168 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 169 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 170 "name": "A String", # [Output Only] Name of the resource. 171 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 172 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 173 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 174 { 175 "message": "A String", # [Output Only] An optional, human-readable error message. 176 "code": "A String", # [Output Only] The error type identifier for this error. 177 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 178 }, 179 ], 180 }, 181 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 182 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 183 "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. 184 }</pre> 185 </div> 186 187 <div class="method"> 188 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 189 <pre>Retrieves the list of instance groups and sorts them by zone. 190 191 Args: 192 project: string, Project ID for this request. (required) 193 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 194 195 You 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. 196 197 Currently, only sorting by name or creationTimestamp desc is supported. 198 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) 199 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. 200 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. 201 202 The 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. 203 204 For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. 205 206 You 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. 207 208 To 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. 209 210 Returns: 211 An object of the form: 212 213 { 214 "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. 215 "items": { # A map of scoped instance group lists. 216 "a_key": { # The name of the scope that contains this set of instance groups. 217 "warning": { # [Output Only] An informational warning that replaces the list of instance groups when the list is empty. 218 "message": "A String", # [Output Only] A human-readable description of the warning code. 219 "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. 220 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 221 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 222 { 223 "value": "A String", # [Output Only] A warning data value corresponding to the key. 224 "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). 225 }, 226 ], 227 }, 228 "instanceGroups": [ # [Output Only] The list of instance groups that are contained in this scope. 229 { 230 "size": 42, # [Output Only] The total number of instances in the instance group. 231 "kind": "compute#instanceGroup", # [Output Only] The resource type, which is always compute#instanceGroup for instance groups. 232 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 233 "zone": "A String", # [Output Only] The URL of the zone where the instance group is located (for zonal resources). 234 "region": "A String", # The URL of the region where the instance group is located (for regional resources). 235 "network": "A String", # The URL of the network to which all instances in the instance group belong. 236 "fingerprint": "A String", # [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. 237 "subnetwork": "A String", # The URL of the subnetwork to which all instances in the instance group belong. 238 "namedPorts": [ # Assigns a name to a port number. For example: {name: "http", port: 80} 239 # 240 # This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "http", port: 80},{name: "http", port: 8080}] 241 # 242 # Named ports apply to all instances in this instance group. 243 { # The named port. For example: . 244 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. 245 "port": 42, # The port number, which can be a value between 1 and 65535. 246 }, 247 ], 248 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance group in RFC3339 text format. 249 "id": "A String", # [Output Only] A unique identifier for this instance group, generated by the server. 250 "selfLink": "A String", # [Output Only] The URL for this instance group. The server generates this URL. 251 "name": "A String", # The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. 252 }, 253 ], 254 }, 255 }, 256 "kind": "compute#instanceGroupAggregatedList", # [Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups. 257 "id": "A String", # [Output Only] A unique identifier for this aggregated list of instance groups. The server generates this identifier. 258 "selfLink": "A String", # [Output Only] The URL for this resource type. The server generates this URL. 259 }</pre> 260 </div> 261 262 <div class="method"> 263 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code> 264 <pre>Retrieves the next page of results. 265 266 Args: 267 previous_request: The request for the previous page. (required) 268 previous_response: The response from the request for the previous page. (required) 269 270 Returns: 271 A request object that you can call 'execute()' on to request the next 272 page. Returns None if there are no more items in the collection. 273 </pre> 274 </div> 275 276 <div class="method"> 277 <code class="details" id="delete">delete(project, zone, instanceGroup)</code> 278 <pre>Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. 279 280 Args: 281 project: string, Project ID for this request. (required) 282 zone: string, The name of the zone where the instance group is located. (required) 283 instanceGroup: string, The name of the instance group to delete. (required) 284 285 Returns: 286 An object of the form: 287 288 { # An Operation resource, used to manage asynchronous API requests. 289 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 290 "clientOperationId": "A String", # [Output Only] Reserved for future use. 291 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 292 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 293 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 294 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 295 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 296 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 297 "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. 298 "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. 299 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 300 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 301 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 302 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 303 { 304 "message": "A String", # [Output Only] A human-readable description of the warning code. 305 "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. 306 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 307 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 308 { 309 "value": "A String", # [Output Only] A warning data value corresponding to the key. 310 "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). 311 }, 312 ], 313 }, 314 ], 315 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 316 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 317 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 318 "name": "A String", # [Output Only] Name of the resource. 319 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 320 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 321 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 322 { 323 "message": "A String", # [Output Only] An optional, human-readable error message. 324 "code": "A String", # [Output Only] The error type identifier for this error. 325 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 326 }, 327 ], 328 }, 329 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 330 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 331 "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. 332 }</pre> 333 </div> 334 335 <div class="method"> 336 <code class="details" id="get">get(project, zone, instanceGroup)</code> 337 <pre>Returns the specified instance group. Get a list of available instance groups by making a list() request. 338 339 Args: 340 project: string, Project ID for this request. (required) 341 zone: string, The name of the zone where the instance group is located. (required) 342 instanceGroup: string, The name of the instance group. (required) 343 344 Returns: 345 An object of the form: 346 347 { 348 "size": 42, # [Output Only] The total number of instances in the instance group. 349 "kind": "compute#instanceGroup", # [Output Only] The resource type, which is always compute#instanceGroup for instance groups. 350 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 351 "zone": "A String", # [Output Only] The URL of the zone where the instance group is located (for zonal resources). 352 "region": "A String", # The URL of the region where the instance group is located (for regional resources). 353 "network": "A String", # The URL of the network to which all instances in the instance group belong. 354 "fingerprint": "A String", # [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. 355 "subnetwork": "A String", # The URL of the subnetwork to which all instances in the instance group belong. 356 "namedPorts": [ # Assigns a name to a port number. For example: {name: "http", port: 80} 357 # 358 # This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "http", port: 80},{name: "http", port: 8080}] 359 # 360 # Named ports apply to all instances in this instance group. 361 { # The named port. For example: . 362 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. 363 "port": 42, # The port number, which can be a value between 1 and 65535. 364 }, 365 ], 366 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance group in RFC3339 text format. 367 "id": "A String", # [Output Only] A unique identifier for this instance group, generated by the server. 368 "selfLink": "A String", # [Output Only] The URL for this instance group. The server generates this URL. 369 "name": "A String", # The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. 370 }</pre> 371 </div> 372 373 <div class="method"> 374 <code class="details" id="insert">insert(project, zone, body)</code> 375 <pre>Creates an instance group in the specified project using the parameters that are included in the request. 376 377 Args: 378 project: string, Project ID for this request. (required) 379 zone: string, The name of the zone where you want to create the instance group. (required) 380 body: object, The request body. (required) 381 The object takes the form of: 382 383 { 384 "size": 42, # [Output Only] The total number of instances in the instance group. 385 "kind": "compute#instanceGroup", # [Output Only] The resource type, which is always compute#instanceGroup for instance groups. 386 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 387 "zone": "A String", # [Output Only] The URL of the zone where the instance group is located (for zonal resources). 388 "region": "A String", # The URL of the region where the instance group is located (for regional resources). 389 "network": "A String", # The URL of the network to which all instances in the instance group belong. 390 "fingerprint": "A String", # [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. 391 "subnetwork": "A String", # The URL of the subnetwork to which all instances in the instance group belong. 392 "namedPorts": [ # Assigns a name to a port number. For example: {name: "http", port: 80} 393 # 394 # This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "http", port: 80},{name: "http", port: 8080}] 395 # 396 # Named ports apply to all instances in this instance group. 397 { # The named port. For example: . 398 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. 399 "port": 42, # The port number, which can be a value between 1 and 65535. 400 }, 401 ], 402 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance group in RFC3339 text format. 403 "id": "A String", # [Output Only] A unique identifier for this instance group, generated by the server. 404 "selfLink": "A String", # [Output Only] The URL for this instance group. The server generates this URL. 405 "name": "A String", # The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. 406 } 407 408 409 Returns: 410 An object of the form: 411 412 { # An Operation resource, used to manage asynchronous API requests. 413 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 414 "clientOperationId": "A String", # [Output Only] Reserved for future use. 415 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 416 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 417 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 418 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 419 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 420 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 421 "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. 422 "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. 423 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 424 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 425 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 426 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 427 { 428 "message": "A String", # [Output Only] A human-readable description of the warning code. 429 "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. 430 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 431 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 432 { 433 "value": "A String", # [Output Only] A warning data value corresponding to the key. 434 "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). 435 }, 436 ], 437 }, 438 ], 439 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] 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. 443 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 444 "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. 455 "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. 456 }</pre> 457 </div> 458 459 <div class="method"> 460 <code class="details" id="list">list(project, zone, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 461 <pre>Retrieves the list of instance groups that are located in the specified project and zone. 462 463 Args: 464 project: string, Project ID for this request. (required) 465 zone: string, The name of the zone where the instance group is located. (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 468 You 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 470 Currently, only sorting by name or creationTimestamp desc is supported. 471 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) 472 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. 473 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. 474 475 The 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. 476 477 For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. 478 479 You 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. 480 481 To 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. 482 483 Returns: 484 An object of the form: 485 486 { # A list of InstanceGroup resources. 487 "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. 488 "items": [ # A list of instance groups. 489 { 490 "size": 42, # [Output Only] The total number of instances in the instance group. 491 "kind": "compute#instanceGroup", # [Output Only] The resource type, which is always compute#instanceGroup for instance groups. 492 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 493 "zone": "A String", # [Output Only] The URL of the zone where the instance group is located (for zonal resources). 494 "region": "A String", # The URL of the region where the instance group is located (for regional resources). 495 "network": "A String", # The URL of the network to which all instances in the instance group belong. 496 "fingerprint": "A String", # [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. 497 "subnetwork": "A String", # The URL of the subnetwork to which all instances in the instance group belong. 498 "namedPorts": [ # Assigns a name to a port number. For example: {name: "http", port: 80} 499 # 500 # This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "http", port: 80},{name: "http", port: 8080}] 501 # 502 # Named ports apply to all instances in this instance group. 503 { # The named port. For example: . 504 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. 505 "port": 42, # The port number, which can be a value between 1 and 65535. 506 }, 507 ], 508 "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance group in RFC3339 text format. 509 "id": "A String", # [Output Only] A unique identifier for this instance group, generated by the server. 510 "selfLink": "A String", # [Output Only] The URL for this instance group. The server generates this URL. 511 "name": "A String", # The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. 512 }, 513 ], 514 "kind": "compute#instanceGroupList", # [Output Only] The resource type, which is always compute#instanceGroupList for instance group lists. 515 "id": "A String", # [Output Only] A unique identifier for this list of instance groups. The server generates this identifier. 516 "selfLink": "A String", # [Output Only] The URL for this resource type. The server generates this URL. 517 }</pre> 518 </div> 519 520 <div class="method"> 521 <code class="details" id="listInstances">listInstances(project, zone, instanceGroup, body, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 522 <pre>Lists the instances in the specified instance group. 523 524 Args: 525 project: string, Project ID for this request. (required) 526 zone: string, The name of the zone where the instance group is located. (required) 527 instanceGroup: string, The name of the instance group from which you want to generate a list of included instances. (required) 528 body: object, The request body. (required) 529 The object takes the form of: 530 531 { 532 "instanceState": "A String", # A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state. 533 } 534 535 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 536 537 You 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. 538 539 Currently, only sorting by name or creationTimestamp desc is supported. 540 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) 541 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. 542 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. 543 544 The 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. 545 546 For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. 547 548 You 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. 549 550 To 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. 551 552 Returns: 553 An object of the form: 554 555 { 556 "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. 557 "items": [ # [Output Only] A list of instances and any named ports that are assigned to those instances. 558 { 559 "status": "A String", # [Output Only] The status of the instance. 560 "instance": "A String", # [Output Only] The URL of the instance. 561 "namedPorts": [ # [Output Only] The named ports that belong to this instance group. 562 { # The named port. For example: . 563 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. 564 "port": 42, # The port number, which can be a value between 1 and 65535. 565 }, 566 ], 567 }, 568 ], 569 "kind": "compute#instanceGroupsListInstances", # [Output Only] The resource type, which is always compute#instanceGroupsListInstances for the list of instances in the specified instance group. 570 "id": "A String", # [Output Only] A unique identifier for this list of instances in the specified instance group. The server generates this identifier. 571 "selfLink": "A String", # [Output Only] The URL for this list of instances in the specified instance groups. The server generates this URL. 572 }</pre> 573 </div> 574 575 <div class="method"> 576 <code class="details" id="listInstances_next">listInstances_next(previous_request, previous_response)</code> 577 <pre>Retrieves the next page of results. 578 579 Args: 580 previous_request: The request for the previous page. (required) 581 previous_response: The response from the request for the previous page. (required) 582 583 Returns: 584 A request object that you can call 'execute()' on to request the next 585 page. Returns None if there are no more items in the collection. 586 </pre> 587 </div> 588 589 <div class="method"> 590 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 591 <pre>Retrieves the next page of results. 592 593 Args: 594 previous_request: The request for the previous page. (required) 595 previous_response: The response from the request for the previous page. (required) 596 597 Returns: 598 A request object that you can call 'execute()' on to request the next 599 page. Returns None if there are no more items in the collection. 600 </pre> 601 </div> 602 603 <div class="method"> 604 <code class="details" id="removeInstances">removeInstances(project, zone, instanceGroup, body)</code> 605 <pre>Removes one or more instances from the specified instance group, but does not delete those instances. 606 607 If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. 608 609 Args: 610 project: string, Project ID for this request. (required) 611 zone: string, The name of the zone where the instance group is located. (required) 612 instanceGroup: string, The name of the instance group where the specified instances will be removed. (required) 613 body: object, The request body. (required) 614 The object takes the form of: 615 616 { 617 "instances": [ # The list of instances to remove from the instance group. 618 { 619 "instance": "A String", # The URL for a specific instance. 620 }, 621 ], 622 } 623 624 625 Returns: 626 An object of the form: 627 628 { # An Operation resource, used to manage asynchronous API requests. 629 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 630 "clientOperationId": "A String", # [Output Only] Reserved for future use. 631 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 632 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 633 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 634 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 635 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 636 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 637 "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. 638 "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. 639 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 640 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 641 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 642 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 643 { 644 "message": "A String", # [Output Only] A human-readable description of the warning code. 645 "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. 646 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 647 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 648 { 649 "value": "A String", # [Output Only] A warning data value corresponding to the key. 650 "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). 651 }, 652 ], 653 }, 654 ], 655 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 656 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 657 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 658 "name": "A String", # [Output Only] Name of the resource. 659 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 660 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 661 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 662 { 663 "message": "A String", # [Output Only] An optional, human-readable error message. 664 "code": "A String", # [Output Only] The error type identifier for this error. 665 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 666 }, 667 ], 668 }, 669 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 670 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 671 "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. 672 }</pre> 673 </div> 674 675 <div class="method"> 676 <code class="details" id="setNamedPorts">setNamedPorts(project, zone, instanceGroup, body)</code> 677 <pre>Sets the named ports for the specified instance group. 678 679 Args: 680 project: string, Project ID for this request. (required) 681 zone: string, The name of the zone where the instance group is located. (required) 682 instanceGroup: string, The name of the instance group where the named ports are updated. (required) 683 body: object, The request body. (required) 684 The object takes the form of: 685 686 { 687 "namedPorts": [ # The list of named ports to set for this instance group. 688 { # The named port. For example: . 689 "name": "A String", # The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. 690 "port": 42, # The port number, which can be a value between 1 and 65535. 691 }, 692 ], 693 "fingerprint": "A String", # The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. 694 } 695 696 697 Returns: 698 An object of the form: 699 700 { # An Operation resource, used to manage asynchronous API requests. 701 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 702 "clientOperationId": "A String", # [Output Only] Reserved for future use. 703 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 704 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 705 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 706 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 707 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 708 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 709 "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. 710 "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. 711 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 712 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 713 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 714 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 715 { 716 "message": "A String", # [Output Only] A human-readable description of the warning code. 717 "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. 718 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 719 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 720 { 721 "value": "A String", # [Output Only] A warning data value corresponding to the key. 722 "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). 723 }, 724 ], 725 }, 726 ], 727 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 728 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 729 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 730 "name": "A String", # [Output Only] Name of the resource. 731 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 732 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 733 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 734 { 735 "message": "A String", # [Output Only] An optional, human-readable error message. 736 "code": "A String", # [Output Only] The error type identifier for this error. 737 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 738 }, 739 ], 740 }, 741 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 742 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 743 "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. 744 }</pre> 745 </div> 746 747 <div class="method"> 748 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body)</code> 749 <pre>Returns permissions that a caller has on the specified resource. 750 751 Args: 752 project: string, Project ID for this request. (required) 753 zone: string, The name of the zone for this request. (required) 754 resource: string, Name of the resource for this request. (required) 755 body: object, The request body. (required) 756 The object takes the form of: 757 758 { 759 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. 760 "A String", 761 ], 762 } 763 764 765 Returns: 766 An object of the form: 767 768 { 769 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed. 770 "A String", 771 ], 772 }</pre> 773 </div> 774 775 </body></html>