blob: a7080a95329b27cb844fdefc045727bf509523db [file] [log] [blame]
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_alpha.html">Compute Engine API</a> . <a href="compute_alpha.projects.html">projects</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#disableXpnHost">disableXpnHost(project)</a></code></p>
79<p class="firstline">Disable this project as an XPN host project.</p>
80<p class="toc_element">
81 <code><a href="#disableXpnResource">disableXpnResource(project, body)</a></code></p>
82<p class="firstline">Disable an XPN resource associated with this host project.</p>
83<p class="toc_element">
84 <code><a href="#enableXpnHost">enableXpnHost(project)</a></code></p>
85<p class="firstline">Enable this project as an XPN host project.</p>
86<p class="toc_element">
87 <code><a href="#enableXpnResource">enableXpnResource(project, body)</a></code></p>
88<p class="firstline">Enable XPN resource (a.k.a service project or service folder in the future) for a host project, so that subnetworks in the host project can be used by instances in the service project or folder.</p>
89<p class="toc_element">
90 <code><a href="#get">get(project)</a></code></p>
91<p class="firstline">Returns the specified Project resource.</p>
92<p class="toc_element">
93 <code><a href="#getXpnHost">getXpnHost(project)</a></code></p>
94<p class="firstline">Get the XPN host project that this project links to. May be empty if no link exists.</p>
95<p class="toc_element">
96 <code><a href="#getXpnResources">getXpnResources(project)</a></code></p>
97<p class="firstline">Get XPN resources associated with this host project.</p>
98<p class="toc_element">
99 <code><a href="#listXpnHosts">listXpnHosts(project, body)</a></code></p>
100<p class="firstline">List all XPN host projects visible to the user in an organization.</p>
101<p class="toc_element">
102 <code><a href="#moveDisk">moveDisk(project, body)</a></code></p>
103<p class="firstline">Moves a persistent disk from one zone to another.</p>
104<p class="toc_element">
105 <code><a href="#moveInstance">moveInstance(project, body)</a></code></p>
106<p class="firstline">Moves an instance and its attached persistent disks from one zone to another.</p>
107<p class="toc_element">
108 <code><a href="#setCommonInstanceMetadata">setCommonInstanceMetadata(project, body)</a></code></p>
109<p class="firstline">Sets metadata common to all instances within the specified project using the data included in the request.</p>
110<p class="toc_element">
111 <code><a href="#setDefaultServiceAccount">setDefaultServiceAccount(project, body)</a></code></p>
112<p class="firstline">Sets the default service account of the project. The default service account is used when a VM instance is created with the service account email address set to "default".</p>
113<p class="toc_element">
114 <code><a href="#setUsageExportBucket">setUsageExportBucket(project, body)</a></code></p>
115<p class="firstline">Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.</p>
116<h3>Method Details</h3>
117<div class="method">
118 <code class="details" id="disableXpnHost">disableXpnHost(project)</code>
119 <pre>Disable this project as an XPN host project.
120
121Args:
122 project: string, Project ID for this request. (required)
123
124Returns:
125 An object of the form:
126
127 { # An Operation resource, used to manage asynchronous API requests.
128 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
129 "clientOperationId": "A String", # [Output Only] Reserved for future use.
130 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
131 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
132 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
133 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
134 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
135 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
136 "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.
137 "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.
138 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
139 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
140 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
141 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
142 {
143 "message": "A String", # [Output Only] A human-readable description of the warning code.
144 "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.
145 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
146 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
147 {
148 "value": "A String", # [Output Only] A warning data value corresponding to the key.
149 "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).
150 },
151 ],
152 },
153 ],
154 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
155 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
156 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
157 "name": "A String", # [Output Only] Name of the resource.
158 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
159 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
160 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
161 {
162 "message": "A String", # [Output Only] An optional, human-readable error message.
163 "code": "A String", # [Output Only] The error type identifier for this error.
164 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
165 },
166 ],
167 },
168 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
169 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
170 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
171 }</pre>
172</div>
173
174<div class="method">
175 <code class="details" id="disableXpnResource">disableXpnResource(project, body)</code>
176 <pre>Disable an XPN resource associated with this host project.
177
178Args:
179 project: string, Project ID for this request. (required)
180 body: object, The request body. (required)
181 The object takes the form of:
182
183{
184 "xpnResource": { # XpnResourceId # XPN resource ID.
185 "type": "A String", # The type of the XPN resource.
186 "id": "A String", # The ID of the XPN resource. In the case of projects, this field matches the project's name, not the canonical ID.
187 },
188 }
189
190
191Returns:
192 An object of the form:
193
194 { # An Operation resource, used to manage asynchronous API requests.
195 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
196 "clientOperationId": "A String", # [Output Only] Reserved for future use.
197 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
198 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
199 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
200 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
201 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
202 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
203 "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.
204 "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.
205 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
206 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
207 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
208 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
209 {
210 "message": "A String", # [Output Only] A human-readable description of the warning code.
211 "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.
212 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
213 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
214 {
215 "value": "A String", # [Output Only] A warning data value corresponding to the key.
216 "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).
217 },
218 ],
219 },
220 ],
221 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
222 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
223 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
224 "name": "A String", # [Output Only] Name of the resource.
225 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
226 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
227 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
228 {
229 "message": "A String", # [Output Only] An optional, human-readable error message.
230 "code": "A String", # [Output Only] The error type identifier for this error.
231 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
232 },
233 ],
234 },
235 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
236 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
237 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
238 }</pre>
239</div>
240
241<div class="method">
242 <code class="details" id="enableXpnHost">enableXpnHost(project)</code>
243 <pre>Enable this project as an XPN host project.
244
245Args:
246 project: string, Project ID for this request. (required)
247
248Returns:
249 An object of the form:
250
251 { # An Operation resource, used to manage asynchronous API requests.
252 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
253 "clientOperationId": "A String", # [Output Only] Reserved for future use.
254 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
255 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
256 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
257 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
258 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
259 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
260 "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.
261 "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.
262 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
263 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
264 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
265 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
266 {
267 "message": "A String", # [Output Only] A human-readable description of the warning code.
268 "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.
269 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
270 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
271 {
272 "value": "A String", # [Output Only] A warning data value corresponding to the key.
273 "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).
274 },
275 ],
276 },
277 ],
278 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
279 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
280 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
281 "name": "A String", # [Output Only] Name of the resource.
282 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
283 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
284 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
285 {
286 "message": "A String", # [Output Only] An optional, human-readable error message.
287 "code": "A String", # [Output Only] The error type identifier for this error.
288 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
289 },
290 ],
291 },
292 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
293 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
294 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
295 }</pre>
296</div>
297
298<div class="method">
299 <code class="details" id="enableXpnResource">enableXpnResource(project, body)</code>
300 <pre>Enable XPN resource (a.k.a service project or service folder in the future) for a host project, so that subnetworks in the host project can be used by instances in the service project or folder.
301
302Args:
303 project: string, Project ID for this request. (required)
304 body: object, The request body. (required)
305 The object takes the form of:
306
307{
308 "xpnResource": { # XpnResourceId # XPN resource ID.
309 "type": "A String", # The type of the XPN resource.
310 "id": "A String", # The ID of the XPN resource. In the case of projects, this field matches the project's name, not the canonical ID.
311 },
312 }
313
314
315Returns:
316 An object of the form:
317
318 { # An Operation resource, used to manage asynchronous API requests.
319 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
320 "clientOperationId": "A String", # [Output Only] Reserved for future use.
321 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
322 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
323 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
324 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
325 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
326 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
327 "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.
328 "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.
329 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
330 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
331 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
332 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
333 {
334 "message": "A String", # [Output Only] A human-readable description of the warning code.
335 "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.
336 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
337 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
338 {
339 "value": "A String", # [Output Only] A warning data value corresponding to the key.
340 "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).
341 },
342 ],
343 },
344 ],
345 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
346 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
347 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
348 "name": "A String", # [Output Only] Name of the resource.
349 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
350 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
351 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
352 {
353 "message": "A String", # [Output Only] An optional, human-readable error message.
354 "code": "A String", # [Output Only] The error type identifier for this error.
355 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
356 },
357 ],
358 },
359 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
360 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
361 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
362 }</pre>
363</div>
364
365<div class="method">
366 <code class="details" id="get">get(project)</code>
367 <pre>Returns the specified Project resource.
368
369Args:
370 project: string, Project ID for this request. (required)
371
372Returns:
373 An object of the form:
374
375 { # A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console.
376 "kind": "compute#project", # [Output Only] Type of the resource. Always compute#project for projects.
377 "defaultServiceAccount": "A String", # [Output Only] Default service account used by VMs running in this project.
378 "enabledFeatures": [ # Restricted features enabled for use on this project.
379 "A String",
380 ],
381 "commonInstanceMetadata": { # A metadata key/value entry. # Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information.
382 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
383 {
384 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.
385 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
386 },
387 ],
388 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
389 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
390 },
391 "quotas": [ # [Output Only] Quotas assigned to this project.
392 { # A quotas entry.
393 "usage": 3.14, # [Output Only] Current usage of this metric.
394 "metric": "A String", # [Output Only] Name of the quota metric.
395 "limit": 3.14, # [Output Only] Quota limit for this metric.
396 },
397 ],
398 "name": "A String", # The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine.
399 "usageExportLocation": { # The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. # The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored.
400 "bucketName": "A String", # The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket.
401 "reportNamePrefix": "A String", # An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions.
402 },
403 "xpnProjectStatus": "A String", # [Output Only] The role this project has in a Cross Project Network (XPN) configuration. Currently only HOST projects are differentiated.
404 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
405 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is not the project ID, and is just a unique ID used by Compute Engine to identify resources.
406 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
407 "description": "A String", # An optional textual description of the resource.
408 }</pre>
409</div>
410
411<div class="method">
412 <code class="details" id="getXpnHost">getXpnHost(project)</code>
413 <pre>Get the XPN host project that this project links to. May be empty if no link exists.
414
415Args:
416 project: string, Project ID for this request. (required)
417
418Returns:
419 An object of the form:
420
421 { # A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console.
422 "kind": "compute#project", # [Output Only] Type of the resource. Always compute#project for projects.
423 "defaultServiceAccount": "A String", # [Output Only] Default service account used by VMs running in this project.
424 "enabledFeatures": [ # Restricted features enabled for use on this project.
425 "A String",
426 ],
427 "commonInstanceMetadata": { # A metadata key/value entry. # Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information.
428 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
429 {
430 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.
431 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
432 },
433 ],
434 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
435 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
436 },
437 "quotas": [ # [Output Only] Quotas assigned to this project.
438 { # A quotas entry.
439 "usage": 3.14, # [Output Only] Current usage of this metric.
440 "metric": "A String", # [Output Only] Name of the quota metric.
441 "limit": 3.14, # [Output Only] Quota limit for this metric.
442 },
443 ],
444 "name": "A String", # The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine.
445 "usageExportLocation": { # The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. # The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored.
446 "bucketName": "A String", # The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket.
447 "reportNamePrefix": "A String", # An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions.
448 },
449 "xpnProjectStatus": "A String", # [Output Only] The role this project has in a Cross Project Network (XPN) configuration. Currently only HOST projects are differentiated.
450 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
451 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is not the project ID, and is just a unique ID used by Compute Engine to identify resources.
452 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
453 "description": "A String", # An optional textual description of the resource.
454 }</pre>
455</div>
456
457<div class="method">
458 <code class="details" id="getXpnResources">getXpnResources(project)</code>
459 <pre>Get XPN resources associated with this host project.
460
461Args:
462 project: string, Project ID for this request. (required)
463
464Returns:
465 An object of the form:
466
467 {
468 "kind": "compute#projectsGetXpnResources", # [Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of XPN resources.
469 "resources": [ # XPN resources attached to this project as their XPN host.
470 { # XpnResourceId
471 "type": "A String", # The type of the XPN resource.
472 "id": "A String", # The ID of the XPN resource. In the case of projects, this field matches the project's name, not the canonical ID.
473 },
474 ],
475 }</pre>
476</div>
477
478<div class="method">
479 <code class="details" id="listXpnHosts">listXpnHosts(project, body)</code>
480 <pre>List all XPN host projects visible to the user in an organization.
481
482Args:
483 project: string, Project ID for this request. (required)
484 body: object, The request body. (required)
485 The object takes the form of:
486
487{
488 "organization": "A String", # Optional organization ID managed by Cloud Resource Manager, for which to list XPN host projects. If not specified, the organization will be inferred from the project.
489 }
490
491
492Returns:
493 An object of the form:
494
495 {
496 "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.
497 "items": [ # [Output Only] A list of XPN host project URLs.
498 { # A Project resource. Projects can only be created in the Google Cloud Platform Console. Unless marked otherwise, values can only be modified in the console.
499 "kind": "compute#project", # [Output Only] Type of the resource. Always compute#project for projects.
500 "defaultServiceAccount": "A String", # [Output Only] Default service account used by VMs running in this project.
501 "enabledFeatures": [ # Restricted features enabled for use on this project.
502 "A String",
503 ],
504 "commonInstanceMetadata": { # A metadata key/value entry. # Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information.
505 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
506 {
507 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.
508 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
509 },
510 ],
511 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
512 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
513 },
514 "quotas": [ # [Output Only] Quotas assigned to this project.
515 { # A quotas entry.
516 "usage": 3.14, # [Output Only] Current usage of this metric.
517 "metric": "A String", # [Output Only] Name of the quota metric.
518 "limit": 3.14, # [Output Only] Quota limit for this metric.
519 },
520 ],
521 "name": "A String", # The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine.
522 "usageExportLocation": { # The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. # The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored.
523 "bucketName": "A String", # The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket.
524 "reportNamePrefix": "A String", # An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions.
525 },
526 "xpnProjectStatus": "A String", # [Output Only] The role this project has in a Cross Project Network (XPN) configuration. Currently only HOST projects are differentiated.
527 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
528 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is not the project ID, and is just a unique ID used by Compute Engine to identify resources.
529 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
530 "description": "A String", # An optional textual description of the resource.
531 },
532 ],
533 "kind": "compute#xpnHostList", # [Output Only] Type of resource. Always compute#xpnHostList for lists of XPN hosts.
534 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
535 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
536 }</pre>
537</div>
538
539<div class="method">
540 <code class="details" id="moveDisk">moveDisk(project, body)</code>
541 <pre>Moves a persistent disk from one zone to another.
542
543Args:
544 project: string, Project ID for this request. (required)
545 body: object, The request body. (required)
546 The object takes the form of:
547
548{
549 "targetDisk": "A String", # The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk:
550 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
551 # - projects/project/zones/zone/disks/disk
552 # - zones/zone/disks/disk
553 "destinationZone": "A String", # The URL of the destination zone to move the disk. This can be a full or partial URL. For example, the following are all valid URLs to a zone:
554 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone
555 # - projects/project/zones/zone
556 # - zones/zone
557 }
558
559
560Returns:
561 An object of the form:
562
563 { # An Operation resource, used to manage asynchronous API requests.
564 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
565 "clientOperationId": "A String", # [Output Only] Reserved for future use.
566 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
567 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
568 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
569 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
570 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
571 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
572 "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.
573 "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.
574 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
575 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
576 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
577 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
578 {
579 "message": "A String", # [Output Only] A human-readable description of the warning code.
580 "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.
581 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
582 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
583 {
584 "value": "A String", # [Output Only] A warning data value corresponding to the key.
585 "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).
586 },
587 ],
588 },
589 ],
590 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
591 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
592 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
593 "name": "A String", # [Output Only] Name of the resource.
594 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
595 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
596 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
597 {
598 "message": "A String", # [Output Only] An optional, human-readable error message.
599 "code": "A String", # [Output Only] The error type identifier for this error.
600 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
601 },
602 ],
603 },
604 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
605 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
606 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
607 }</pre>
608</div>
609
610<div class="method">
611 <code class="details" id="moveInstance">moveInstance(project, body)</code>
612 <pre>Moves an instance and its attached persistent disks from one zone to another.
613
614Args:
615 project: string, Project ID for this request. (required)
616 body: object, The request body. (required)
617 The object takes the form of:
618
619{
620 "targetInstance": "A String", # The URL of the target instance to move. This can be a full or partial URL. For example, the following are all valid URLs to an instance:
621 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance
622 # - projects/project/zones/zone/instances/instance
623 # - zones/zone/instances/instance
624 "destinationZone": "A String", # The URL of the destination zone to move the instance. This can be a full or partial URL. For example, the following are all valid URLs to a zone:
625 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone
626 # - projects/project/zones/zone
627 # - zones/zone
628 }
629
630
631Returns:
632 An object of the form:
633
634 { # An Operation resource, used to manage asynchronous API requests.
635 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
636 "clientOperationId": "A String", # [Output Only] Reserved for future use.
637 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
638 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
639 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
640 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
641 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
642 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
643 "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.
644 "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.
645 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
646 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
647 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
648 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
649 {
650 "message": "A String", # [Output Only] A human-readable description of the warning code.
651 "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.
652 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
653 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
654 {
655 "value": "A String", # [Output Only] A warning data value corresponding to the key.
656 "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).
657 },
658 ],
659 },
660 ],
661 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
662 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
663 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
664 "name": "A String", # [Output Only] Name of the resource.
665 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
666 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
667 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
668 {
669 "message": "A String", # [Output Only] An optional, human-readable error message.
670 "code": "A String", # [Output Only] The error type identifier for this error.
671 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
672 },
673 ],
674 },
675 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
676 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
677 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
678 }</pre>
679</div>
680
681<div class="method">
682 <code class="details" id="setCommonInstanceMetadata">setCommonInstanceMetadata(project, body)</code>
683 <pre>Sets metadata common to all instances within the specified project using the data included in the request.
684
685Args:
686 project: string, Project ID for this request. (required)
687 body: object, The request body. (required)
688 The object takes the form of:
689
690{ # A metadata key/value entry.
691 "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
692 {
693 "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.
694 "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
695 },
696 ],
697 "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
698 "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
699}
700
701
702Returns:
703 An object of the form:
704
705 { # An Operation resource, used to manage asynchronous API requests.
706 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
707 "clientOperationId": "A String", # [Output Only] Reserved for future use.
708 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
709 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
710 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
711 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
712 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
713 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
714 "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.
715 "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.
716 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
717 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
718 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
719 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
720 {
721 "message": "A String", # [Output Only] A human-readable description of the warning code.
722 "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.
723 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
724 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
725 {
726 "value": "A String", # [Output Only] A warning data value corresponding to the key.
727 "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).
728 },
729 ],
730 },
731 ],
732 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
733 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
734 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
735 "name": "A String", # [Output Only] Name of the resource.
736 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
737 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
738 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
739 {
740 "message": "A String", # [Output Only] An optional, human-readable error message.
741 "code": "A String", # [Output Only] The error type identifier for this error.
742 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
743 },
744 ],
745 },
746 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
747 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
748 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
749 }</pre>
750</div>
751
752<div class="method">
753 <code class="details" id="setDefaultServiceAccount">setDefaultServiceAccount(project, body)</code>
754 <pre>Sets the default service account of the project. The default service account is used when a VM instance is created with the service account email address set to "default".
755
756Args:
757 project: string, Project ID for this request. (required)
758 body: object, The request body. (required)
759 The object takes the form of:
760
761{
762 "email": "A String", # Email address of the service account.
763 }
764
765
766Returns:
767 An object of the form:
768
769 { # An Operation resource, used to manage asynchronous API requests.
770 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
771 "clientOperationId": "A String", # [Output Only] Reserved for future use.
772 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
773 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
774 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
775 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
776 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
777 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
778 "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.
779 "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.
780 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
781 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
782 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
783 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
784 {
785 "message": "A String", # [Output Only] A human-readable description of the warning code.
786 "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.
787 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
788 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
789 {
790 "value": "A String", # [Output Only] A warning data value corresponding to the key.
791 "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).
792 },
793 ],
794 },
795 ],
796 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
797 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
798 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
799 "name": "A String", # [Output Only] Name of the resource.
800 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
801 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
802 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
803 {
804 "message": "A String", # [Output Only] An optional, human-readable error message.
805 "code": "A String", # [Output Only] The error type identifier for this error.
806 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
807 },
808 ],
809 },
810 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
811 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
812 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
813 }</pre>
814</div>
815
816<div class="method">
817 <code class="details" id="setUsageExportBucket">setUsageExportBucket(project, body)</code>
818 <pre>Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.
819
820Args:
821 project: string, Project ID for this request. (required)
822 body: object, The request body. (required)
823 The object takes the form of:
824
825{ # The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix.
826 "bucketName": "A String", # The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket.
827 "reportNamePrefix": "A String", # An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions.
828}
829
830
831Returns:
832 An object of the form:
833
834 { # An Operation resource, used to manage asynchronous API requests.
835 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
836 "clientOperationId": "A String", # [Output Only] Reserved for future use.
837 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
838 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
839 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations.
840 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
841 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on.
842 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
843 "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.
844 "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.
845 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
846 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE.
847 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
848 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
849 {
850 "message": "A String", # [Output Only] A human-readable description of the warning code.
851 "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.
852 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
853 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
854 {
855 "value": "A String", # [Output Only] A warning data value corresponding to the key.
856 "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).
857 },
858 ],
859 },
860 ],
861 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
862 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
863 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources.
864 "name": "A String", # [Output Only] Name of the resource.
865 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations.
866 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
867 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
868 {
869 "message": "A String", # [Output Only] An optional, human-readable error message.
870 "code": "A String", # [Output Only] The error type identifier for this error.
871 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
872 },
873 ],
874 },
875 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
876 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
877 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. If creating a persistent disk snapshot, this points to the persistent disk that the snapshot was created from.
878 }</pre>
879</div>
880
881</body></html>