blob: 7caaa245d251d77763afc3f3f1fcb374e0ddb7b2 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_alpha.html">Compute Engine API</a> . <a href="compute_alpha.nodeTemplates.html">nodeTemplates</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070078 <code><a href="#aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Retrieves an aggregated list of node templates.</p>
80<p class="toc_element">
81 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
82<p class="firstline">Retrieves the next page of results.</p>
83<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070084 <code><a href="#close">close()</a></code></p>
85<p class="firstline">Close httplib2 connections.</p>
86<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087 <code><a href="#delete">delete(project, region, nodeTemplate, requestId=None)</a></code></p>
88<p class="firstline">Deletes the specified NodeTemplate resource.</p>
89<p class="toc_element">
90 <code><a href="#get">get(project, region, nodeTemplate)</a></code></p>
91<p class="firstline">Returns the specified node template. Gets a list of available node templates by making a list() request.</p>
92<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#getIamPolicy">getIamPolicy(project, region, resource, optionsRequestedPolicyVersion=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p>
95<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#insert">insert(project, region, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097<p class="firstline">Creates a NodeTemplate resource in the specified project using the data included in the request.</p>
98<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070099 <code><a href="#list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100<p class="firstline">Retrieves a list of node templates available to the specified project.</p>
101<p class="toc_element">
102 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
103<p class="firstline">Retrieves the next page of results.</p>
104<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 <code><a href="#setIamPolicy">setIamPolicy(project, region, resource, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p>
107<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 <code><a href="#testIamPermissions">testIamPermissions(project, region, 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>
110<h3>Method Details</h3>
111<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700112 <code class="details" id="aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700113 <pre>Retrieves an aggregated list of node templates.
114
115Args:
116 project: string, Project ID for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700117 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;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118
Dan O'Mearadd494642020-05-01 07:42:23 -0700119For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700120
Dan O'Mearadd494642020-05-01 07:42:23 -0700121You 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700122
Bu Sun Kim65020912020-05-20 12:08:20 -0700123To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = &quot;Intel Skylake&quot;) ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = &quot;Intel Skylake&quot;) OR (cpuPlatform = &quot;Intel Broadwell&quot;) AND (scheduling.automaticRestart = true) ```
Dan O'Mearadd494642020-05-01 07:42:23 -0700124 includeAllScopes: boolean, Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
Bu Sun Kim65020912020-05-20 12:08:20 -0700125 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`)
126 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
127
128You can also sort results in descending order based on the creation timestamp using `orderBy=&quot;creationTimestamp desc&quot;`. 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.
129
130Currently, only sorting by `name` or `creationTimestamp desc` is supported.
131 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.
132 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700133
134Returns:
135 An object of the form:
136
137 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700138 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
139 &quot;items&quot;: { # A list of NodeTemplatesScopedList resources.
140 &quot;a_key&quot;: { # [Output Only] Name of the scope containing this set of node templates.
141 &quot;nodeTemplates&quot;: [ # [Output Only] A list of node templates contained in this scope.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700142 { # Represent a sole-tenant Node Template resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700143 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700144 # You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances. (== resource_for {$api_version}.nodeTemplates ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700145 &quot;accelerators&quot;: [
146 { # A specification of the type and number of accelerator cards attached to the instance.
147 &quot;acceleratorCount&quot;: 42, # The number of the guest accelerator cards exposed to this instance.
148 &quot;acceleratorType&quot;: &quot;A String&quot;, # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700149 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700150 ],
151 &quot;cpuOvercommitType&quot;: &quot;A String&quot;, # CPU overcommit.
152 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
153 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
154 &quot;disks&quot;: [
155 {
156 &quot;diskCount&quot;: 42, # Specifies the number of such disks.
157 &quot;diskSizeGb&quot;: 42, # Specifies the size of the disk in base-2 GB.
158 &quot;diskType&quot;: &quot;A String&quot;, # Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700159 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700160 ],
161 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
162 &quot;kind&quot;: &quot;compute#nodeTemplate&quot;, # [Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
163 &quot;name&quot;: &quot;A String&quot;, # The name of the resource, provided by the client when initially creating the resource. The resource 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.
164 &quot;nodeAffinityLabels&quot;: { # Labels to use for node affinity, which will be used in instance scheduling.
165 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700166 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700167 &quot;nodeType&quot;: &quot;A String&quot;, # The node type to use for nodes group that are created from this template.
168 &quot;nodeTypeFlexibility&quot;: { # The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties.
169 #
170 # This field is mutually exclusive with the node_type property; you can only define one or the other, but not both.
171 &quot;cpus&quot;: &quot;A String&quot;,
172 &quot;localSsd&quot;: &quot;A String&quot;,
173 &quot;memory&quot;: &quot;A String&quot;,
174 },
175 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The name of the region where the node template resides, such as us-central1.
176 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
177 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
178 &quot;serverBinding&quot;: { # Sets the binding properties for the physical server. Valid values include:
179 # - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server
180 # - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible
181 #
182 # See Sole-tenant node options for more information.
183 &quot;type&quot;: &quot;A String&quot;,
184 },
185 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
186 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable explanation of the status.
187 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700188 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700189 &quot;warning&quot;: { # [Output Only] An informational warning that appears when the node templates list is empty.
190 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
191 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
192 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700193 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700194 &quot;key&quot;: &quot;A String&quot;, # [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).
195 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700196 },
197 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700198 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700199 },
200 },
201 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700202 &quot;kind&quot;: &quot;compute#nodeTemplateAggregatedList&quot;, # [Output Only] Type of resource.Always compute#nodeTemplateAggregatedList for aggregated lists of node templates.
203 &quot;nextPageToken&quot;: &quot;A String&quot;, # [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.
204 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
205 &quot;unreachables&quot;: [ # [Output Only] Unreachable resources.
206 &quot;A String&quot;,
207 ],
208 &quot;warning&quot;: { # [Output Only] Informational warning message.
209 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
210 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
211 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700212 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700213 &quot;key&quot;: &quot;A String&quot;, # [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).
214 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700215 },
216 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700217 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700218 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700219 }</pre>
220</div>
221
222<div class="method">
223 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
224 <pre>Retrieves the next page of results.
225
226Args:
227 previous_request: The request for the previous page. (required)
228 previous_response: The response from the request for the previous page. (required)
229
230Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700231 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700232 page. Returns None if there are no more items in the collection.
233 </pre>
234</div>
235
236<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700237 <code class="details" id="close">close()</code>
238 <pre>Close httplib2 connections.</pre>
239</div>
240
241<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700242 <code class="details" id="delete">delete(project, region, nodeTemplate, requestId=None)</code>
243 <pre>Deletes the specified NodeTemplate resource.
244
245Args:
246 project: string, Project ID for this request. (required)
247 region: string, The name of the region for this request. (required)
248 nodeTemplate: string, Name of the NodeTemplate resource to delete. (required)
249 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.
250
251For 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.
252
253The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
254
255Returns:
256 An object of the form:
257
258 { # Represents an Operation resource.
259 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700260 # Google Compute Engine has three Operation resources:
261 #
262 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
263 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700264 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
265 #
266 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700267 # - For global operations, use the `globalOperations` resource.
268 # - For regional operations, use the `regionOperations` resource.
269 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700270 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700271 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700272 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
273 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
274 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
275 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
276 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
277 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700278 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700279 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
280 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
281 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700282 },
283 ],
284 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700285 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
286 &quot;httpErrorStatusCode&quot;: 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.
287 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
288 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
289 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
290 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
291 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
292 &quot;progress&quot;: 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.
293 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
294 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
295 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
296 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
297 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
298 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
299 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
300 &quot;targetLink&quot;: &quot;A String&quot;, # [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.
301 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
302 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
303 {
304 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
305 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
306 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
307 {
308 &quot;key&quot;: &quot;A String&quot;, # [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).
309 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
310 },
311 ],
312 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
313 },
314 ],
315 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700316 }</pre>
317</div>
318
319<div class="method">
320 <code class="details" id="get">get(project, region, nodeTemplate)</code>
321 <pre>Returns the specified node template. Gets a list of available node templates by making a list() request.
322
323Args:
324 project: string, Project ID for this request. (required)
325 region: string, The name of the region for this request. (required)
326 nodeTemplate: string, Name of the node template to return. (required)
327
328Returns:
329 An object of the form:
330
331 { # Represent a sole-tenant Node Template resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700332 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700333 # You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances. (== resource_for {$api_version}.nodeTemplates ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700334 &quot;accelerators&quot;: [
335 { # A specification of the type and number of accelerator cards attached to the instance.
336 &quot;acceleratorCount&quot;: 42, # The number of the guest accelerator cards exposed to this instance.
337 &quot;acceleratorType&quot;: &quot;A String&quot;, # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
338 },
339 ],
340 &quot;cpuOvercommitType&quot;: &quot;A String&quot;, # CPU overcommit.
341 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
342 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
343 &quot;disks&quot;: [
344 {
345 &quot;diskCount&quot;: 42, # Specifies the number of such disks.
346 &quot;diskSizeGb&quot;: 42, # Specifies the size of the disk in base-2 GB.
347 &quot;diskType&quot;: &quot;A String&quot;, # Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL.
348 },
349 ],
350 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
351 &quot;kind&quot;: &quot;compute#nodeTemplate&quot;, # [Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
352 &quot;name&quot;: &quot;A String&quot;, # The name of the resource, provided by the client when initially creating the resource. The resource 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.
353 &quot;nodeAffinityLabels&quot;: { # Labels to use for node affinity, which will be used in instance scheduling.
354 &quot;a_key&quot;: &quot;A String&quot;,
355 },
356 &quot;nodeType&quot;: &quot;A String&quot;, # The node type to use for nodes group that are created from this template.
357 &quot;nodeTypeFlexibility&quot;: { # The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700358 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700359 # This field is mutually exclusive with the node_type property; you can only define one or the other, but not both.
360 &quot;cpus&quot;: &quot;A String&quot;,
361 &quot;localSsd&quot;: &quot;A String&quot;,
362 &quot;memory&quot;: &quot;A String&quot;,
363 },
364 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The name of the region where the node template resides, such as us-central1.
365 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
366 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
367 &quot;serverBinding&quot;: { # Sets the binding properties for the physical server. Valid values include:
368 # - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server
369 # - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible
370 #
371 # See Sole-tenant node options for more information.
372 &quot;type&quot;: &quot;A String&quot;,
373 },
374 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
375 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable explanation of the status.
376 }</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700377</div>
378
379<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700380 <code class="details" id="getIamPolicy">getIamPolicy(project, region, resource, optionsRequestedPolicyVersion=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700381 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
382
383Args:
384 project: string, Project ID for this request. (required)
385 region: string, The name of the region for this request. (required)
386 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700387 optionsRequestedPolicyVersion: integer, Requested IAM Policy version.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700388
389Returns:
390 An object of the form:
391
Dan O'Mearadd494642020-05-01 07:42:23 -0700392 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700393 #
394 #
395 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700396 # 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 -0700397 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700398 # For some types of Google Cloud resources, a `binding` can also 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. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700399 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700400 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700401 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700402 # { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700403 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700404 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700405 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700406 # 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(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700407 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700408 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -0700409 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700410 { # 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.
411 #
412 # 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.
413 #
414 # Example Policy with multiple AuditConfigs:
415 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700416 # { &quot;audit_configs&quot;: [ { &quot;service&quot;: &quot;allServices&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; }, { &quot;log_type&quot;: &quot;ADMIN_READ&quot; } ] }, { &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot; }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot;, &quot;exempted_members&quot;: [ &quot;user:aliya@example.com&quot; ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700417 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700418 # 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 Kim65020912020-05-20 12:08:20 -0700419 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700420 { # Provides the configuration for logging a type of permissions. Example:
421 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700422 # { &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700423 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700424 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
425 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
426 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700427 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700428 &quot;ignoreChildExemptions&quot;: True or False,
429 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700430 },
431 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700432 &quot;exemptedMembers&quot;: [
433 &quot;A String&quot;,
434 ],
435 &quot;service&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700436 },
437 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700438 &quot;bindings&quot;: [ # 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 -0700439 { # Associates `members` with a `role`.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800440 &quot;bindingId&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -0700441 &quot;condition&quot;: { # 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.
442 #
443 # If the condition evaluates to `true`, then this binding applies to the current request.
444 #
445 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
446 #
447 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
448 #
449 # Example (Comparison):
450 #
451 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
452 #
453 # Example (Equality):
454 #
455 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
456 #
457 # Example (Logic):
458 #
459 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
460 #
461 # Example (Data Manipulation):
462 #
463 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
464 #
465 # 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.
466 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
467 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
468 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
469 &quot;title&quot;: &quot;A String&quot;, # 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.
470 },
471 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700472 #
473 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
474 #
475 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
476 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700477 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700478 #
479 #
480 #
481 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
482 #
483 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
484 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700485 # * `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.
486 #
487 # * `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.
488 #
489 # * `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.
490 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700491 #
492 #
493 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700494 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700495 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700496 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700497 },
498 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700499 &quot;etag&quot;: &quot;A String&quot;, # `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.
500 #
501 # **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.
502 &quot;iamOwned&quot;: True or False,
503 &quot;rules&quot;: [ # 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.
504 { # A rule to be applied in a Policy.
505 &quot;action&quot;: &quot;A String&quot;, # Required
506 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
507 { # A condition to be met.
508 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
509 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
510 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
511 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
512 &quot;values&quot;: [ # The objects of the condition.
513 &quot;A String&quot;,
514 ],
515 },
516 ],
517 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
518 &quot;ins&quot;: [ # If one or more &#x27;in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
519 &quot;A String&quot;,
520 ],
521 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
522 { # Specifies what kind of log the caller must write
523 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
524 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
525 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
526 },
527 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
528 },
529 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
530 #
531 # Metric names should start with a &#x27;/&#x27;, generally be lowercase-only, and end in &quot;_count&quot;. Field names should not contain an initial slash. The actual exported metric names will have &quot;/iam/policy&quot; prepended.
532 #
533 # Field names correspond to IAM request parameters and field values are their respective values.
534 #
535 # Supported field names: - &quot;authority&quot;, which is &quot;[token]&quot; if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - &quot;iam_principal&quot;, a representation of IAMContext.principal even if a token or authority selector is present; or - &quot;&quot; (empty string), resulting in a counter with no fields.
536 #
537 # Examples: counter { metric: &quot;/debug_access_count&quot; field: &quot;iam_principal&quot; } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
538 &quot;customFields&quot;: [ # Custom fields.
539 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
540 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
541 &quot;value&quot;: &quot;A String&quot;, # 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.
542 },
543 ],
544 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
545 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
546 },
547 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
548 &quot;logMode&quot;: &quot;A String&quot;,
549 },
550 },
551 ],
552 &quot;notIns&quot;: [ # If one or more &#x27;not_in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
553 &quot;A String&quot;,
554 ],
555 &quot;permissions&quot;: [ # A permission is a string of form &#x27;..&#x27; (e.g., &#x27;storage.buckets.list&#x27;). A value of &#x27;*&#x27; matches all permissions, and a verb part of &#x27;*&#x27; (e.g., &#x27;storage.buckets.*&#x27;) matches all verbs.
556 &quot;A String&quot;,
557 ],
558 },
559 ],
560 &quot;version&quot;: 42, # Specifies the format of the policy.
561 #
562 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
563 #
564 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
565 #
566 # * 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
567 #
568 # **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.
569 #
570 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
571 #
572 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700573 }</pre>
574</div>
575
576<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700577 <code class="details" id="insert">insert(project, region, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700578 <pre>Creates a NodeTemplate resource in the specified project using the data included in the request.
579
580Args:
581 project: string, Project ID for this request. (required)
582 region: string, The name of the region for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700583 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700584 The object takes the form of:
585
586{ # Represent a sole-tenant Node Template resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700587 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700588 # You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances. (== resource_for {$api_version}.nodeTemplates ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700589 &quot;accelerators&quot;: [
590 { # A specification of the type and number of accelerator cards attached to the instance.
591 &quot;acceleratorCount&quot;: 42, # The number of the guest accelerator cards exposed to this instance.
592 &quot;acceleratorType&quot;: &quot;A String&quot;, # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
593 },
594 ],
595 &quot;cpuOvercommitType&quot;: &quot;A String&quot;, # CPU overcommit.
596 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
597 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
598 &quot;disks&quot;: [
599 {
600 &quot;diskCount&quot;: 42, # Specifies the number of such disks.
601 &quot;diskSizeGb&quot;: 42, # Specifies the size of the disk in base-2 GB.
602 &quot;diskType&quot;: &quot;A String&quot;, # Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL.
603 },
604 ],
605 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
606 &quot;kind&quot;: &quot;compute#nodeTemplate&quot;, # [Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
607 &quot;name&quot;: &quot;A String&quot;, # The name of the resource, provided by the client when initially creating the resource. The resource 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.
608 &quot;nodeAffinityLabels&quot;: { # Labels to use for node affinity, which will be used in instance scheduling.
609 &quot;a_key&quot;: &quot;A String&quot;,
610 },
611 &quot;nodeType&quot;: &quot;A String&quot;, # The node type to use for nodes group that are created from this template.
612 &quot;nodeTypeFlexibility&quot;: { # The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700613 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700614 # This field is mutually exclusive with the node_type property; you can only define one or the other, but not both.
615 &quot;cpus&quot;: &quot;A String&quot;,
616 &quot;localSsd&quot;: &quot;A String&quot;,
617 &quot;memory&quot;: &quot;A String&quot;,
618 },
619 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The name of the region where the node template resides, such as us-central1.
620 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
621 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
622 &quot;serverBinding&quot;: { # Sets the binding properties for the physical server. Valid values include:
623 # - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server
624 # - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible
625 #
626 # See Sole-tenant node options for more information.
627 &quot;type&quot;: &quot;A String&quot;,
628 },
629 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
630 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable explanation of the status.
631}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700632
633 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.
634
635For 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.
636
637The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
638
639Returns:
640 An object of the form:
641
642 { # Represents an Operation resource.
643 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700644 # Google Compute Engine has three Operation resources:
645 #
646 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
647 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700648 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
649 #
650 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700651 # - For global operations, use the `globalOperations` resource.
652 # - For regional operations, use the `regionOperations` resource.
653 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700654 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700655 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700656 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
657 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
658 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
659 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
660 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
661 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700662 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700663 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
664 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
665 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700666 },
667 ],
668 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700669 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
670 &quot;httpErrorStatusCode&quot;: 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.
671 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
672 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
673 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
674 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
675 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
676 &quot;progress&quot;: 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.
677 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
678 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
679 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
680 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
681 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
682 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
683 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
684 &quot;targetLink&quot;: &quot;A String&quot;, # [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.
685 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
686 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
687 {
688 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
689 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
690 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
691 {
692 &quot;key&quot;: &quot;A String&quot;, # [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).
693 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
694 },
695 ],
696 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
697 },
698 ],
699 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700700 }</pre>
701</div>
702
703<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700704 <code class="details" id="list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700705 <pre>Retrieves a list of node templates available to the specified project.
706
707Args:
708 project: string, Project ID for this request. (required)
709 region: string, The name of the region for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700710 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;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700711
Dan O'Mearadd494642020-05-01 07:42:23 -0700712For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700713
Dan O'Mearadd494642020-05-01 07:42:23 -0700714You 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700715
Bu Sun Kim65020912020-05-20 12:08:20 -0700716To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = &quot;Intel Skylake&quot;) ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = &quot;Intel Skylake&quot;) OR (cpuPlatform = &quot;Intel Broadwell&quot;) AND (scheduling.automaticRestart = true) ```
717 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`)
718 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
719
720You can also sort results in descending order based on the creation timestamp using `orderBy=&quot;creationTimestamp desc&quot;`. 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.
721
722Currently, only sorting by `name` or `creationTimestamp desc` is supported.
723 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.
724 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700725
726Returns:
727 An object of the form:
728
729 { # Contains a list of node templates.
Bu Sun Kim65020912020-05-20 12:08:20 -0700730 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
731 &quot;items&quot;: [ # A list of NodeTemplate resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700732 { # Represent a sole-tenant Node Template resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700733 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700734 # You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances. (== resource_for {$api_version}.nodeTemplates ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700735 &quot;accelerators&quot;: [
736 { # A specification of the type and number of accelerator cards attached to the instance.
737 &quot;acceleratorCount&quot;: 42, # The number of the guest accelerator cards exposed to this instance.
738 &quot;acceleratorType&quot;: &quot;A String&quot;, # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700739 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700740 ],
741 &quot;cpuOvercommitType&quot;: &quot;A String&quot;, # CPU overcommit.
742 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
743 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
744 &quot;disks&quot;: [
745 {
746 &quot;diskCount&quot;: 42, # Specifies the number of such disks.
747 &quot;diskSizeGb&quot;: 42, # Specifies the size of the disk in base-2 GB.
748 &quot;diskType&quot;: &quot;A String&quot;, # Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700749 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700750 ],
751 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
752 &quot;kind&quot;: &quot;compute#nodeTemplate&quot;, # [Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
753 &quot;name&quot;: &quot;A String&quot;, # The name of the resource, provided by the client when initially creating the resource. The resource 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.
754 &quot;nodeAffinityLabels&quot;: { # Labels to use for node affinity, which will be used in instance scheduling.
755 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700756 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700757 &quot;nodeType&quot;: &quot;A String&quot;, # The node type to use for nodes group that are created from this template.
758 &quot;nodeTypeFlexibility&quot;: { # The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties.
759 #
760 # This field is mutually exclusive with the node_type property; you can only define one or the other, but not both.
761 &quot;cpus&quot;: &quot;A String&quot;,
762 &quot;localSsd&quot;: &quot;A String&quot;,
763 &quot;memory&quot;: &quot;A String&quot;,
764 },
765 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The name of the region where the node template resides, such as us-central1.
766 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
767 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
768 &quot;serverBinding&quot;: { # Sets the binding properties for the physical server. Valid values include:
769 # - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server
770 # - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible
771 #
772 # See Sole-tenant node options for more information.
773 &quot;type&quot;: &quot;A String&quot;,
774 },
775 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
776 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable explanation of the status.
777 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700778 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700779 &quot;kind&quot;: &quot;compute#nodeTemplateList&quot;, # [Output Only] Type of resource.Always compute#nodeTemplateList for lists of node templates.
780 &quot;nextPageToken&quot;: &quot;A String&quot;, # [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.
781 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
782 &quot;warning&quot;: { # [Output Only] Informational warning message.
783 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
784 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
785 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700786 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700787 &quot;key&quot;: &quot;A String&quot;, # [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).
788 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700789 },
790 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700791 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700792 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700793 }</pre>
794</div>
795
796<div class="method">
797 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
798 <pre>Retrieves the next page of results.
799
800Args:
801 previous_request: The request for the previous page. (required)
802 previous_response: The response from the request for the previous page. (required)
803
804Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700805 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700806 page. Returns None if there are no more items in the collection.
807 </pre>
808</div>
809
810<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700811 <code class="details" id="setIamPolicy">setIamPolicy(project, region, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700812 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
813
814Args:
815 project: string, Project ID for this request. (required)
816 region: string, The name of the region for this request. (required)
817 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700818 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700819 The object takes the form of:
820
821{
Bu Sun Kim65020912020-05-20 12:08:20 -0700822 &quot;bindings&quot;: [ # Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify bindings.
823 { # Associates `members` with a `role`.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800824 &quot;bindingId&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -0700825 &quot;condition&quot;: { # 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.
826 #
827 # If the condition evaluates to `true`, then this binding applies to the current request.
828 #
829 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
830 #
831 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
832 #
833 # Example (Comparison):
834 #
835 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
836 #
837 # Example (Equality):
838 #
839 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
840 #
841 # Example (Logic):
842 #
843 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
844 #
845 # Example (Data Manipulation):
846 #
847 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
848 #
849 # 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.
850 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
851 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
852 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
853 &quot;title&quot;: &quot;A String&quot;, # 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.
854 },
855 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
856 #
857 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
858 #
859 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
860 #
861 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
862 #
863 #
864 #
865 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
866 #
867 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
868 #
869 # * `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.
870 #
871 # * `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.
872 #
873 # * `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.
874 #
875 #
876 #
877 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
878 &quot;A String&quot;,
879 ],
880 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
881 },
882 ],
883 &quot;etag&quot;: &quot;A String&quot;, # Flatten Policy to create a backward compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify the etag.
884 &quot;policy&quot;: { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. # REQUIRED: The complete policy to be applied to the &#x27;resource&#x27;. 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 -0700885 #
886 #
887 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700888 # 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 -0700889 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700890 # For some types of Google Cloud resources, a `binding` can also 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. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700891 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700892 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700893 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700894 # { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700895 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700896 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700897 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700898 # 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(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700899 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700900 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -0700901 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700902 { # 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.
903 #
904 # 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.
905 #
906 # Example Policy with multiple AuditConfigs:
907 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700908 # { &quot;audit_configs&quot;: [ { &quot;service&quot;: &quot;allServices&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; }, { &quot;log_type&quot;: &quot;ADMIN_READ&quot; } ] }, { &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot; }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot;, &quot;exempted_members&quot;: [ &quot;user:aliya@example.com&quot; ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700909 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700910 # 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 Kim65020912020-05-20 12:08:20 -0700911 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700912 { # Provides the configuration for logging a type of permissions. Example:
913 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700914 # { &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700915 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700916 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
917 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
918 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700919 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700920 &quot;ignoreChildExemptions&quot;: True or False,
921 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700922 },
923 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700924 &quot;exemptedMembers&quot;: [
925 &quot;A String&quot;,
926 ],
927 &quot;service&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700928 },
929 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700930 &quot;bindings&quot;: [ # 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 -0700931 { # Associates `members` with a `role`.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800932 &quot;bindingId&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -0700933 &quot;condition&quot;: { # 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.
934 #
935 # If the condition evaluates to `true`, then this binding applies to the current request.
936 #
937 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
938 #
939 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
940 #
941 # Example (Comparison):
942 #
943 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
944 #
945 # Example (Equality):
946 #
947 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
948 #
949 # Example (Logic):
950 #
951 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
952 #
953 # Example (Data Manipulation):
954 #
955 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
956 #
957 # 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.
958 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
959 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
960 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
961 &quot;title&quot;: &quot;A String&quot;, # 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.
962 },
963 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700964 #
965 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
966 #
967 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
968 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700969 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700970 #
971 #
972 #
973 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
974 #
975 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
976 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700977 # * `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.
978 #
979 # * `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.
980 #
981 # * `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.
982 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700983 #
984 #
985 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700986 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700987 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700988 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700989 },
990 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700991 &quot;etag&quot;: &quot;A String&quot;, # `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.
992 #
993 # **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.
994 &quot;iamOwned&quot;: True or False,
995 &quot;rules&quot;: [ # 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.
996 { # A rule to be applied in a Policy.
997 &quot;action&quot;: &quot;A String&quot;, # Required
998 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
999 { # A condition to be met.
1000 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1001 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1002 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1003 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1004 &quot;values&quot;: [ # The objects of the condition.
1005 &quot;A String&quot;,
1006 ],
1007 },
1008 ],
1009 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1010 &quot;ins&quot;: [ # If one or more &#x27;in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1011 &quot;A String&quot;,
1012 ],
1013 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1014 { # Specifies what kind of log the caller must write
1015 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1016 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1017 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1018 },
1019 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1020 },
1021 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1022 #
1023 # Metric names should start with a &#x27;/&#x27;, generally be lowercase-only, and end in &quot;_count&quot;. Field names should not contain an initial slash. The actual exported metric names will have &quot;/iam/policy&quot; prepended.
1024 #
1025 # Field names correspond to IAM request parameters and field values are their respective values.
1026 #
1027 # Supported field names: - &quot;authority&quot;, which is &quot;[token]&quot; if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - &quot;iam_principal&quot;, a representation of IAMContext.principal even if a token or authority selector is present; or - &quot;&quot; (empty string), resulting in a counter with no fields.
1028 #
1029 # Examples: counter { metric: &quot;/debug_access_count&quot; field: &quot;iam_principal&quot; } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
1030 &quot;customFields&quot;: [ # Custom fields.
1031 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1032 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1033 &quot;value&quot;: &quot;A String&quot;, # 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.
1034 },
1035 ],
1036 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1037 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1038 },
1039 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1040 &quot;logMode&quot;: &quot;A String&quot;,
1041 },
1042 },
1043 ],
1044 &quot;notIns&quot;: [ # If one or more &#x27;not_in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1045 &quot;A String&quot;,
1046 ],
1047 &quot;permissions&quot;: [ # A permission is a string of form &#x27;..&#x27; (e.g., &#x27;storage.buckets.list&#x27;). A value of &#x27;*&#x27; matches all permissions, and a verb part of &#x27;*&#x27; (e.g., &#x27;storage.buckets.*&#x27;) matches all verbs.
1048 &quot;A String&quot;,
1049 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001050 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001051 ],
1052 &quot;version&quot;: 42, # Specifies the format of the policy.
1053 #
1054 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1055 #
1056 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1057 #
1058 # * 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
1059 #
1060 # **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.
1061 #
1062 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
1063 #
1064 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1065 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001066 }
1067
1068
1069Returns:
1070 An object of the form:
1071
Dan O'Mearadd494642020-05-01 07:42:23 -07001072 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001073 #
1074 #
1075 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001076 # 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 -07001077 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001078 # For some types of Google Cloud resources, a `binding` can also 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. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001079 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001080 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001081 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001082 # { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001083 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001084 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001085 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001086 # 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(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001087 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001088 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -07001089 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001090 { # 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.
1091 #
1092 # 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.
1093 #
1094 # Example Policy with multiple AuditConfigs:
1095 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001096 # { &quot;audit_configs&quot;: [ { &quot;service&quot;: &quot;allServices&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; }, { &quot;log_type&quot;: &quot;ADMIN_READ&quot; } ] }, { &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot; }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot;, &quot;exempted_members&quot;: [ &quot;user:aliya@example.com&quot; ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001097 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001098 # 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 Kim65020912020-05-20 12:08:20 -07001099 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001100 { # Provides the configuration for logging a type of permissions. Example:
1101 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001102 # { &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001103 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001104 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1105 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1106 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001107 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001108 &quot;ignoreChildExemptions&quot;: True or False,
1109 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001110 },
1111 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001112 &quot;exemptedMembers&quot;: [
1113 &quot;A String&quot;,
1114 ],
1115 &quot;service&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001116 },
1117 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001118 &quot;bindings&quot;: [ # 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 -07001119 { # Associates `members` with a `role`.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -08001120 &quot;bindingId&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -07001121 &quot;condition&quot;: { # 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.
1122 #
1123 # If the condition evaluates to `true`, then this binding applies to the current request.
1124 #
1125 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
1126 #
1127 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1128 #
1129 # Example (Comparison):
1130 #
1131 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
1132 #
1133 # Example (Equality):
1134 #
1135 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
1136 #
1137 # Example (Logic):
1138 #
1139 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1140 #
1141 # Example (Data Manipulation):
1142 #
1143 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1144 #
1145 # 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.
1146 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1147 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1148 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
1149 &quot;title&quot;: &quot;A String&quot;, # 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.
1150 },
1151 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001152 #
1153 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1154 #
1155 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1156 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001157 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001158 #
1159 #
1160 #
1161 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1162 #
1163 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1164 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001165 # * `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.
1166 #
1167 # * `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.
1168 #
1169 # * `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.
1170 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001171 #
1172 #
1173 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001174 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001175 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001176 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001177 },
1178 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001179 &quot;etag&quot;: &quot;A String&quot;, # `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.
1180 #
1181 # **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.
1182 &quot;iamOwned&quot;: True or False,
1183 &quot;rules&quot;: [ # 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.
1184 { # A rule to be applied in a Policy.
1185 &quot;action&quot;: &quot;A String&quot;, # Required
1186 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1187 { # A condition to be met.
1188 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1189 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1190 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1191 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1192 &quot;values&quot;: [ # The objects of the condition.
1193 &quot;A String&quot;,
1194 ],
1195 },
1196 ],
1197 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1198 &quot;ins&quot;: [ # If one or more &#x27;in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1199 &quot;A String&quot;,
1200 ],
1201 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1202 { # Specifies what kind of log the caller must write
1203 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1204 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1205 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1206 },
1207 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1208 },
1209 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1210 #
1211 # Metric names should start with a &#x27;/&#x27;, generally be lowercase-only, and end in &quot;_count&quot;. Field names should not contain an initial slash. The actual exported metric names will have &quot;/iam/policy&quot; prepended.
1212 #
1213 # Field names correspond to IAM request parameters and field values are their respective values.
1214 #
1215 # Supported field names: - &quot;authority&quot;, which is &quot;[token]&quot; if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - &quot;iam_principal&quot;, a representation of IAMContext.principal even if a token or authority selector is present; or - &quot;&quot; (empty string), resulting in a counter with no fields.
1216 #
1217 # Examples: counter { metric: &quot;/debug_access_count&quot; field: &quot;iam_principal&quot; } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
1218 &quot;customFields&quot;: [ # Custom fields.
1219 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1220 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1221 &quot;value&quot;: &quot;A String&quot;, # 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.
1222 },
1223 ],
1224 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1225 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1226 },
1227 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1228 &quot;logMode&quot;: &quot;A String&quot;,
1229 },
1230 },
1231 ],
1232 &quot;notIns&quot;: [ # If one or more &#x27;not_in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1233 &quot;A String&quot;,
1234 ],
1235 &quot;permissions&quot;: [ # A permission is a string of form &#x27;..&#x27; (e.g., &#x27;storage.buckets.list&#x27;). A value of &#x27;*&#x27; matches all permissions, and a verb part of &#x27;*&#x27; (e.g., &#x27;storage.buckets.*&#x27;) matches all verbs.
1236 &quot;A String&quot;,
1237 ],
1238 },
1239 ],
1240 &quot;version&quot;: 42, # Specifies the format of the policy.
1241 #
1242 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1243 #
1244 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1245 #
1246 # * 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
1247 #
1248 # **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.
1249 #
1250 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
1251 #
1252 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001253 }</pre>
1254</div>
1255
1256<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001257 <code class="details" id="testIamPermissions">testIamPermissions(project, region, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001258 <pre>Returns permissions that a caller has on the specified resource.
1259
1260Args:
1261 project: string, Project ID for this request. (required)
1262 region: string, The name of the region for this request. (required)
1263 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001264 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001265 The object takes the form of:
1266
1267{
Bu Sun Kim65020912020-05-20 12:08:20 -07001268 &quot;permissions&quot;: [ # The set of permissions to check for the &#x27;resource&#x27;. Permissions with wildcards (such as &#x27;*&#x27; or &#x27;storage.*&#x27;) are not allowed.
1269 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001270 ],
1271 }
1272
1273
1274Returns:
1275 An object of the form:
1276
1277 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001278 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
1279 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001280 ],
1281 }</pre>
1282</div>
1283
1284</body></html>