blob: 5d5ccabcbdc21610a8b787a8e0fbe55f7a4e4d25 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<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_v1.html">Compute Engine API</a> . <a href="compute_v1.globalOperations.html">globalOperations</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None, includeAllScopes=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080079<p class="firstline">Retrieves an aggregated list of all operations.</p>
John Asmuth614db982014-04-24 15:46:26 -040080<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, operation)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -070085<p class="firstline">Deletes the specified Operations resource.</p>
John Asmuth614db982014-04-24 15:46:26 -040086<p class="toc_element">
87 <code><a href="#get">get(project, operation)</a></code></p>
Dan O'Mearadd494642020-05-01 07:42:23 -070088<p class="firstline">Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request.</p>
John Asmuth614db982014-04-24 15:46:26 -040089<p class="toc_element">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -070090 <code><a href="#list">list(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080091<p class="firstline">Retrieves a list of Operation resources contained within the specified project.</p>
John Asmuth614db982014-04-24 15:46:26 -040092<p class="toc_element">
93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
Dan O'Mearadd494642020-05-01 07:42:23 -070095<p class="toc_element">
96 <code><a href="#wait">wait(project, operation)</a></code></p>
97<p class="firstline">Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress.</p>
John Asmuth614db982014-04-24 15:46:26 -040098<h3>Method Details</h3>
99<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700100 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None, includeAllScopes=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800101 <pre>Retrieves an aggregated list of all operations.
John Asmuth614db982014-04-24 15:46:26 -0400102
103Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000104 project: string, Project ID for this request. (required)
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700105 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
106
Dan O'Mearadd494642020-05-01 07:42:23 -0700107You 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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700108
Dan O'Mearadd494642020-05-01 07:42:23 -0700109Currently, only sorting by `name` or `creationTimestamp desc` is supported.
110 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`)
111 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.
112 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700113
Dan O'Mearadd494642020-05-01 07:42:23 -0700114For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700115
Dan O'Mearadd494642020-05-01 07:42:23 -0700116You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800117
Dan O'Mearadd494642020-05-01 07:42:23 -0700118To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
119 includeAllScopes: boolean, Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
John Asmuth614db982014-04-24 15:46:26 -0400120
121Returns:
122 An object of the form:
123
124 {
Dan O'Mearadd494642020-05-01 07:42:23 -0700125 "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.
126 "kind": "compute#operationAggregatedList", # [Output Only] Type of resource. Always `compute#operationAggregatedList` for aggregated lists of operations.
Craig Citroe633be12015-03-02 13:40:36 -0800127 "items": { # [Output Only] A map of scoped operation lists.
128 "a_key": { # [Output Only] Name of the scope containing this set of operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700129 "operations": [ # [Output Only] A list of operations contained in this scope.
130 { # Represents an Operation resource.
131 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700132 # Google Compute Engine has three Operation resources:
133 #
134 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
135 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700136 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
137 #
138 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700139 # - For global operations, use the `globalOperations` resource.
140 # - For regional operations, use the `regionOperations` resource.
141 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700142 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700143 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800144 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700145 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400146 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700147 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700148 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800149 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700150 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
151 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800152 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700153 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800154 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700155 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800156 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000157 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400158 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800159 "message": "A String", # [Output Only] A human-readable description of the warning code.
160 "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.
161 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
162 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400163 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000164 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700165 "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).
John Asmuth614db982014-04-24 15:46:26 -0400166 },
167 ],
168 },
169 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700170 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800171 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700172 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
173 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700174 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000175 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800176 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400177 {
Craig Citroe633be12015-03-02 13:40:36 -0800178 "message": "A String", # [Output Only] An optional, human-readable error message.
179 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700180 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400181 },
182 ],
183 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800184 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700185 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800186 "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.
John Asmuth614db982014-04-24 15:46:26 -0400187 },
188 ],
Craig Citroe633be12015-03-02 13:40:36 -0800189 "warning": { # [Output Only] Informational warning which replaces the list of operations when the list is empty.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800190 "message": "A String", # [Output Only] A human-readable description of the warning code.
191 "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.
192 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
193 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400194 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000195 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700196 "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).
John Asmuth614db982014-04-24 15:46:26 -0400197 },
198 ],
199 },
200 },
201 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700202 "warning": { # [Output Only] Informational warning message.
203 "message": "A String", # [Output Only] A human-readable description of the warning code.
204 "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.
205 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
206 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
207 {
208 "value": "A String", # [Output Only] A warning data value corresponding to the key.
209 "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).
210 },
211 ],
212 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800213 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Takashi Matsuo06694102015-09-11 13:55:40 -0700214 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400215 }</pre>
216</div>
217
218<div class="method">
219 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
220 <pre>Retrieves the next page of results.
221
222Args:
223 previous_request: The request for the previous page. (required)
224 previous_response: The response from the request for the previous page. (required)
225
226Returns:
227 A request object that you can call 'execute()' on to request the next
228 page. Returns None if there are no more items in the collection.
229 </pre>
230</div>
231
232<div class="method">
233 <code class="details" id="delete">delete(project, operation)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700234 <pre>Deletes the specified Operations resource.
John Asmuth614db982014-04-24 15:46:26 -0400235
236Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000237 project: string, Project ID for this request. (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700238 operation: string, Name of the Operations resource to delete. (required)
John Asmuth614db982014-04-24 15:46:26 -0400239</pre>
240</div>
241
242<div class="method">
243 <code class="details" id="get">get(project, operation)</code>
Dan O'Mearadd494642020-05-01 07:42:23 -0700244 <pre>Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request.
John Asmuth614db982014-04-24 15:46:26 -0400245
246Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000247 project: string, Project ID for this request. (required)
Takashi Matsuo06694102015-09-11 13:55:40 -0700248 operation: string, Name of the Operations resource to return. (required)
John Asmuth614db982014-04-24 15:46:26 -0400249
250Returns:
251 An object of the form:
252
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700253 { # Represents an Operation resource.
254 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700255 # Google Compute Engine has three Operation resources:
256 #
257 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
258 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700259 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
260 #
261 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700262 # - For global operations, use the `globalOperations` resource.
263 # - For regional operations, use the `regionOperations` resource.
264 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700265 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700266 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800267 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700268 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400269 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700270 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700271 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800272 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700273 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
274 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800275 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700276 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800277 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700278 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800279 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000280 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400281 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800282 "message": "A String", # [Output Only] A human-readable description of the warning code.
283 "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.
284 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
285 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400286 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000287 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700288 "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).
John Asmuth614db982014-04-24 15:46:26 -0400289 },
290 ],
291 },
292 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700293 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800294 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700295 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
296 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700297 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000298 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800299 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400300 {
Craig Citroe633be12015-03-02 13:40:36 -0800301 "message": "A String", # [Output Only] An optional, human-readable error message.
302 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700303 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400304 },
305 ],
306 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800307 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700308 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800309 "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.
John Asmuth614db982014-04-24 15:46:26 -0400310 }</pre>
311</div>
312
313<div class="method">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700314 <code class="details" id="list">list(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800315 <pre>Retrieves a list of Operation resources contained within the specified project.
John Asmuth614db982014-04-24 15:46:26 -0400316
317Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000318 project: string, Project ID for this request. (required)
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700319 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
320
Dan O'Mearadd494642020-05-01 07:42:23 -0700321You 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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700322
Dan O'Mearadd494642020-05-01 07:42:23 -0700323Currently, only sorting by `name` or `creationTimestamp desc` is supported.
324 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`)
325 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.
326 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700327
Dan O'Mearadd494642020-05-01 07:42:23 -0700328For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Takashi Matsuo06694102015-09-11 13:55:40 -0700329
Dan O'Mearadd494642020-05-01 07:42:23 -0700330You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800331
Dan O'Mearadd494642020-05-01 07:42:23 -0700332To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
John Asmuth614db982014-04-24 15:46:26 -0400333
334Returns:
335 An object of the form:
336
Takashi Matsuo06694102015-09-11 13:55:40 -0700337 { # Contains a list of Operation resources.
Dan O'Mearadd494642020-05-01 07:42:23 -0700338 "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.
339 "kind": "compute#operationList", # [Output Only] Type of resource. Always `compute#operations` for Operations resource.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800340 "items": [ # [Output Only] A list of Operation resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700341 { # Represents an Operation resource.
342 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700343 # Google Compute Engine has three Operation resources:
344 #
345 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
346 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700347 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
348 #
349 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700350 # - For global operations, use the `globalOperations` resource.
351 # - For regional operations, use the `regionOperations` resource.
352 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700353 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700354 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800355 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700356 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400357 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700358 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700359 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800360 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700361 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
362 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800363 "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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700364 "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.
Craig Citroe633be12015-03-02 13:40:36 -0800365 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700366 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800367 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000368 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
John Asmuth614db982014-04-24 15:46:26 -0400369 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800370 "message": "A String", # [Output Only] A human-readable description of the warning code.
371 "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.
372 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
373 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400374 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000375 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700376 "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).
John Asmuth614db982014-04-24 15:46:26 -0400377 },
378 ],
379 },
380 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700381 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800382 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700383 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
384 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700385 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000386 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800387 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400388 {
Craig Citroe633be12015-03-02 13:40:36 -0800389 "message": "A String", # [Output Only] An optional, human-readable error message.
390 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700391 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
John Asmuth614db982014-04-24 15:46:26 -0400392 },
393 ],
394 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800395 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
Takashi Matsuo06694102015-09-11 13:55:40 -0700396 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800397 "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.
John Asmuth614db982014-04-24 15:46:26 -0400398 },
399 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700400 "warning": { # [Output Only] Informational warning message.
401 "message": "A String", # [Output Only] A human-readable description of the warning code.
402 "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.
403 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
404 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
405 {
406 "value": "A String", # [Output Only] A warning data value corresponding to the key.
407 "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).
408 },
409 ],
410 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800411 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Takashi Matsuo06694102015-09-11 13:55:40 -0700412 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -0400413 }</pre>
414</div>
415
416<div class="method">
417 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
418 <pre>Retrieves the next page of results.
419
420Args:
421 previous_request: The request for the previous page. (required)
422 previous_response: The response from the request for the previous page. (required)
423
424Returns:
425 A request object that you can call 'execute()' on to request the next
426 page. Returns None if there are no more items in the collection.
427 </pre>
428</div>
429
Dan O'Mearadd494642020-05-01 07:42:23 -0700430<div class="method">
431 <code class="details" id="wait">wait(project, operation)</code>
432 <pre>Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress.
433
434This method is called on a best-effort basis. Specifically:
435- In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds.
436- If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`.
437
438Args:
439 project: string, Project ID for this request. (required)
440 operation: string, Name of the Operations resource to return. (required)
441
442Returns:
443 An object of the form:
444
445 { # Represents an Operation resource.
446 #
447 # Google Compute Engine has three Operation resources:
448 #
449 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
450 #
451 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
452 #
453 # Operations can be global, regional or zonal.
454 # - For global operations, use the `globalOperations` resource.
455 # - For regional operations, use the `regionOperations` resource.
456 # - For zonal operations, use the `zonalOperations` resource.
457 #
458 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
459 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
460 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
461 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
462 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
463 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
464 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
465 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
466 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
467 "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.
468 "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.
469 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
470 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
471 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
472 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
473 {
474 "message": "A String", # [Output Only] A human-readable description of the warning code.
475 "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.
476 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
477 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
478 {
479 "value": "A String", # [Output Only] A warning data value corresponding to the key.
480 "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).
481 },
482 ],
483 },
484 ],
485 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
486 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
487 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
488 "name": "A String", # [Output Only] Name of the operation.
489 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
490 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
491 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
492 {
493 "message": "A String", # [Output Only] An optional, human-readable error message.
494 "code": "A String", # [Output Only] The error type identifier for this error.
495 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
496 },
497 ],
498 },
499 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
500 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
501 "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.
502 }</pre>
503</div>
504
John Asmuth614db982014-04-24 15:46:26 -0400505</body></html>