blob: 5a0c95f9a7ae0a95f9a7565b2ef50ad6adee4cca [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.images.html">images</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070078 <code><a href="#delete">delete(project, image, requestId=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080079<p class="firstline">Deletes the specified image.</p>
John Asmuth614db982014-04-24 15:46:26 -040080<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#deprecate">deprecate(project, image, body=None, requestId=None)</a></code></p>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +000082<p class="firstline">Sets the deprecation status of an image.</p>
John Asmuth614db982014-04-24 15:46:26 -040083<p class="toc_element">
84 <code><a href="#get">get(project, image)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070085<p class="firstline">Returns the specified image. Gets a list of available images by making a list() request.</p>
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -070086<p class="toc_element">
87 <code><a href="#getFromFamily">getFromFamily(project, family)</a></code></p>
88<p class="firstline">Returns the latest image that is part of an image family and is not deprecated.</p>
John Asmuth614db982014-04-24 15:46:26 -040089<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070090 <code><a href="#getIamPolicy">getIamPolicy(project, resource)</a></code></p>
91<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p>
92<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#insert">insert(project, body=None, requestId=None, forceCreate=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080094<p class="firstline">Creates an image in the specified project using the data included in the request.</p>
John Asmuth614db982014-04-24 15:46:26 -040095<p class="toc_element">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -070096 <code><a href="#list">list(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097<p class="firstline">Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.</p>
John Asmuth614db982014-04-24 15:46:26 -040098<p class="toc_element">
99 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
100<p class="firstline">Retrieves the next page of results.</p>
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400101<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700102 <code><a href="#setIamPolicy">setIamPolicy(project, resource, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700103<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p>
104<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 <code><a href="#setLabels">setLabels(project, resource, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106<p class="firstline">Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.</p>
107<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 <code><a href="#testIamPermissions">testIamPermissions(project, resource, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
John Asmuth614db982014-04-24 15:46:26 -0400110<h3>Method Details</h3>
111<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112 <code class="details" id="delete">delete(project, image, requestId=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800113 <pre>Deletes the specified image.
John Asmuth614db982014-04-24 15:46:26 -0400114
115Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000116 project: string, Project ID for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400117 image: string, Name of the image resource to delete. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
119
120For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
121
122The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
John Asmuth614db982014-04-24 15:46:26 -0400123
124Returns:
125 An object of the form:
126
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700127 { # Represents an Operation resource.
128 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700129 # Google Compute Engine has three Operation resources:
130 #
131 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
132 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700133 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
134 #
135 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700136 # - For global operations, use the `globalOperations` resource.
137 # - For regional operations, use the `regionOperations` resource.
138 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700139 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700140 # 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 -0800141 "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 -0700142 "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 -0400143 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700144 "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 -0700145 "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 -0800146 "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 -0700147 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
148 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800149 "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 -0700150 "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 -0800151 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700152 "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 -0800153 "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 +0000154 "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 -0400155 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800156 "message": "A String", # [Output Only] A human-readable description of the warning code.
157 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
158 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
159 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400160 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000161 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700162 "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 -0400163 },
164 ],
165 },
166 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700167 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800168 "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 -0700169 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
170 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700171 "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 +0000172 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800173 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400174 {
Craig Citroe633be12015-03-02 13:40:36 -0800175 "message": "A String", # [Output Only] An optional, human-readable error message.
176 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700177 "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 -0400178 },
179 ],
180 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800181 "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 -0700182 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800183 "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 -0400184 }</pre>
185</div>
186
187<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700188 <code class="details" id="deprecate">deprecate(project, image, body=None, requestId=None)</code>
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000189 <pre>Sets the deprecation status of an image.
190
191If an empty request body is given, clears the deprecation status instead.
John Asmuth614db982014-04-24 15:46:26 -0400192
193Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000194 project: string, Project ID for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400195 image: string, Image name. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700196 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400197 The object takes the form of:
198
199{ # Deprecation status for a public resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800200 "deleted": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it.
201 "deprecated": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700202 "state": "A String", # The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800203 "obsolete": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000204 "replacement": "A String", # The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource.
John Asmuth614db982014-04-24 15:46:26 -0400205}
206
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700207 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
208
209For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
210
211The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
John Asmuth614db982014-04-24 15:46:26 -0400212
213Returns:
214 An object of the form:
215
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700216 { # Represents an Operation resource.
217 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700218 # Google Compute Engine has three Operation resources:
219 #
220 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
221 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700222 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
223 #
224 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700225 # - For global operations, use the `globalOperations` resource.
226 # - For regional operations, use the `regionOperations` resource.
227 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700228 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700229 # 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 -0800230 "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 -0700231 "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 -0400232 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700233 "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 -0700234 "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 -0800235 "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 -0700236 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
237 "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 -0800238 "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 -0700239 "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 -0800240 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700241 "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 -0800242 "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 +0000243 "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 -0400244 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800245 "message": "A String", # [Output Only] A human-readable description of the warning code.
246 "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.
247 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
248 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400249 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000250 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700251 "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 -0400252 },
253 ],
254 },
255 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700256 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800257 "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 -0700258 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
259 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700260 "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 +0000261 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800262 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400263 {
Craig Citroe633be12015-03-02 13:40:36 -0800264 "message": "A String", # [Output Only] An optional, human-readable error message.
265 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700266 "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 -0400267 },
268 ],
269 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800270 "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 -0700271 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800272 "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 -0400273 }</pre>
274</div>
275
276<div class="method">
277 <code class="details" id="get">get(project, image)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700278 <pre>Returns the specified image. Gets a list of available images by making a list() request.
John Asmuth614db982014-04-24 15:46:26 -0400279
280Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000281 project: string, Project ID for this request. (required)
John Asmuth614db982014-04-24 15:46:26 -0400282 image: string, Name of the image resource to return. (required)
283
284Returns:
285 An object of the form:
286
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700287 { # Represents an Image resource.
288 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700289 # You can use images to create boot disks for your VM instances. For more information, read Images. (== resource_for {$api_version}.images ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700290 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
291 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700292 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700293 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
294 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
295 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700296 "sourceDiskEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key.
297 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700298 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700299 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700300 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700301 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700302 "family": "A String", # The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400303 "labels": { # Labels to apply to this image. These can be later modified by the setLabels method.
304 "a_key": "A String",
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700305 },
306 "archiveSizeBytes": "A String", # Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700307 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800308 { # Guest OS features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700309 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800310 },
311 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700312 "licenses": [ # Any applicable license URI.
313 "A String",
314 ],
315 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
316 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
317 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this image.
318 "A String",
319 ],
320 "sourceDisk": "A String", # URL of the source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source property but not both to create an image. For example, the following are valid values:
321 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
322 # - projects/project/zones/zone/disks/disk
323 # - zones/zone/disks/disk
Dan O'Mearadd494642020-05-01 07:42:23 -0700324 "storageLocations": [ # Cloud Storage bucket storage location of the image (regional or multi-regional).
325 "A String",
326 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700327 "imageEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the image using a customer-supplied encryption key.
328 #
329 # After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image).
330 #
331 # Customer-supplied encryption keys do not protect access to metadata of the disk.
332 #
333 # If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later.
334 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700335 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700336 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700337 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700338 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700339 "status": "A String", # [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY.
340 "sourceSnapshot": "A String", # URL of the source snapshot used to create this image. This can be a full or valid partial URL. You must provide exactly one of:
341 # - this property, or
342 # - the sourceImage property, or
343 # - the rawDisk.source property, or
344 # - the sourceDisk property in order to create an image.
Dan O'Mearadd494642020-05-01 07:42:23 -0700345 "shieldedInstanceInitialState": { # Initial State for shielded instance, these are public keys which are safe to store in public # Set the secure boot keys of shielded instance.
346 "dbxs": [ # The forbidden key database (dbx).
347 {
348 "content": "A String", # The raw content in the secure keys file.
349 "fileType": "A String",
350 },
351 ],
352 "dbs": [ # The Key Database (db).
353 {
354 "content": "A String", # The raw content in the secure keys file.
355 "fileType": "A String",
356 },
357 ],
358 "keks": [ # The Key Exchange Key (KEK).
359 {
360 "content": "A String", # The raw content in the secure keys file.
361 "fileType": "A String",
362 },
363 ],
364 "pk": { # The Platform Key (PK).
365 "content": "A String", # The raw content in the secure keys file.
366 "fileType": "A String",
367 },
368 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700369 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400370 "rawDisk": { # The parameters of the raw disk image.
371 "containerType": "A String", # The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.
372 "source": "A String", # The full Google Cloud Storage URL where the disk image is stored. You must provide either this property or the sourceDisk property but not both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700373 "sha1Checksum": "A String", # [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400374 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700375 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet.
376 #
377 # To see the latest fingerprint, make a get() request to retrieve an image.
378 "sourceDiskId": "A String", # [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name.
379 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name.
380 "sourceImage": "A String", # URL of the source image used to create this image. This can be a full or valid partial URL. You must provide exactly one of:
381 # - this property, or
382 # - the rawDisk.source property, or
383 # - the sourceDisk property in order to create an image.
384 "sourceSnapshotId": "A String", # [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700385 "sourceType": "RAW", # The type of the image used to create this disk. The default and only value is RAW
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700386 "kind": "compute#image", # [Output Only] Type of the resource. Always compute#image for images.
387 "name": "A String", # Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
388 "deprecated": { # Deprecation status for a public resource. # The deprecation status associated with this image.
389 "deleted": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it.
390 "deprecated": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it.
391 "state": "A String", # The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error.
392 "obsolete": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it.
393 "replacement": "A String", # The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource.
394 },
395 "diskSizeGb": "A String", # Size of the image when restored onto a persistent disk (in GB).
396 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
397 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700398 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700399 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
400 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
401 },
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700402 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700403 }</pre>
404</div>
405
406<div class="method">
407 <code class="details" id="getFromFamily">getFromFamily(project, family)</code>
408 <pre>Returns the latest image that is part of an image family and is not deprecated.
409
410Args:
411 project: string, Project ID for this request. (required)
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700412 family: string, Name of the image family to search for. (required)
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700413
414Returns:
415 An object of the form:
416
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700417 { # Represents an Image resource.
418 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700419 # You can use images to create boot disks for your VM instances. For more information, read Images. (== resource_for {$api_version}.images ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700420 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
421 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700422 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700423 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
424 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
425 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700426 "sourceDiskEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key.
427 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700428 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700429 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700430 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700431 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700432 "family": "A String", # The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400433 "labels": { # Labels to apply to this image. These can be later modified by the setLabels method.
434 "a_key": "A String",
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700435 },
John Asmuth614db982014-04-24 15:46:26 -0400436 "archiveSizeBytes": "A String", # Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700437 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800438 { # Guest OS features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700439 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800440 },
441 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700442 "licenses": [ # Any applicable license URI.
443 "A String",
444 ],
445 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
446 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
447 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this image.
448 "A String",
449 ],
450 "sourceDisk": "A String", # URL of the source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source property but not both to create an image. For example, the following are valid values:
451 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
452 # - projects/project/zones/zone/disks/disk
453 # - zones/zone/disks/disk
Dan O'Mearadd494642020-05-01 07:42:23 -0700454 "storageLocations": [ # Cloud Storage bucket storage location of the image (regional or multi-regional).
455 "A String",
456 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700457 "imageEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the image using a customer-supplied encryption key.
458 #
459 # After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image).
460 #
461 # Customer-supplied encryption keys do not protect access to metadata of the disk.
462 #
463 # If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later.
464 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700465 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700466 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700467 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700468 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700469 "status": "A String", # [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY.
470 "sourceSnapshot": "A String", # URL of the source snapshot used to create this image. This can be a full or valid partial URL. You must provide exactly one of:
471 # - this property, or
472 # - the sourceImage property, or
473 # - the rawDisk.source property, or
474 # - the sourceDisk property in order to create an image.
Dan O'Mearadd494642020-05-01 07:42:23 -0700475 "shieldedInstanceInitialState": { # Initial State for shielded instance, these are public keys which are safe to store in public # Set the secure boot keys of shielded instance.
476 "dbxs": [ # The forbidden key database (dbx).
477 {
478 "content": "A String", # The raw content in the secure keys file.
479 "fileType": "A String",
480 },
481 ],
482 "dbs": [ # The Key Database (db).
483 {
484 "content": "A String", # The raw content in the secure keys file.
485 "fileType": "A String",
486 },
487 ],
488 "keks": [ # The Key Exchange Key (KEK).
489 {
490 "content": "A String", # The raw content in the secure keys file.
491 "fileType": "A String",
492 },
493 ],
494 "pk": { # The Platform Key (PK).
495 "content": "A String", # The raw content in the secure keys file.
496 "fileType": "A String",
497 },
498 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700499 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400500 "rawDisk": { # The parameters of the raw disk image.
501 "containerType": "A String", # The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.
502 "source": "A String", # The full Google Cloud Storage URL where the disk image is stored. You must provide either this property or the sourceDisk property but not both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700503 "sha1Checksum": "A String", # [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400504 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700505 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet.
506 #
507 # To see the latest fingerprint, make a get() request to retrieve an image.
508 "sourceDiskId": "A String", # [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name.
509 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name.
510 "sourceImage": "A String", # URL of the source image used to create this image. This can be a full or valid partial URL. You must provide exactly one of:
511 # - this property, or
512 # - the rawDisk.source property, or
513 # - the sourceDisk property in order to create an image.
514 "sourceSnapshotId": "A String", # [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000515 "sourceType": "RAW", # The type of the image used to create this disk. The default and only value is RAW
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700516 "kind": "compute#image", # [Output Only] Type of the resource. Always compute#image for images.
517 "name": "A String", # Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
518 "deprecated": { # Deprecation status for a public resource. # The deprecation status associated with this image.
519 "deleted": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it.
520 "deprecated": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it.
521 "state": "A String", # The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error.
522 "obsolete": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it.
523 "replacement": "A String", # The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource.
524 },
525 "diskSizeGb": "A String", # Size of the image when restored onto a persistent disk (in GB).
526 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
527 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700528 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700529 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
530 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
531 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700532 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
John Asmuth614db982014-04-24 15:46:26 -0400533 }</pre>
534</div>
535
536<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700537 <code class="details" id="getIamPolicy">getIamPolicy(project, resource)</code>
538 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
539
540Args:
541 project: string, Project ID for this request. (required)
542 resource: string, Name or id of the resource for this request. (required)
543
544Returns:
545 An object of the form:
546
Dan O'Mearadd494642020-05-01 07:42:23 -0700547 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700548 #
549 #
550 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700551 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700552 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700553 # Optionally, a `binding` can specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700554 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700555 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700556 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700557 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700558 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700559 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700560 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700561 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700562 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700563 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700564 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
565 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.
566 #
567 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted.
568 #
569 # Example Policy with multiple AuditConfigs:
570 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700571 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700572 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700573 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700574 "exemptedMembers": [
575 "A String",
576 ],
577 "auditLogConfigs": [ # The configuration for logging of each type of permission.
578 { # Provides the configuration for logging a type of permissions. Example:
579 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700580 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700581 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700582 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700583 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
584 "A String",
585 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700586 "ignoreChildExemptions": True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700587 "logType": "A String", # The log type that this config enables.
588 },
589 ],
590 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
591 },
592 ],
593 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
594 { # A rule to be applied in a Policy.
595 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
596 { # Specifies what kind of log the caller must write
597 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
598 #
599 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
600 #
601 # Field names correspond to IAM request parameters and field values are their respective values.
602 #
603 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
604 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700605 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700606 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -0700607 "customFields": [ # Custom fields.
608 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
609 "name": "A String", # Name is the field name.
610 "value": "A String", # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
611 },
612 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700613 "metric": "A String", # The metric to update.
614 },
615 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -0700616 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700617 },
618 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
619 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
620 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
621 "permissionType": "A String", # The type of the permission that was checked.
622 },
623 },
624 },
625 ],
626 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
627 "A String",
628 ],
629 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
630 "A String",
631 ],
632 "action": "A String", # Required
633 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
634 "A String",
635 ],
636 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
637 { # A condition to be met.
638 "iam": "A String", # Trusted attributes supplied by the IAM system.
639 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
640 "values": [ # The objects of the condition.
641 "A String",
642 ],
643 "svc": "A String", # Trusted attributes discharged by the service.
644 "op": "A String", # An operator to apply the subject with.
645 },
646 ],
647 "description": "A String", # Human-readable description of the rule.
648 },
649 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700650 "version": 42, # Specifies the format of the policy.
651 #
652 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
653 #
654 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
655 #
656 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
657 #
658 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
659 #
660 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700661 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
662 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700663 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
664 "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700665 { # Associates `members` with a `role`.
666 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
667 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
668 #
669 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
670 #
671 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
672 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700673 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700674 #
675 #
676 #
677 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
678 #
679 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
680 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700681 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
682 #
683 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
684 #
685 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
686 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700687 #
688 #
689 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
690 "A String",
691 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700692 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700693 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700694 # Example (Comparison):
695 #
696 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
697 #
698 # Example (Equality):
699 #
700 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
701 #
702 # Example (Logic):
703 #
704 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
705 #
706 # Example (Data Manipulation):
707 #
708 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
709 #
710 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
711 "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700712 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -0700713 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
714 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700715 },
716 },
717 ],
718 "iamOwned": True or False,
719 }</pre>
720</div>
721
722<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700723 <code class="details" id="insert">insert(project, body=None, requestId=None, forceCreate=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800724 <pre>Creates an image in the specified project using the data included in the request.
John Asmuth614db982014-04-24 15:46:26 -0400725
726Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000727 project: string, Project ID for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700728 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400729 The object takes the form of:
730
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700731{ # Represents an Image resource.
732 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700733 # You can use images to create boot disks for your VM instances. For more information, read Images. (== resource_for {$api_version}.images ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700734 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
735 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700736 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700737 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
738 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
739 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700740 "sourceDiskEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key.
741 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700742 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700743 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700744 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700745 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700746 "family": "A String", # The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400747 "labels": { # Labels to apply to this image. These can be later modified by the setLabels method.
748 "a_key": "A String",
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700749 },
John Asmuth614db982014-04-24 15:46:26 -0400750 "archiveSizeBytes": "A String", # Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700751 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800752 { # Guest OS features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700753 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800754 },
755 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700756 "licenses": [ # Any applicable license URI.
757 "A String",
758 ],
759 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
760 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
761 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this image.
762 "A String",
763 ],
764 "sourceDisk": "A String", # URL of the source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source property but not both to create an image. For example, the following are valid values:
765 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
766 # - projects/project/zones/zone/disks/disk
767 # - zones/zone/disks/disk
Dan O'Mearadd494642020-05-01 07:42:23 -0700768 "storageLocations": [ # Cloud Storage bucket storage location of the image (regional or multi-regional).
769 "A String",
770 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700771 "imageEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the image using a customer-supplied encryption key.
772 #
773 # After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image).
774 #
775 # Customer-supplied encryption keys do not protect access to metadata of the disk.
776 #
777 # If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later.
778 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700779 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700780 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700781 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700782 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700783 "status": "A String", # [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY.
784 "sourceSnapshot": "A String", # URL of the source snapshot used to create this image. This can be a full or valid partial URL. You must provide exactly one of:
785 # - this property, or
786 # - the sourceImage property, or
787 # - the rawDisk.source property, or
788 # - the sourceDisk property in order to create an image.
Dan O'Mearadd494642020-05-01 07:42:23 -0700789 "shieldedInstanceInitialState": { # Initial State for shielded instance, these are public keys which are safe to store in public # Set the secure boot keys of shielded instance.
790 "dbxs": [ # The forbidden key database (dbx).
791 {
792 "content": "A String", # The raw content in the secure keys file.
793 "fileType": "A String",
794 },
795 ],
796 "dbs": [ # The Key Database (db).
797 {
798 "content": "A String", # The raw content in the secure keys file.
799 "fileType": "A String",
800 },
801 ],
802 "keks": [ # The Key Exchange Key (KEK).
803 {
804 "content": "A String", # The raw content in the secure keys file.
805 "fileType": "A String",
806 },
807 ],
808 "pk": { # The Platform Key (PK).
809 "content": "A String", # The raw content in the secure keys file.
810 "fileType": "A String",
811 },
812 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700813 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400814 "rawDisk": { # The parameters of the raw disk image.
815 "containerType": "A String", # The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.
816 "source": "A String", # The full Google Cloud Storage URL where the disk image is stored. You must provide either this property or the sourceDisk property but not both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700817 "sha1Checksum": "A String", # [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400818 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700819 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet.
820 #
821 # To see the latest fingerprint, make a get() request to retrieve an image.
822 "sourceDiskId": "A String", # [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name.
823 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name.
824 "sourceImage": "A String", # URL of the source image used to create this image. This can be a full or valid partial URL. You must provide exactly one of:
825 # - this property, or
826 # - the rawDisk.source property, or
827 # - the sourceDisk property in order to create an image.
828 "sourceSnapshotId": "A String", # [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000829 "sourceType": "RAW", # The type of the image used to create this disk. The default and only value is RAW
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700830 "kind": "compute#image", # [Output Only] Type of the resource. Always compute#image for images.
831 "name": "A String", # Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
832 "deprecated": { # Deprecation status for a public resource. # The deprecation status associated with this image.
833 "deleted": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it.
834 "deprecated": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it.
835 "state": "A String", # The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error.
836 "obsolete": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it.
837 "replacement": "A String", # The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource.
838 },
839 "diskSizeGb": "A String", # Size of the image when restored onto a persistent disk (in GB).
840 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
841 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700842 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700843 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
844 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
845 },
Takashi Matsuo06694102015-09-11 13:55:40 -0700846 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
John Asmuth614db982014-04-24 15:46:26 -0400847 }
848
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700849 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
850
851For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
852
853The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
854 forceCreate: boolean, Force image creation if true.
John Asmuth614db982014-04-24 15:46:26 -0400855
856Returns:
857 An object of the form:
858
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700859 { # Represents an Operation resource.
860 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700861 # Google Compute Engine has three Operation resources:
862 #
863 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
864 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700865 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
866 #
867 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700868 # - For global operations, use the `globalOperations` resource.
869 # - For regional operations, use the `regionOperations` resource.
870 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700871 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700872 # 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 -0800873 "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 -0700874 "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 -0400875 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700876 "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 -0700877 "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 -0800878 "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 -0700879 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
880 "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 -0800881 "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 -0700882 "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 -0800883 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700884 "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 -0800885 "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 +0000886 "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 -0400887 {
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800888 "message": "A String", # [Output Only] A human-readable description of the warning code.
889 "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.
890 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
891 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
John Asmuth614db982014-04-24 15:46:26 -0400892 {
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000893 "value": "A String", # [Output Only] A warning data value corresponding to the key.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700894 "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 -0400895 },
896 ],
897 },
898 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700899 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800900 "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 -0700901 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
902 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700903 "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 +0000904 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
Craig Citroe633be12015-03-02 13:40:36 -0800905 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
John Asmuth614db982014-04-24 15:46:26 -0400906 {
Craig Citroe633be12015-03-02 13:40:36 -0800907 "message": "A String", # [Output Only] An optional, human-readable error message.
908 "code": "A String", # [Output Only] The error type identifier for this error.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700909 "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 -0400910 },
911 ],
912 },
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800913 "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 -0700914 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800915 "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 -0400916 }</pre>
917</div>
918
919<div class="method">
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700920 <code class="details" id="list">list(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700921 <pre>Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.
John Asmuth614db982014-04-24 15:46:26 -0400922
923Args:
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +0000924 project: string, Project ID for this request. (required)
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700925 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
926
Dan O'Mearadd494642020-05-01 07:42:23 -0700927You 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 -0700928
Dan O'Mearadd494642020-05-01 07:42:23 -0700929Currently, only sorting by `name` or `creationTimestamp desc` is supported.
930 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`)
931 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.
932 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 -0700933
Dan O'Mearadd494642020-05-01 07:42:23 -0700934For 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 -0700935
Dan O'Mearadd494642020-05-01 07:42:23 -0700936You 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 -0800937
Dan O'Mearadd494642020-05-01 07:42:23 -0700938To 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 -0400939
940Returns:
941 An object of the form:
942
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800943 { # Contains a list of images.
944 "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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700945 "kind": "compute#imageList", # Type of resource.
946 "items": [ # A list of Image resources.
947 { # Represents an Image resource.
948 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700949 # You can use images to create boot disks for your VM instances. For more information, read Images. (== resource_for {$api_version}.images ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700950 "sourceImageEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key.
951 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700952 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700953 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
954 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
955 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700956 "sourceDiskEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key.
957 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700958 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700959 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700960 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700961 },
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700962 "family": "A String", # The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400963 "labels": { # Labels to apply to this image. These can be later modified by the setLabels method.
964 "a_key": "A String",
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700965 },
John Asmuth614db982014-04-24 15:46:26 -0400966 "archiveSizeBytes": "A String", # Size of the image tar.gz archive stored in Google Cloud Storage (in bytes).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700967 "guestOsFeatures": [ # A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800968 { # Guest OS features.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700969 "type": "A String", # The ID of a supported feature. Read Enabling guest operating system features to see a list of available options.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800970 },
971 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700972 "licenses": [ # Any applicable license URI.
973 "A String",
974 ],
975 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
976 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
977 "licenseCodes": [ # Integer license codes indicating which licenses are attached to this image.
978 "A String",
979 ],
980 "sourceDisk": "A String", # URL of the source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source property but not both to create an image. For example, the following are valid values:
981 # - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk
982 # - projects/project/zones/zone/disks/disk
983 # - zones/zone/disks/disk
Dan O'Mearadd494642020-05-01 07:42:23 -0700984 "storageLocations": [ # Cloud Storage bucket storage location of the image (regional or multi-regional).
985 "A String",
986 ],
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700987 "imageEncryptionKey": { # Represents a customer-supplied encryption key # Encrypts the image using a customer-supplied encryption key.
988 #
989 # After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image).
990 #
991 # Customer-supplied encryption keys do not protect access to metadata of the disk.
992 #
993 # If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later.
994 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700995 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700996 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700997 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700998 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700999 "status": "A String", # [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY.
1000 "sourceSnapshot": "A String", # URL of the source snapshot used to create this image. This can be a full or valid partial URL. You must provide exactly one of:
1001 # - this property, or
1002 # - the sourceImage property, or
1003 # - the rawDisk.source property, or
1004 # - the sourceDisk property in order to create an image.
Dan O'Mearadd494642020-05-01 07:42:23 -07001005 "shieldedInstanceInitialState": { # Initial State for shielded instance, these are public keys which are safe to store in public # Set the secure boot keys of shielded instance.
1006 "dbxs": [ # The forbidden key database (dbx).
1007 {
1008 "content": "A String", # The raw content in the secure keys file.
1009 "fileType": "A String",
1010 },
1011 ],
1012 "dbs": [ # The Key Database (db).
1013 {
1014 "content": "A String", # The raw content in the secure keys file.
1015 "fileType": "A String",
1016 },
1017 ],
1018 "keks": [ # The Key Exchange Key (KEK).
1019 {
1020 "content": "A String", # The raw content in the secure keys file.
1021 "fileType": "A String",
1022 },
1023 ],
1024 "pk": { # The Platform Key (PK).
1025 "content": "A String", # The raw content in the secure keys file.
1026 "fileType": "A String",
1027 },
1028 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001029 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001030 "rawDisk": { # The parameters of the raw disk image.
1031 "containerType": "A String", # The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created.
1032 "source": "A String", # The full Google Cloud Storage URL where the disk image is stored. You must provide either this property or the sourceDisk property but not both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001033 "sha1Checksum": "A String", # [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001034 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001035 "labelFingerprint": "A String", # A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet.
1036 #
1037 # To see the latest fingerprint, make a get() request to retrieve an image.
1038 "sourceDiskId": "A String", # [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name.
1039 "sourceImageId": "A String", # [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name.
1040 "sourceImage": "A String", # URL of the source image used to create this image. This can be a full or valid partial URL. You must provide exactly one of:
1041 # - this property, or
1042 # - the rawDisk.source property, or
1043 # - the sourceDisk property in order to create an image.
1044 "sourceSnapshotId": "A String", # [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name.
Nathaniel Manista5cbe5ba2015-03-10 23:29:22 +00001045 "sourceType": "RAW", # The type of the image used to create this disk. The default and only value is RAW
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001046 "kind": "compute#image", # [Output Only] Type of the resource. Always compute#image for images.
1047 "name": "A String", # Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
1048 "deprecated": { # Deprecation status for a public resource. # The deprecation status associated with this image.
1049 "deleted": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it.
1050 "deprecated": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it.
1051 "state": "A String", # The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error.
1052 "obsolete": "A String", # An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it.
1053 "replacement": "A String", # The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource.
1054 },
1055 "diskSizeGb": "A String", # Size of the image when restored onto a persistent disk (in GB).
1056 "sourceSnapshotEncryptionKey": { # Represents a customer-supplied encryption key # The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key.
1057 "rawKey": "A String", # Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07001058 "kmsKeyServiceAccount": "A String", # The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001059 "sha256": "A String", # [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource.
1060 "kmsKeyName": "A String", # The name of the encryption key that is stored in Google Cloud KMS.
1061 },
Takashi Matsuo06694102015-09-11 13:55:40 -07001062 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
John Asmuth614db982014-04-24 15:46:26 -04001063 },
1064 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001065 "warning": { # [Output Only] Informational warning message.
1066 "message": "A String", # [Output Only] A human-readable description of the warning code.
1067 "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.
1068 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1069 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1070 {
1071 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1072 "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).
1073 },
1074 ],
1075 },
1076 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
Takashi Matsuo06694102015-09-11 13:55:40 -07001077 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
John Asmuth614db982014-04-24 15:46:26 -04001078 }</pre>
1079</div>
1080
1081<div class="method">
1082 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1083 <pre>Retrieves the next page of results.
1084
1085Args:
1086 previous_request: The request for the previous page. (required)
1087 previous_response: The response from the request for the previous page. (required)
1088
1089Returns:
1090 A request object that you can call 'execute()' on to request the next
1091 page. Returns None if there are no more items in the collection.
1092 </pre>
1093</div>
1094
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001095<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001096 <code class="details" id="setIamPolicy">setIamPolicy(project, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001097 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001098
1099Args:
1100 project: string, Project ID for this request. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001101 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001102 body: object, The request body.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001103 The object takes the form of:
1104
1105{
Dan O'Mearadd494642020-05-01 07:42:23 -07001106 "policy": { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. # REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001107 #
1108 #
1109 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001110 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001111 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001112 # Optionally, a `binding` can specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001113 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001114 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001115 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001116 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001117 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001118 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001119 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001120 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001121 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001122 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001123 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
1124 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.
1125 #
1126 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted.
1127 #
1128 # Example Policy with multiple AuditConfigs:
1129 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001130 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001131 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001132 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001133 "exemptedMembers": [
1134 "A String",
1135 ],
1136 "auditLogConfigs": [ # The configuration for logging of each type of permission.
1137 { # Provides the configuration for logging a type of permissions. Example:
1138 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001139 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001140 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001141 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001142 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1143 "A String",
1144 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001145 "ignoreChildExemptions": True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001146 "logType": "A String", # The log type that this config enables.
1147 },
1148 ],
1149 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
1150 },
1151 ],
1152 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
1153 { # A rule to be applied in a Policy.
1154 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1155 { # Specifies what kind of log the caller must write
1156 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
1157 #
1158 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
1159 #
1160 # Field names correspond to IAM request parameters and field values are their respective values.
1161 #
1162 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
1163 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001164 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001165 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -07001166 "customFields": [ # Custom fields.
1167 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1168 "name": "A String", # Name is the field name.
1169 "value": "A String", # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
1170 },
1171 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001172 "metric": "A String", # The metric to update.
1173 },
1174 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -07001175 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001176 },
1177 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
1178 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
1179 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1180 "permissionType": "A String", # The type of the permission that was checked.
1181 },
1182 },
1183 },
1184 ],
1185 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1186 "A String",
1187 ],
1188 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1189 "A String",
1190 ],
1191 "action": "A String", # Required
1192 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
1193 "A String",
1194 ],
1195 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1196 { # A condition to be met.
1197 "iam": "A String", # Trusted attributes supplied by the IAM system.
1198 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1199 "values": [ # The objects of the condition.
1200 "A String",
1201 ],
1202 "svc": "A String", # Trusted attributes discharged by the service.
1203 "op": "A String", # An operator to apply the subject with.
1204 },
1205 ],
1206 "description": "A String", # Human-readable description of the rule.
1207 },
1208 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001209 "version": 42, # Specifies the format of the policy.
1210 #
1211 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1212 #
1213 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1214 #
1215 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
1216 #
1217 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1218 #
1219 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001220 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
1221 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001222 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1223 "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001224 { # Associates `members` with a `role`.
1225 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1226 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1227 #
1228 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1229 #
1230 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1231 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001232 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001233 #
1234 #
1235 #
1236 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1237 #
1238 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1239 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001240 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
1241 #
1242 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
1243 #
1244 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
1245 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001246 #
1247 #
1248 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1249 "A String",
1250 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001251 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001252 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001253 # Example (Comparison):
1254 #
1255 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
1256 #
1257 # Example (Equality):
1258 #
1259 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
1260 #
1261 # Example (Logic):
1262 #
1263 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
1264 #
1265 # Example (Data Manipulation):
1266 #
1267 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
1268 #
1269 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1270 "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001271 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -07001272 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1273 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001274 },
1275 },
1276 ],
1277 "iamOwned": True or False,
1278 },
1279 "bindings": [ # Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings.
1280 { # Associates `members` with a `role`.
1281 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1282 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1283 #
1284 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1285 #
1286 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1287 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001288 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001289 #
1290 #
1291 #
1292 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1293 #
1294 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1295 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001296 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
1297 #
1298 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
1299 #
1300 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
1301 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001302 #
1303 #
1304 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1305 "A String",
1306 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001307 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001308 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001309 # Example (Comparison):
1310 #
1311 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
1312 #
1313 # Example (Equality):
1314 #
1315 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
1316 #
1317 # Example (Logic):
1318 #
1319 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
1320 #
1321 # Example (Data Manipulation):
1322 #
1323 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
1324 #
1325 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1326 "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001327 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -07001328 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1329 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001330 },
1331 },
1332 ],
1333 "etag": "A String", # Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag.
1334 }
1335
1336
1337Returns:
1338 An object of the form:
1339
Dan O'Mearadd494642020-05-01 07:42:23 -07001340 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001341 #
1342 #
1343 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001344 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001345 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001346 # Optionally, a `binding` can specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001347 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001348 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001349 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001350 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001351 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001352 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001353 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001354 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001355 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001356 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001357 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
1358 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.
1359 #
1360 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted.
1361 #
1362 # Example Policy with multiple AuditConfigs:
1363 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001364 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001365 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001366 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001367 "exemptedMembers": [
1368 "A String",
1369 ],
1370 "auditLogConfigs": [ # The configuration for logging of each type of permission.
1371 { # Provides the configuration for logging a type of permissions. Example:
1372 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001373 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001374 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001375 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001376 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1377 "A String",
1378 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001379 "ignoreChildExemptions": True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001380 "logType": "A String", # The log type that this config enables.
1381 },
1382 ],
1383 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
1384 },
1385 ],
1386 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
1387 { # A rule to be applied in a Policy.
1388 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1389 { # Specifies what kind of log the caller must write
1390 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
1391 #
1392 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
1393 #
1394 # Field names correspond to IAM request parameters and field values are their respective values.
1395 #
1396 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
1397 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001398 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001399 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -07001400 "customFields": [ # Custom fields.
1401 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1402 "name": "A String", # Name is the field name.
1403 "value": "A String", # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
1404 },
1405 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001406 "metric": "A String", # The metric to update.
1407 },
1408 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -07001409 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001410 },
1411 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
1412 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
1413 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1414 "permissionType": "A String", # The type of the permission that was checked.
1415 },
1416 },
1417 },
1418 ],
1419 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1420 "A String",
1421 ],
1422 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1423 "A String",
1424 ],
1425 "action": "A String", # Required
1426 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
1427 "A String",
1428 ],
1429 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1430 { # A condition to be met.
1431 "iam": "A String", # Trusted attributes supplied by the IAM system.
1432 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1433 "values": [ # The objects of the condition.
1434 "A String",
1435 ],
1436 "svc": "A String", # Trusted attributes discharged by the service.
1437 "op": "A String", # An operator to apply the subject with.
1438 },
1439 ],
1440 "description": "A String", # Human-readable description of the rule.
1441 },
1442 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001443 "version": 42, # Specifies the format of the policy.
1444 #
1445 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1446 #
1447 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1448 #
1449 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
1450 #
1451 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1452 #
1453 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001454 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
1455 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001456 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1457 "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001458 { # Associates `members` with a `role`.
1459 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1460 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1461 #
1462 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1463 #
1464 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1465 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001466 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001467 #
1468 #
1469 #
1470 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1471 #
1472 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1473 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001474 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
1475 #
1476 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
1477 #
1478 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
1479 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001480 #
1481 #
1482 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1483 "A String",
1484 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001485 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001486 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001487 # Example (Comparison):
1488 #
1489 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
1490 #
1491 # Example (Equality):
1492 #
1493 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
1494 #
1495 # Example (Logic):
1496 #
1497 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
1498 #
1499 # Example (Data Manipulation):
1500 #
1501 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
1502 #
1503 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1504 "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001505 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -07001506 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1507 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001508 },
1509 },
1510 ],
1511 "iamOwned": True or False,
1512 }</pre>
1513</div>
1514
1515<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001516 <code class="details" id="setLabels">setLabels(project, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001517 <pre>Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation.
1518
1519Args:
1520 project: string, Project ID for this request. (required)
1521 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001522 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001523 The object takes the form of:
1524
1525{
1526 "labelFingerprint": "A String", # The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint.
Dan O'Mearadd494642020-05-01 07:42:23 -07001527 "labels": { # A list of labels to apply for this resource. Each label key &amp; value must comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001528 "a_key": "A String",
1529 },
1530 }
1531
1532
1533Returns:
1534 An object of the form:
1535
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001536 { # Represents an Operation resource.
1537 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001538 # Google Compute Engine has three Operation resources:
1539 #
1540 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1541 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001542 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1543 #
1544 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -07001545 # - For global operations, use the `globalOperations` resource.
1546 # - For regional operations, use the `regionOperations` resource.
1547 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001548 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001549 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001550 "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 -07001551 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001552 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -07001553 "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 -07001554 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001555 "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 -07001556 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1557 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001558 "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 -07001559 "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.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001560 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -07001561 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001562 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
1563 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1564 {
1565 "message": "A String", # [Output Only] A human-readable description of the warning code.
1566 "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.
1567 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
1568 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
1569 {
1570 "value": "A String", # [Output Only] A warning data value corresponding to the key.
1571 "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).
1572 },
1573 ],
1574 },
1575 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001576 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001577 "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 -07001578 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1579 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001580 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -04001581 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1582 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
1583 {
1584 "message": "A String", # [Output Only] An optional, human-readable error message.
1585 "code": "A String", # [Output Only] The error type identifier for this error.
1586 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1587 },
1588 ],
1589 },
1590 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1591 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
1592 "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.
1593 }</pre>
1594</div>
1595
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001596<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001597 <code class="details" id="testIamPermissions">testIamPermissions(project, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001598 <pre>Returns permissions that a caller has on the specified resource.
1599
1600Args:
1601 project: string, Project ID for this request. (required)
1602 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001603 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001604 The object takes the form of:
1605
1606{
1607 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
1608 "A String",
1609 ],
1610 }
1611
1612
1613Returns:
1614 An object of the form:
1615
1616 {
1617 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
1618 "A String",
1619 ],
1620 }</pre>
1621</div>
1622
John Asmuth614db982014-04-24 15:46:26 -04001623</body></html>