blob: c12039a560e576b46bbe9b159fae64d4f3b24a97 [file] [log] [blame]
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="spanner_v1.html">Cloud Spanner API</a> . <a href="spanner_v1.projects.html">projects</a> . <a href="spanner_v1.projects.instances.html">instances</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="spanner_v1.projects.instances.backupOperations.html">backupOperations()</a></code>
79</p>
80<p class="firstline">Returns the backupOperations Resource.</p>
81
82<p class="toc_element">
83 <code><a href="spanner_v1.projects.instances.backups.html">backups()</a></code>
84</p>
85<p class="firstline">Returns the backups Resource.</p>
86
87<p class="toc_element">
88 <code><a href="spanner_v1.projects.instances.databaseOperations.html">databaseOperations()</a></code>
89</p>
90<p class="firstline">Returns the databaseOperations Resource.</p>
91
92<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040093 <code><a href="spanner_v1.projects.instances.databases.html">databases()</a></code>
94</p>
95<p class="firstline">Returns the databases Resource.</p>
96
97<p class="toc_element">
98 <code><a href="spanner_v1.projects.instances.operations.html">operations()</a></code>
99</p>
100<p class="firstline">Returns the operations Resource.</p>
101
102<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700103 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400104<p class="firstline">Creates an instance and begins preparing it to begin serving. The</p>
105<p class="toc_element">
Thomas Coffee2f245372017-03-27 10:39:26 -0700106 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400107<p class="firstline">Deletes an instance.</p>
108<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700109 <code><a href="#get">get(name, fieldMask=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400110<p class="firstline">Gets information about a particular instance.</p>
111<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112 <code><a href="#getIamPolicy">getIamPolicy(resource, body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400113<p class="firstline">Gets the access control policy for an instance resource. Returns an empty</p>
114<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700115 <code><a href="#list">list(parent, pageSize=None, pageToken=None, filter=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400116<p class="firstline">Lists all instances in the given project.</p>
117<p class="toc_element">
118 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
119<p class="firstline">Retrieves the next page of results.</p>
120<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700121 <code><a href="#patch">patch(name, body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400122<p class="firstline">Updates an instance, and begins allocating or releasing resources</p>
123<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700124 <code><a href="#setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400125<p class="firstline">Sets the access control policy on an instance resource. Replaces any</p>
126<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700127 <code><a href="#testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400128<p class="firstline">Returns permissions that the caller has on the specified instance resource.</p>
129<h3>Method Details</h3>
130<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700131 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400132 <pre>Creates an instance and begins preparing it to begin serving. The
133returned long-running operation
134can be used to track the progress of preparing the new
135instance. The instance name is assigned by the caller. If the
136named instance already exists, `CreateInstance` returns
137`ALREADY_EXISTS`.
138
139Immediately upon completion of this request:
140
141 * The instance is readable via the API, with all requested attributes
142 but no allocated resources. Its state is `CREATING`.
143
144Until completion of the returned operation:
145
146 * Cancelling the operation renders the instance immediately unreadable
147 via the API.
148 * The instance can be deleted.
149 * All other attempts to modify the instance are rejected.
150
151Upon completion of the returned operation:
152
153 * Billing for all successfully-allocated resources begins (some types
154 may have lower than the requested levels).
155 * Databases can be created in the instance.
Bu Sun Kim65020912020-05-20 12:08:20 -0700156 * The instance&#x27;s allocated resource levels are readable via the API.
157 * The instance&#x27;s state becomes `READY`.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400158
159The returned long-running operation will
Dan O'Mearadd494642020-05-01 07:42:23 -0700160have a name of the format `&lt;instance_name&gt;/operations/&lt;operation_id&gt;` and
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400161can be used to track creation of the instance. The
162metadata field type is
163CreateInstanceMetadata.
164The response field type is
165Instance, if successful.
166
167Args:
168 parent: string, Required. The name of the project in which to create the instance. Values
Dan O'Mearadd494642020-05-01 07:42:23 -0700169are of the form `projects/&lt;project&gt;`. (required)
170 body: object, The request body.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400171 The object takes the form of:
172
173{ # The request for CreateInstance.
Bu Sun Kim65020912020-05-20 12:08:20 -0700174 &quot;instance&quot;: { # An isolated set of Cloud Spanner resources on which databases can be hosted. # Required. The instance to create. The name may be omitted, but if
Dan O'Mearadd494642020-05-01 07:42:23 -0700175 # specified must be `&lt;parent&gt;/instances/&lt;instance_id&gt;`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700176 &quot;state&quot;: &quot;A String&quot;, # Output only. The current instance state. For
177 # CreateInstance, the state must be
178 # either omitted or set to `CREATING`. For
179 # UpdateInstance, the state must be
180 # either omitted or set to `READY`.
181 &quot;nodeCount&quot;: 42, # The number of nodes allocated to this instance. This
182 # may be zero in API responses for instances that are not yet in state
183 # `READY`.
184 #
185 # See [the
186 # documentation](https://cloud.google.com/spanner/docs/instances#node_count)
187 # for more information about nodes.
188 &quot;displayName&quot;: &quot;A String&quot;, # Required. The descriptive name for this instance as it appears in UIs.
189 # Must be unique per project and between 4 and 30 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700190 &quot;name&quot;: &quot;A String&quot;, # Required. A unique identifier for the instance, which cannot be changed
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400191 # after the instance is created. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700192 # `projects/&lt;project&gt;/instances/a-z*[a-z0-9]`. The final
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700193 # segment of the name must be between 2 and 64 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700194 &quot;labels&quot;: { # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
195 # resources into groups that reflect a customer&#x27;s organizational needs and
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400196 # deployment strategies. Cloud Labels can be used to filter collections of
197 # resources. They can be used to control how resource metrics are aggregated.
198 # And they can be used as arguments to policy management rules (e.g. route,
199 # firewall, load balancing, etc.).
200 #
201 # * Label keys must be between 1 and 63 characters long and must conform to
202 # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
203 # * Label values must be between 0 and 63 characters long and must conform
204 # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
205 # * No more than 64 labels can be associated with a given resource.
206 #
207 # See https://goo.gl/xmQnxf for more information on and examples of labels.
208 #
209 # If you plan to use labels in your own code, please note that additional
210 # characters may be allowed in the future. And so you are advised to use an
Bu Sun Kim65020912020-05-20 12:08:20 -0700211 # internal label representation, such as JSON, which doesn&#x27;t rely upon
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400212 # specific characters being disallowed. For example, representing labels
Bu Sun Kim65020912020-05-20 12:08:20 -0700213 # as the string: name + &quot;_&quot; + value would prove problematic if we were to
214 # allow &quot;_&quot; in a future release.
215 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400216 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700217 &quot;endpointUris&quot;: [ # Deprecated. This field is not populated.
218 &quot;A String&quot;,
219 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700220 &quot;config&quot;: &quot;A String&quot;, # Required. The name of the instance&#x27;s configuration. Values are of the form
221 # `projects/&lt;project&gt;/instanceConfigs/&lt;configuration&gt;`. See
222 # also InstanceConfig and
223 # ListInstanceConfigs.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400224 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700225 &quot;instanceId&quot;: &quot;A String&quot;, # Required. The ID of the instance to create. Valid identifiers are of the
226 # form `a-z*[a-z0-9]` and must be between 2 and 64 characters in
227 # length.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400228 }
229
230 x__xgafv: string, V1 error format.
231 Allowed values
232 1 - v1 error format
233 2 - v2 error format
234
235Returns:
236 An object of the form:
237
238 { # This resource represents a long-running operation that is the result of a
239 # network API call.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700240 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
241 # originally returns it. If you use the default HTTP mapping, the
242 # `name` should be a resource name ending with `operations/{unique_id}`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700243 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation.
244 # different programming environments, including REST APIs and RPC APIs. It is
245 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
246 # three pieces of data: error code, error message, and error details.
247 #
248 # You can find out more about this error model and how to work with it in the
249 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700250 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
251 # user-facing error message should be localized and sent in the
252 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700253 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
254 # message types for APIs to use.
255 {
256 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
257 },
258 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700259 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
260 },
261 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
262 # contains progress information and common metadata such as create time.
263 # Some services might not provide such metadata. Any method that returns a
264 # long-running operation should document the metadata type, if any.
265 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
266 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700267 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700268 # If `true`, the operation is completed, and either `error` or `response` is
269 # available.
Bu Sun Kim65020912020-05-20 12:08:20 -0700270 &quot;response&quot;: { # The normal response of the operation in case of success. If the original
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700271 # method returns no data on success, such as `Delete`, the response is
272 # `google.protobuf.Empty`. If the original method is standard
273 # `Get`/`Create`/`Update`, the response should be the resource. For other
274 # methods, the response should have the type `XxxResponse`, where `Xxx`
275 # is the original method name. For example, if the original method name
276 # is `TakeSnapshot()`, the inferred response type is
277 # `TakeSnapshotResponse`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700278 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700279 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400280 }</pre>
281</div>
282
283<div class="method">
Thomas Coffee2f245372017-03-27 10:39:26 -0700284 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400285 <pre>Deletes an instance.
286
287Immediately upon completion of the request:
288
Bu Sun Kim65020912020-05-20 12:08:20 -0700289 * Billing ceases for all of the instance&#x27;s reserved resources.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400290
291Soon afterward:
292
293 * The instance and *all of its databases* immediately and
294 irrevocably disappear from the API. All data in the databases
295 is permanently deleted.
296
297Args:
298 name: string, Required. The name of the instance to be deleted. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700299`projects/&lt;project&gt;/instances/&lt;instance&gt;` (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400300 x__xgafv: string, V1 error format.
301 Allowed values
302 1 - v1 error format
303 2 - v2 error format
304
305Returns:
306 An object of the form:
307
308 { # A generic empty message that you can re-use to avoid defining duplicated
309 # empty messages in your APIs. A typical example is to use it as the request
310 # or the response type of an API method. For instance:
311 #
312 # service Foo {
313 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
314 # }
315 #
316 # The JSON representation for `Empty` is empty JSON object `{}`.
317 }</pre>
318</div>
319
320<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700321 <code class="details" id="get">get(name, fieldMask=None, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400322 <pre>Gets information about a particular instance.
323
324Args:
325 name: string, Required. The name of the requested instance. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700326`projects/&lt;project&gt;/instances/&lt;instance&gt;`. (required)
327 fieldMask: string, If field_mask is present, specifies the subset of Instance fields that
328should be returned.
329If absent, all Instance fields are returned.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400330 x__xgafv: string, V1 error format.
331 Allowed values
332 1 - v1 error format
333 2 - v2 error format
334
335Returns:
336 An object of the form:
337
338 { # An isolated set of Cloud Spanner resources on which databases can be hosted.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700339 &quot;state&quot;: &quot;A String&quot;, # Output only. The current instance state. For
340 # CreateInstance, the state must be
341 # either omitted or set to `CREATING`. For
342 # UpdateInstance, the state must be
343 # either omitted or set to `READY`.
344 &quot;nodeCount&quot;: 42, # The number of nodes allocated to this instance. This
345 # may be zero in API responses for instances that are not yet in state
346 # `READY`.
347 #
348 # See [the
349 # documentation](https://cloud.google.com/spanner/docs/instances#node_count)
350 # for more information about nodes.
351 &quot;displayName&quot;: &quot;A String&quot;, # Required. The descriptive name for this instance as it appears in UIs.
352 # Must be unique per project and between 4 and 30 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700353 &quot;name&quot;: &quot;A String&quot;, # Required. A unique identifier for the instance, which cannot be changed
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400354 # after the instance is created. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700355 # `projects/&lt;project&gt;/instances/a-z*[a-z0-9]`. The final
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700356 # segment of the name must be between 2 and 64 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700357 &quot;labels&quot;: { # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
358 # resources into groups that reflect a customer&#x27;s organizational needs and
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400359 # deployment strategies. Cloud Labels can be used to filter collections of
360 # resources. They can be used to control how resource metrics are aggregated.
361 # And they can be used as arguments to policy management rules (e.g. route,
362 # firewall, load balancing, etc.).
363 #
364 # * Label keys must be between 1 and 63 characters long and must conform to
365 # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
366 # * Label values must be between 0 and 63 characters long and must conform
367 # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
368 # * No more than 64 labels can be associated with a given resource.
369 #
370 # See https://goo.gl/xmQnxf for more information on and examples of labels.
371 #
372 # If you plan to use labels in your own code, please note that additional
373 # characters may be allowed in the future. And so you are advised to use an
Bu Sun Kim65020912020-05-20 12:08:20 -0700374 # internal label representation, such as JSON, which doesn&#x27;t rely upon
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400375 # specific characters being disallowed. For example, representing labels
Bu Sun Kim65020912020-05-20 12:08:20 -0700376 # as the string: name + &quot;_&quot; + value would prove problematic if we were to
377 # allow &quot;_&quot; in a future release.
378 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400379 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700380 &quot;endpointUris&quot;: [ # Deprecated. This field is not populated.
381 &quot;A String&quot;,
382 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700383 &quot;config&quot;: &quot;A String&quot;, # Required. The name of the instance&#x27;s configuration. Values are of the form
384 # `projects/&lt;project&gt;/instanceConfigs/&lt;configuration&gt;`. See
385 # also InstanceConfig and
386 # ListInstanceConfigs.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400387 }</pre>
388</div>
389
390<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700391 <code class="details" id="getIamPolicy">getIamPolicy(resource, body=None, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400392 <pre>Gets the access control policy for an instance resource. Returns an empty
393policy if an instance exists but does not have a policy set.
394
395Authorization requires `spanner.instances.getIamPolicy` on
396resource.
397
398Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700399 resource: string, REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects/&lt;project ID&gt;/instances/&lt;instance ID&gt;` for instance resources and `projects/&lt;project ID&gt;/instances/&lt;instance ID&gt;/databases/&lt;database ID&gt;` for database resources. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700400 body: object, The request body.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400401 The object takes the form of:
402
403{ # Request message for `GetIamPolicy` method.
Bu Sun Kim65020912020-05-20 12:08:20 -0700404 &quot;options&quot;: { # Encapsulates settings provided to GetIamPolicy. # OPTIONAL: A `GetPolicyOptions` object for specifying options to
405 # `GetIamPolicy`.
406 &quot;requestedPolicyVersion&quot;: 42, # Optional. The policy format version to be returned.
Dan O'Mearadd494642020-05-01 07:42:23 -0700407 #
408 # Valid values are 0, 1, and 3. Requests specifying an invalid value will be
409 # rejected.
410 #
411 # Requests for policies with any conditional bindings must specify version 3.
412 # Policies without any conditional bindings may specify any valid value or
413 # leave the field unset.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700414 #
415 # To learn which resources support conditions in their IAM policies, see the
416 # [IAM
417 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Dan O'Mearadd494642020-05-01 07:42:23 -0700418 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400419 }
420
421 x__xgafv: string, V1 error format.
422 Allowed values
423 1 - v1 error format
424 2 - v2 error format
425
426Returns:
427 An object of the form:
428
Dan O'Mearadd494642020-05-01 07:42:23 -0700429 { # An Identity and Access Management (IAM) policy, which specifies access
430 # controls for Google Cloud resources.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400431 #
432 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700433 # A `Policy` is a collection of `bindings`. A `binding` binds one or more
434 # `members` to a single `role`. Members can be user accounts, service accounts,
435 # Google groups, and domains (such as G Suite). A `role` is a named list of
436 # permissions; each `role` can be an IAM predefined role or a user-created
437 # custom role.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400438 #
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700439 # For some types of Google Cloud resources, a `binding` can also specify a
440 # `condition`, which is a logical expression that allows access to a resource
441 # only if the expression evaluates to `true`. A condition can add constraints
442 # based on attributes of the request, the resource, or both. To learn which
443 # resources support conditions in their IAM policies, see the
444 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Dan O'Mearadd494642020-05-01 07:42:23 -0700445 #
446 # **JSON example:**
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400447 #
448 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700449 # &quot;bindings&quot;: [
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400450 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700451 # &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;,
452 # &quot;members&quot;: [
453 # &quot;user:mike@example.com&quot;,
454 # &quot;group:admins@example.com&quot;,
455 # &quot;domain:google.com&quot;,
456 # &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot;
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400457 # ]
458 # },
459 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700460 # &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;,
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700461 # &quot;members&quot;: [
462 # &quot;user:eve@example.com&quot;
463 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700464 # &quot;condition&quot;: {
465 # &quot;title&quot;: &quot;expirable access&quot;,
466 # &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;,
467 # &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700468 # }
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400469 # }
Dan O'Mearadd494642020-05-01 07:42:23 -0700470 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700471 # &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;,
472 # &quot;version&quot;: 3
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400473 # }
474 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700475 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700476 #
477 # bindings:
478 # - members:
479 # - user:mike@example.com
480 # - group:admins@example.com
481 # - domain:google.com
Dan O'Mearadd494642020-05-01 07:42:23 -0700482 # - serviceAccount:my-project-id@appspot.gserviceaccount.com
483 # role: roles/resourcemanager.organizationAdmin
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700484 # - members:
Dan O'Mearadd494642020-05-01 07:42:23 -0700485 # - user:eve@example.com
486 # role: roles/resourcemanager.organizationViewer
487 # condition:
488 # title: expirable access
489 # description: Does not grant access after Sep 2020
Bu Sun Kim65020912020-05-20 12:08:20 -0700490 # expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)
Dan O'Mearadd494642020-05-01 07:42:23 -0700491 # - etag: BwWWja0YfJA=
492 # - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700493 #
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400494 # For a description of IAM and its features, see the
Dan O'Mearadd494642020-05-01 07:42:23 -0700495 # [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -0700496 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a
Dan O'Mearadd494642020-05-01 07:42:23 -0700497 # `condition` that determines how and when the `bindings` are applied. Each
498 # of the `bindings` must contain at least one member.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400499 { # Associates `members` with a `role`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700500 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
501 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700502 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400503 # `members` can have the following values:
504 #
505 # * `allUsers`: A special identifier that represents anyone who is
506 # on the internet; with or without a Google account.
507 #
508 # * `allAuthenticatedUsers`: A special identifier that represents anyone
509 # who is authenticated with a Google account or a service account.
510 #
511 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -0700512 # account. For example, `alice@example.com` .
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400513 #
514 #
515 # * `serviceAccount:{emailid}`: An email address that represents a service
516 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
517 #
518 # * `group:{emailid}`: An email address that represents a Google group.
519 # For example, `admins@example.com`.
520 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700521 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
522 # identifier) representing a user that has been recently deleted. For
523 # example, `alice@example.com?uid=123456789012345678901`. If the user is
524 # recovered, this value reverts to `user:{emailid}` and the recovered user
525 # retains the role in the binding.
526 #
527 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
528 # unique identifier) representing a service account that has been recently
529 # deleted. For example,
530 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
531 # If the service account is undeleted, this value reverts to
532 # `serviceAccount:{emailid}` and the undeleted service account retains the
533 # role in the binding.
534 #
535 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
536 # identifier) representing a Google group that has been recently
537 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
538 # the group is recovered, this value reverts to `group:{emailid}` and the
539 # recovered group retains the role in the binding.
540 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700541 #
542 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400543 # users of that domain. For example, `google.com` or `example.com`.
544 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700545 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400546 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700547 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
548 #
549 # If the condition evaluates to `true`, then this binding applies to the
550 # current request.
551 #
552 # If the condition evaluates to `false`, then this binding does not apply to
553 # the current request. However, a different role binding might grant the same
554 # role to one or more of the members in this binding.
555 #
556 # To learn which resources support conditions in their IAM policies, see the
557 # [IAM
558 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
559 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
560 # are documented at https://github.com/google/cel-spec.
561 #
562 # Example (Comparison):
563 #
564 # title: &quot;Summary size limit&quot;
565 # description: &quot;Determines if a summary is less than 100 chars&quot;
566 # expression: &quot;document.summary.size() &lt; 100&quot;
567 #
568 # Example (Equality):
569 #
570 # title: &quot;Requestor is owner&quot;
571 # description: &quot;Determines if requestor is the document owner&quot;
572 # expression: &quot;document.owner == request.auth.claims.email&quot;
573 #
574 # Example (Logic):
575 #
576 # title: &quot;Public documents&quot;
577 # description: &quot;Determine whether the document should be publicly visible&quot;
578 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
579 #
580 # Example (Data Manipulation):
581 #
582 # title: &quot;Notification string&quot;
583 # description: &quot;Create a notification string with a timestamp.&quot;
584 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
585 #
586 # The exact variables and functions that may be referenced within an expression
587 # are determined by the service that evaluates it. See the service
588 # documentation for additional information.
589 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
590 # syntax.
591 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
592 # describes the expression, e.g. when hovered over it in a UI.
593 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
594 # reporting, e.g. a file name and a position in the file.
595 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
596 # its purpose. This can be used e.g. in UIs which allow to enter the
597 # expression.
598 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400599 },
600 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700601 &quot;version&quot;: 42, # Specifies the format of the policy.
602 #
603 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
604 # are rejected.
605 #
606 # Any operation that affects conditional role bindings must specify version
607 # `3`. This requirement applies to the following operations:
608 #
609 # * Getting a policy that includes a conditional role binding
610 # * Adding a conditional role binding to a policy
611 # * Changing a conditional role binding in a policy
612 # * Removing any role binding, with or without a condition, from a policy
613 # that includes conditions
614 #
615 # **Important:** If you use IAM Conditions, you must include the `etag` field
616 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
617 # you to overwrite a version `3` policy with a version `1` policy, and all of
618 # the conditions in the version `3` policy are lost.
619 #
620 # If a policy does not include any conditions, operations on that policy may
621 # specify any valid version or leave the field unset.
622 #
623 # To learn which resources support conditions in their IAM policies, see the
624 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700625 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
626 # prevent simultaneous updates of a policy from overwriting each other.
627 # It is strongly suggested that systems make use of the `etag` in the
628 # read-modify-write cycle to perform policy updates in order to avoid race
629 # conditions: An `etag` is returned in the response to `getIamPolicy`, and
630 # systems are expected to put that etag in the request to `setIamPolicy` to
631 # ensure that their change will be applied to the same version of the policy.
632 #
633 # **Important:** If you use IAM Conditions, you must include the `etag` field
634 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
635 # you to overwrite a version `3` policy with a version `1` policy, and all of
636 # the conditions in the version `3` policy are lost.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400637 }</pre>
638</div>
639
640<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700641 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, filter=None, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400642 <pre>Lists all instances in the given project.
643
644Args:
645 parent: string, Required. The name of the project for which a list of instances is
Dan O'Mearadd494642020-05-01 07:42:23 -0700646requested. Values are of the form `projects/&lt;project&gt;`. (required)
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700647 pageSize: integer, Number of instances to be returned in the response. If 0 or less, defaults
648to the server&#x27;s maximum allowed page size.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700649 pageToken: string, If non-empty, `page_token` should contain a
650next_page_token from a
651previous ListInstancesResponse.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700652 filter: string, An expression for filtering the results of the request. Filter rules are
653case insensitive. The fields eligible for filtering are:
654
655 * `name`
656 * `display_name`
657 * `labels.key` where key is the name of a label
658
659Some examples of using filters are:
660
Dan O'Mearadd494642020-05-01 07:42:23 -0700661 * `name:*` --&gt; The instance has a name.
Bu Sun Kim65020912020-05-20 12:08:20 -0700662 * `name:Howl` --&gt; The instance&#x27;s name contains the string &quot;howl&quot;.
Dan O'Mearadd494642020-05-01 07:42:23 -0700663 * `name:HOWL` --&gt; Equivalent to above.
664 * `NAME:howl` --&gt; Equivalent to above.
Bu Sun Kim65020912020-05-20 12:08:20 -0700665 * `labels.env:*` --&gt; The instance has the label &quot;env&quot;.
666 * `labels.env:dev` --&gt; The instance has the label &quot;env&quot; and the value of
667 the label contains the string &quot;dev&quot;.
668 * `name:howl labels.env:dev` --&gt; The instance&#x27;s name contains &quot;howl&quot; and
669 it has the label &quot;env&quot; with its value
670 containing &quot;dev&quot;.
Bu Sun Kim65020912020-05-20 12:08:20 -0700671 x__xgafv: string, V1 error format.
672 Allowed values
673 1 - v1 error format
674 2 - v2 error format
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400675
676Returns:
677 An object of the form:
678
679 { # The response for ListInstances.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700680 &quot;nextPageToken&quot;: &quot;A String&quot;, # `next_page_token` can be sent in a subsequent
681 # ListInstances call to fetch more
682 # of the matching instances.
Bu Sun Kim65020912020-05-20 12:08:20 -0700683 &quot;instances&quot;: [ # The list of requested instances.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400684 { # An isolated set of Cloud Spanner resources on which databases can be hosted.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700685 &quot;state&quot;: &quot;A String&quot;, # Output only. The current instance state. For
686 # CreateInstance, the state must be
687 # either omitted or set to `CREATING`. For
688 # UpdateInstance, the state must be
689 # either omitted or set to `READY`.
690 &quot;nodeCount&quot;: 42, # The number of nodes allocated to this instance. This
691 # may be zero in API responses for instances that are not yet in state
692 # `READY`.
693 #
694 # See [the
695 # documentation](https://cloud.google.com/spanner/docs/instances#node_count)
696 # for more information about nodes.
697 &quot;displayName&quot;: &quot;A String&quot;, # Required. The descriptive name for this instance as it appears in UIs.
698 # Must be unique per project and between 4 and 30 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700699 &quot;name&quot;: &quot;A String&quot;, # Required. A unique identifier for the instance, which cannot be changed
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400700 # after the instance is created. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700701 # `projects/&lt;project&gt;/instances/a-z*[a-z0-9]`. The final
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700702 # segment of the name must be between 2 and 64 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700703 &quot;labels&quot;: { # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
704 # resources into groups that reflect a customer&#x27;s organizational needs and
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400705 # deployment strategies. Cloud Labels can be used to filter collections of
706 # resources. They can be used to control how resource metrics are aggregated.
707 # And they can be used as arguments to policy management rules (e.g. route,
708 # firewall, load balancing, etc.).
709 #
710 # * Label keys must be between 1 and 63 characters long and must conform to
711 # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
712 # * Label values must be between 0 and 63 characters long and must conform
713 # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
714 # * No more than 64 labels can be associated with a given resource.
715 #
716 # See https://goo.gl/xmQnxf for more information on and examples of labels.
717 #
718 # If you plan to use labels in your own code, please note that additional
719 # characters may be allowed in the future. And so you are advised to use an
Bu Sun Kim65020912020-05-20 12:08:20 -0700720 # internal label representation, such as JSON, which doesn&#x27;t rely upon
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400721 # specific characters being disallowed. For example, representing labels
Bu Sun Kim65020912020-05-20 12:08:20 -0700722 # as the string: name + &quot;_&quot; + value would prove problematic if we were to
723 # allow &quot;_&quot; in a future release.
724 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400725 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700726 &quot;endpointUris&quot;: [ # Deprecated. This field is not populated.
727 &quot;A String&quot;,
728 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700729 &quot;config&quot;: &quot;A String&quot;, # Required. The name of the instance&#x27;s configuration. Values are of the form
730 # `projects/&lt;project&gt;/instanceConfigs/&lt;configuration&gt;`. See
731 # also InstanceConfig and
732 # ListInstanceConfigs.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400733 },
734 ],
735 }</pre>
736</div>
737
738<div class="method">
739 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
740 <pre>Retrieves the next page of results.
741
742Args:
743 previous_request: The request for the previous page. (required)
744 previous_response: The response from the request for the previous page. (required)
745
746Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700747 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400748 page. Returns None if there are no more items in the collection.
749 </pre>
750</div>
751
752<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700753 <code class="details" id="patch">patch(name, body=None, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400754 <pre>Updates an instance, and begins allocating or releasing resources
755as requested. The returned long-running
756operation can be used to track the
757progress of updating the instance. If the named instance does not
758exist, returns `NOT_FOUND`.
759
760Immediately upon completion of this request:
761
Bu Sun Kim65020912020-05-20 12:08:20 -0700762 * For resource types for which a decrease in the instance&#x27;s allocation
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400763 has been requested, billing is based on the newly-requested level.
764
765Until completion of the returned operation:
766
Bu Sun Kim65020912020-05-20 12:08:20 -0700767 * Cancelling the operation sets its metadata&#x27;s
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400768 cancel_time, and begins
769 restoring resources to their pre-request values. The operation
770 is guaranteed to succeed at undoing all resource changes,
771 after which point it terminates with a `CANCELLED` status.
772 * All other attempts to modify the instance are rejected.
773 * Reading the instance via the API continues to give the pre-request
774 resource levels.
775
776Upon completion of the returned operation:
777
778 * Billing begins for all successfully-allocated resources (some types
779 may have lower than the requested levels).
Bu Sun Kim65020912020-05-20 12:08:20 -0700780 * All newly-reserved resources are available for serving the instance&#x27;s
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400781 tables.
Bu Sun Kim65020912020-05-20 12:08:20 -0700782 * The instance&#x27;s new resource levels are readable via the API.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400783
784The returned long-running operation will
Dan O'Mearadd494642020-05-01 07:42:23 -0700785have a name of the format `&lt;instance_name&gt;/operations/&lt;operation_id&gt;` and
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400786can be used to track the instance modification. The
787metadata field type is
788UpdateInstanceMetadata.
789The response field type is
790Instance, if successful.
791
792Authorization requires `spanner.instances.update` permission on
793resource name.
794
795Args:
796 name: string, Required. A unique identifier for the instance, which cannot be changed
797after the instance is created. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700798`projects/&lt;project&gt;/instances/a-z*[a-z0-9]`. The final
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700799segment of the name must be between 2 and 64 characters in length. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700800 body: object, The request body.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400801 The object takes the form of:
802
803{ # The request for UpdateInstance.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700804 &quot;fieldMask&quot;: &quot;A String&quot;, # Required. A mask specifying which fields in Instance should be updated.
805 # The field mask must always be specified; this prevents any future fields in
806 # Instance from being erased accidentally by clients that do not know
807 # about them.
Bu Sun Kim65020912020-05-20 12:08:20 -0700808 &quot;instance&quot;: { # An isolated set of Cloud Spanner resources on which databases can be hosted. # Required. The instance to update, which must always include the instance
Dan O'Mearadd494642020-05-01 07:42:23 -0700809 # name. Otherwise, only fields mentioned in field_mask need be included.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700810 &quot;state&quot;: &quot;A String&quot;, # Output only. The current instance state. For
811 # CreateInstance, the state must be
812 # either omitted or set to `CREATING`. For
813 # UpdateInstance, the state must be
814 # either omitted or set to `READY`.
815 &quot;nodeCount&quot;: 42, # The number of nodes allocated to this instance. This
816 # may be zero in API responses for instances that are not yet in state
817 # `READY`.
818 #
819 # See [the
820 # documentation](https://cloud.google.com/spanner/docs/instances#node_count)
821 # for more information about nodes.
822 &quot;displayName&quot;: &quot;A String&quot;, # Required. The descriptive name for this instance as it appears in UIs.
823 # Must be unique per project and between 4 and 30 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700824 &quot;name&quot;: &quot;A String&quot;, # Required. A unique identifier for the instance, which cannot be changed
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400825 # after the instance is created. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700826 # `projects/&lt;project&gt;/instances/a-z*[a-z0-9]`. The final
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700827 # segment of the name must be between 2 and 64 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700828 &quot;labels&quot;: { # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
829 # resources into groups that reflect a customer&#x27;s organizational needs and
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400830 # deployment strategies. Cloud Labels can be used to filter collections of
831 # resources. They can be used to control how resource metrics are aggregated.
832 # And they can be used as arguments to policy management rules (e.g. route,
833 # firewall, load balancing, etc.).
834 #
835 # * Label keys must be between 1 and 63 characters long and must conform to
836 # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
837 # * Label values must be between 0 and 63 characters long and must conform
838 # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
839 # * No more than 64 labels can be associated with a given resource.
840 #
841 # See https://goo.gl/xmQnxf for more information on and examples of labels.
842 #
843 # If you plan to use labels in your own code, please note that additional
844 # characters may be allowed in the future. And so you are advised to use an
Bu Sun Kim65020912020-05-20 12:08:20 -0700845 # internal label representation, such as JSON, which doesn&#x27;t rely upon
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400846 # specific characters being disallowed. For example, representing labels
Bu Sun Kim65020912020-05-20 12:08:20 -0700847 # as the string: name + &quot;_&quot; + value would prove problematic if we were to
848 # allow &quot;_&quot; in a future release.
849 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400850 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700851 &quot;endpointUris&quot;: [ # Deprecated. This field is not populated.
852 &quot;A String&quot;,
853 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700854 &quot;config&quot;: &quot;A String&quot;, # Required. The name of the instance&#x27;s configuration. Values are of the form
855 # `projects/&lt;project&gt;/instanceConfigs/&lt;configuration&gt;`. See
856 # also InstanceConfig and
857 # ListInstanceConfigs.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400858 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400859 }
860
861 x__xgafv: string, V1 error format.
862 Allowed values
863 1 - v1 error format
864 2 - v2 error format
865
866Returns:
867 An object of the form:
868
869 { # This resource represents a long-running operation that is the result of a
870 # network API call.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700871 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
872 # originally returns it. If you use the default HTTP mapping, the
873 # `name` should be a resource name ending with `operations/{unique_id}`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700874 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation.
875 # different programming environments, including REST APIs and RPC APIs. It is
876 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
877 # three pieces of data: error code, error message, and error details.
878 #
879 # You can find out more about this error model and how to work with it in the
880 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700881 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
882 # user-facing error message should be localized and sent in the
883 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700884 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
885 # message types for APIs to use.
886 {
887 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
888 },
889 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700890 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
891 },
892 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
893 # contains progress information and common metadata such as create time.
894 # Some services might not provide such metadata. Any method that returns a
895 # long-running operation should document the metadata type, if any.
896 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
897 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700898 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700899 # If `true`, the operation is completed, and either `error` or `response` is
900 # available.
Bu Sun Kim65020912020-05-20 12:08:20 -0700901 &quot;response&quot;: { # The normal response of the operation in case of success. If the original
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700902 # method returns no data on success, such as `Delete`, the response is
903 # `google.protobuf.Empty`. If the original method is standard
904 # `Get`/`Create`/`Update`, the response should be the resource. For other
905 # methods, the response should have the type `XxxResponse`, where `Xxx`
906 # is the original method name. For example, if the original method name
907 # is `TakeSnapshot()`, the inferred response type is
908 # `TakeSnapshotResponse`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700909 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700910 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400911 }</pre>
912</div>
913
914<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700915 <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400916 <pre>Sets the access control policy on an instance resource. Replaces any
917existing policy.
918
919Authorization requires `spanner.instances.setIamPolicy` on
920resource.
921
922Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700923 resource: string, REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects/&lt;project ID&gt;/instances/&lt;instance ID&gt;` for instance resources and `projects/&lt;project ID&gt;/instances/&lt;instance ID&gt;/databases/&lt;database ID&gt;` for databases resources. (required)
924 body: object, The request body.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400925 The object takes the form of:
926
927{ # Request message for `SetIamPolicy` method.
Bu Sun Kim65020912020-05-20 12:08:20 -0700928 &quot;policy&quot;: { # An Identity and Access Management (IAM) policy, which specifies access # REQUIRED: The complete policy to be applied to the `resource`. The size of
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400929 # the policy is limited to a few 10s of KB. An empty policy is a
930 # valid policy but certain Cloud Platform services (such as Projects)
931 # might reject them.
Dan O'Mearadd494642020-05-01 07:42:23 -0700932 # controls for Google Cloud resources.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400933 #
934 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700935 # A `Policy` is a collection of `bindings`. A `binding` binds one or more
936 # `members` to a single `role`. Members can be user accounts, service accounts,
937 # Google groups, and domains (such as G Suite). A `role` is a named list of
938 # permissions; each `role` can be an IAM predefined role or a user-created
939 # custom role.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400940 #
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700941 # For some types of Google Cloud resources, a `binding` can also specify a
942 # `condition`, which is a logical expression that allows access to a resource
943 # only if the expression evaluates to `true`. A condition can add constraints
944 # based on attributes of the request, the resource, or both. To learn which
945 # resources support conditions in their IAM policies, see the
946 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Dan O'Mearadd494642020-05-01 07:42:23 -0700947 #
948 # **JSON example:**
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400949 #
950 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700951 # &quot;bindings&quot;: [
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400952 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700953 # &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;,
954 # &quot;members&quot;: [
955 # &quot;user:mike@example.com&quot;,
956 # &quot;group:admins@example.com&quot;,
957 # &quot;domain:google.com&quot;,
958 # &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot;
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400959 # ]
960 # },
961 # {
Bu Sun Kim65020912020-05-20 12:08:20 -0700962 # &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;,
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700963 # &quot;members&quot;: [
964 # &quot;user:eve@example.com&quot;
965 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700966 # &quot;condition&quot;: {
967 # &quot;title&quot;: &quot;expirable access&quot;,
968 # &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;,
969 # &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700970 # }
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400971 # }
Dan O'Mearadd494642020-05-01 07:42:23 -0700972 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700973 # &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;,
974 # &quot;version&quot;: 3
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400975 # }
976 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700977 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700978 #
979 # bindings:
980 # - members:
981 # - user:mike@example.com
982 # - group:admins@example.com
983 # - domain:google.com
Dan O'Mearadd494642020-05-01 07:42:23 -0700984 # - serviceAccount:my-project-id@appspot.gserviceaccount.com
985 # role: roles/resourcemanager.organizationAdmin
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700986 # - members:
Dan O'Mearadd494642020-05-01 07:42:23 -0700987 # - user:eve@example.com
988 # role: roles/resourcemanager.organizationViewer
989 # condition:
990 # title: expirable access
991 # description: Does not grant access after Sep 2020
Bu Sun Kim65020912020-05-20 12:08:20 -0700992 # expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)
Dan O'Mearadd494642020-05-01 07:42:23 -0700993 # - etag: BwWWja0YfJA=
994 # - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700995 #
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400996 # For a description of IAM and its features, see the
Dan O'Mearadd494642020-05-01 07:42:23 -0700997 # [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -0700998 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a
Dan O'Mearadd494642020-05-01 07:42:23 -0700999 # `condition` that determines how and when the `bindings` are applied. Each
1000 # of the `bindings` must contain at least one member.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001001 { # Associates `members` with a `role`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001002 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
1003 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001004 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001005 # `members` can have the following values:
1006 #
1007 # * `allUsers`: A special identifier that represents anyone who is
1008 # on the internet; with or without a Google account.
1009 #
1010 # * `allAuthenticatedUsers`: A special identifier that represents anyone
1011 # who is authenticated with a Google account or a service account.
1012 #
1013 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -07001014 # account. For example, `alice@example.com` .
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001015 #
1016 #
1017 # * `serviceAccount:{emailid}`: An email address that represents a service
1018 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
1019 #
1020 # * `group:{emailid}`: An email address that represents a Google group.
1021 # For example, `admins@example.com`.
1022 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001023 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
1024 # identifier) representing a user that has been recently deleted. For
1025 # example, `alice@example.com?uid=123456789012345678901`. If the user is
1026 # recovered, this value reverts to `user:{emailid}` and the recovered user
1027 # retains the role in the binding.
1028 #
1029 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
1030 # unique identifier) representing a service account that has been recently
1031 # deleted. For example,
1032 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
1033 # If the service account is undeleted, this value reverts to
1034 # `serviceAccount:{emailid}` and the undeleted service account retains the
1035 # role in the binding.
1036 #
1037 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
1038 # identifier) representing a Google group that has been recently
1039 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
1040 # the group is recovered, this value reverts to `group:{emailid}` and the
1041 # recovered group retains the role in the binding.
1042 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001043 #
1044 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001045 # users of that domain. For example, `google.com` or `example.com`.
1046 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001047 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001048 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001049 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
1050 #
1051 # If the condition evaluates to `true`, then this binding applies to the
1052 # current request.
1053 #
1054 # If the condition evaluates to `false`, then this binding does not apply to
1055 # the current request. However, a different role binding might grant the same
1056 # role to one or more of the members in this binding.
1057 #
1058 # To learn which resources support conditions in their IAM policies, see the
1059 # [IAM
1060 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1061 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
1062 # are documented at https://github.com/google/cel-spec.
1063 #
1064 # Example (Comparison):
1065 #
1066 # title: &quot;Summary size limit&quot;
1067 # description: &quot;Determines if a summary is less than 100 chars&quot;
1068 # expression: &quot;document.summary.size() &lt; 100&quot;
1069 #
1070 # Example (Equality):
1071 #
1072 # title: &quot;Requestor is owner&quot;
1073 # description: &quot;Determines if requestor is the document owner&quot;
1074 # expression: &quot;document.owner == request.auth.claims.email&quot;
1075 #
1076 # Example (Logic):
1077 #
1078 # title: &quot;Public documents&quot;
1079 # description: &quot;Determine whether the document should be publicly visible&quot;
1080 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1081 #
1082 # Example (Data Manipulation):
1083 #
1084 # title: &quot;Notification string&quot;
1085 # description: &quot;Create a notification string with a timestamp.&quot;
1086 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1087 #
1088 # The exact variables and functions that may be referenced within an expression
1089 # are determined by the service that evaluates it. See the service
1090 # documentation for additional information.
1091 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
1092 # syntax.
1093 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
1094 # describes the expression, e.g. when hovered over it in a UI.
1095 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
1096 # reporting, e.g. a file name and a position in the file.
1097 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
1098 # its purpose. This can be used e.g. in UIs which allow to enter the
1099 # expression.
1100 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001101 },
1102 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001103 &quot;version&quot;: 42, # Specifies the format of the policy.
1104 #
1105 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
1106 # are rejected.
1107 #
1108 # Any operation that affects conditional role bindings must specify version
1109 # `3`. This requirement applies to the following operations:
1110 #
1111 # * Getting a policy that includes a conditional role binding
1112 # * Adding a conditional role binding to a policy
1113 # * Changing a conditional role binding in a policy
1114 # * Removing any role binding, with or without a condition, from a policy
1115 # that includes conditions
1116 #
1117 # **Important:** If you use IAM Conditions, you must include the `etag` field
1118 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1119 # you to overwrite a version `3` policy with a version `1` policy, and all of
1120 # the conditions in the version `3` policy are lost.
1121 #
1122 # If a policy does not include any conditions, operations on that policy may
1123 # specify any valid version or leave the field unset.
1124 #
1125 # To learn which resources support conditions in their IAM policies, see the
1126 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001127 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
1128 # prevent simultaneous updates of a policy from overwriting each other.
1129 # It is strongly suggested that systems make use of the `etag` in the
1130 # read-modify-write cycle to perform policy updates in order to avoid race
1131 # conditions: An `etag` is returned in the response to `getIamPolicy`, and
1132 # systems are expected to put that etag in the request to `setIamPolicy` to
1133 # ensure that their change will be applied to the same version of the policy.
1134 #
1135 # **Important:** If you use IAM Conditions, you must include the `etag` field
1136 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1137 # you to overwrite a version `3` policy with a version `1` policy, and all of
1138 # the conditions in the version `3` policy are lost.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001139 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001140 }
1141
1142 x__xgafv: string, V1 error format.
1143 Allowed values
1144 1 - v1 error format
1145 2 - v2 error format
1146
1147Returns:
1148 An object of the form:
1149
Dan O'Mearadd494642020-05-01 07:42:23 -07001150 { # An Identity and Access Management (IAM) policy, which specifies access
1151 # controls for Google Cloud resources.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001152 #
1153 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001154 # A `Policy` is a collection of `bindings`. A `binding` binds one or more
1155 # `members` to a single `role`. Members can be user accounts, service accounts,
1156 # Google groups, and domains (such as G Suite). A `role` is a named list of
1157 # permissions; each `role` can be an IAM predefined role or a user-created
1158 # custom role.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001159 #
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001160 # For some types of Google Cloud resources, a `binding` can also specify a
1161 # `condition`, which is a logical expression that allows access to a resource
1162 # only if the expression evaluates to `true`. A condition can add constraints
1163 # based on attributes of the request, the resource, or both. To learn which
1164 # resources support conditions in their IAM policies, see the
1165 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Dan O'Mearadd494642020-05-01 07:42:23 -07001166 #
1167 # **JSON example:**
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001168 #
1169 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001170 # &quot;bindings&quot;: [
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001171 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001172 # &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;,
1173 # &quot;members&quot;: [
1174 # &quot;user:mike@example.com&quot;,
1175 # &quot;group:admins@example.com&quot;,
1176 # &quot;domain:google.com&quot;,
1177 # &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot;
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001178 # ]
1179 # },
1180 # {
Bu Sun Kim65020912020-05-20 12:08:20 -07001181 # &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;,
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001182 # &quot;members&quot;: [
1183 # &quot;user:eve@example.com&quot;
1184 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001185 # &quot;condition&quot;: {
1186 # &quot;title&quot;: &quot;expirable access&quot;,
1187 # &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;,
1188 # &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07001189 # }
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001190 # }
Dan O'Mearadd494642020-05-01 07:42:23 -07001191 # ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001192 # &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;,
1193 # &quot;version&quot;: 3
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001194 # }
1195 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001196 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001197 #
1198 # bindings:
1199 # - members:
1200 # - user:mike@example.com
1201 # - group:admins@example.com
1202 # - domain:google.com
Dan O'Mearadd494642020-05-01 07:42:23 -07001203 # - serviceAccount:my-project-id@appspot.gserviceaccount.com
1204 # role: roles/resourcemanager.organizationAdmin
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001205 # - members:
Dan O'Mearadd494642020-05-01 07:42:23 -07001206 # - user:eve@example.com
1207 # role: roles/resourcemanager.organizationViewer
1208 # condition:
1209 # title: expirable access
1210 # description: Does not grant access after Sep 2020
Bu Sun Kim65020912020-05-20 12:08:20 -07001211 # expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)
Dan O'Mearadd494642020-05-01 07:42:23 -07001212 # - etag: BwWWja0YfJA=
1213 # - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001214 #
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001215 # For a description of IAM and its features, see the
Dan O'Mearadd494642020-05-01 07:42:23 -07001216 # [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -07001217 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a
Dan O'Mearadd494642020-05-01 07:42:23 -07001218 # `condition` that determines how and when the `bindings` are applied. Each
1219 # of the `bindings` must contain at least one member.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001220 { # Associates `members` with a `role`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001221 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`.
1222 # For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim65020912020-05-20 12:08:20 -07001223 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001224 # `members` can have the following values:
1225 #
1226 # * `allUsers`: A special identifier that represents anyone who is
1227 # on the internet; with or without a Google account.
1228 #
1229 # * `allAuthenticatedUsers`: A special identifier that represents anyone
1230 # who is authenticated with a Google account or a service account.
1231 #
1232 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -07001233 # account. For example, `alice@example.com` .
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001234 #
1235 #
1236 # * `serviceAccount:{emailid}`: An email address that represents a service
1237 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
1238 #
1239 # * `group:{emailid}`: An email address that represents a Google group.
1240 # For example, `admins@example.com`.
1241 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001242 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
1243 # identifier) representing a user that has been recently deleted. For
1244 # example, `alice@example.com?uid=123456789012345678901`. If the user is
1245 # recovered, this value reverts to `user:{emailid}` and the recovered user
1246 # retains the role in the binding.
1247 #
1248 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
1249 # unique identifier) representing a service account that has been recently
1250 # deleted. For example,
1251 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
1252 # If the service account is undeleted, this value reverts to
1253 # `serviceAccount:{emailid}` and the undeleted service account retains the
1254 # role in the binding.
1255 #
1256 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
1257 # identifier) representing a Google group that has been recently
1258 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
1259 # the group is recovered, this value reverts to `group:{emailid}` and the
1260 # recovered group retains the role in the binding.
1261 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001262 #
1263 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001264 # users of that domain. For example, `google.com` or `example.com`.
1265 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001266 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001267 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001268 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
1269 #
1270 # If the condition evaluates to `true`, then this binding applies to the
1271 # current request.
1272 #
1273 # If the condition evaluates to `false`, then this binding does not apply to
1274 # the current request. However, a different role binding might grant the same
1275 # role to one or more of the members in this binding.
1276 #
1277 # To learn which resources support conditions in their IAM policies, see the
1278 # [IAM
1279 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1280 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
1281 # are documented at https://github.com/google/cel-spec.
1282 #
1283 # Example (Comparison):
1284 #
1285 # title: &quot;Summary size limit&quot;
1286 # description: &quot;Determines if a summary is less than 100 chars&quot;
1287 # expression: &quot;document.summary.size() &lt; 100&quot;
1288 #
1289 # Example (Equality):
1290 #
1291 # title: &quot;Requestor is owner&quot;
1292 # description: &quot;Determines if requestor is the document owner&quot;
1293 # expression: &quot;document.owner == request.auth.claims.email&quot;
1294 #
1295 # Example (Logic):
1296 #
1297 # title: &quot;Public documents&quot;
1298 # description: &quot;Determine whether the document should be publicly visible&quot;
1299 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1300 #
1301 # Example (Data Manipulation):
1302 #
1303 # title: &quot;Notification string&quot;
1304 # description: &quot;Create a notification string with a timestamp.&quot;
1305 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1306 #
1307 # The exact variables and functions that may be referenced within an expression
1308 # are determined by the service that evaluates it. See the service
1309 # documentation for additional information.
1310 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
1311 # syntax.
1312 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
1313 # describes the expression, e.g. when hovered over it in a UI.
1314 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
1315 # reporting, e.g. a file name and a position in the file.
1316 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
1317 # its purpose. This can be used e.g. in UIs which allow to enter the
1318 # expression.
1319 },
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001320 },
1321 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001322 &quot;version&quot;: 42, # Specifies the format of the policy.
1323 #
1324 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
1325 # are rejected.
1326 #
1327 # Any operation that affects conditional role bindings must specify version
1328 # `3`. This requirement applies to the following operations:
1329 #
1330 # * Getting a policy that includes a conditional role binding
1331 # * Adding a conditional role binding to a policy
1332 # * Changing a conditional role binding in a policy
1333 # * Removing any role binding, with or without a condition, from a policy
1334 # that includes conditions
1335 #
1336 # **Important:** If you use IAM Conditions, you must include the `etag` field
1337 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1338 # you to overwrite a version `3` policy with a version `1` policy, and all of
1339 # the conditions in the version `3` policy are lost.
1340 #
1341 # If a policy does not include any conditions, operations on that policy may
1342 # specify any valid version or leave the field unset.
1343 #
1344 # To learn which resources support conditions in their IAM policies, see the
1345 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001346 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
1347 # prevent simultaneous updates of a policy from overwriting each other.
1348 # It is strongly suggested that systems make use of the `etag` in the
1349 # read-modify-write cycle to perform policy updates in order to avoid race
1350 # conditions: An `etag` is returned in the response to `getIamPolicy`, and
1351 # systems are expected to put that etag in the request to `setIamPolicy` to
1352 # ensure that their change will be applied to the same version of the policy.
1353 #
1354 # **Important:** If you use IAM Conditions, you must include the `etag` field
1355 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1356 # you to overwrite a version `3` policy with a version `1` policy, and all of
1357 # the conditions in the version `3` policy are lost.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001358 }</pre>
1359</div>
1360
1361<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001362 <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001363 <pre>Returns permissions that the caller has on the specified instance resource.
1364
1365Attempting this RPC on a non-existent Cloud Spanner instance resource will
1366result in a NOT_FOUND error if the user has `spanner.instances.list`
1367permission on the containing Google Cloud Project. Otherwise returns an
1368empty set of permissions.
1369
1370Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001371 resource: string, REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects/&lt;project ID&gt;/instances/&lt;instance ID&gt;` for instance resources and `projects/&lt;project ID&gt;/instances/&lt;instance ID&gt;/databases/&lt;database ID&gt;` for database resources. (required)
1372 body: object, The request body.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001373 The object takes the form of:
1374
1375{ # Request message for `TestIamPermissions` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07001376 &quot;permissions&quot;: [ # REQUIRED: The set of permissions to check for &#x27;resource&#x27;.
1377 # Permissions with wildcards (such as &#x27;*&#x27;, &#x27;spanner.*&#x27;, &#x27;spanner.instances.*&#x27;) are not allowed.
1378 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001379 ],
1380 }
1381
1382 x__xgafv: string, V1 error format.
1383 Allowed values
1384 1 - v1 error format
1385 2 - v2 error format
1386
1387Returns:
1388 An object of the form:
1389
1390 { # Response message for `TestIamPermissions` method.
Bu Sun Kim65020912020-05-20 12:08:20 -07001391 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001392 # allowed.
Bu Sun Kim65020912020-05-20 12:08:20 -07001393 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001394 ],
1395 }</pre>
1396</div>
1397
1398</body></html>