blob: 519e2bfee03d8d76477f4c92e415bd6699c20866 [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 Kim4ed7d3f2020-05-27 12:20:54 -0700115 <code><a href="#list">list(parent, pageToken=None, filter=None, pageSize=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;instanceId&quot;: &quot;A String&quot;, # Required. The ID of the instance to create. Valid identifiers are of the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700175 # form `a-z*[a-z0-9]` and must be between 2 and 64 characters in
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400176 # length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700177 &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 -0700178 # specified must be `&lt;parent&gt;/instances/&lt;instance_id&gt;`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700179 &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 -0400180 # after the instance is created. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700181 # `projects/&lt;project&gt;/instances/a-z*[a-z0-9]`. The final
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700182 # segment of the name must be between 2 and 64 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700183 &quot;labels&quot;: { # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
184 # resources into groups that reflect a customer&#x27;s organizational needs and
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400185 # deployment strategies. Cloud Labels can be used to filter collections of
186 # resources. They can be used to control how resource metrics are aggregated.
187 # And they can be used as arguments to policy management rules (e.g. route,
188 # firewall, load balancing, etc.).
189 #
190 # * Label keys must be between 1 and 63 characters long and must conform to
191 # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
192 # * Label values must be between 0 and 63 characters long and must conform
193 # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
194 # * No more than 64 labels can be associated with a given resource.
195 #
196 # See https://goo.gl/xmQnxf for more information on and examples of labels.
197 #
198 # If you plan to use labels in your own code, please note that additional
199 # characters may be allowed in the future. And so you are advised to use an
Bu Sun Kim65020912020-05-20 12:08:20 -0700200 # internal label representation, such as JSON, which doesn&#x27;t rely upon
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400201 # specific characters being disallowed. For example, representing labels
Bu Sun Kim65020912020-05-20 12:08:20 -0700202 # as the string: name + &quot;_&quot; + value would prove problematic if we were to
203 # allow &quot;_&quot; in a future release.
204 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400205 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700206 &quot;endpointUris&quot;: [ # Deprecated. This field is not populated.
207 &quot;A String&quot;,
208 ],
209 &quot;displayName&quot;: &quot;A String&quot;, # Required. The descriptive name for this instance as it appears in UIs.
210 # Must be unique per project and between 4 and 30 characters in length.
211 &quot;nodeCount&quot;: 42, # The number of nodes allocated to this instance. This
212 # may be zero in API responses for instances that are not yet in state
213 # `READY`.
214 #
215 # See [the
216 # documentation](https://cloud.google.com/spanner/docs/instances#node_count)
217 # for more information about nodes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700218 &quot;state&quot;: &quot;A String&quot;, # Output only. The current instance state. For
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400219 # CreateInstance, the state must be
220 # either omitted or set to `CREATING`. For
221 # UpdateInstance, the state must be
222 # either omitted or set to `READY`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700223 &quot;config&quot;: &quot;A String&quot;, # Required. The name of the instance&#x27;s configuration. Values are of the form
224 # `projects/&lt;project&gt;/instanceConfigs/&lt;configuration&gt;`. See
225 # also InstanceConfig and
226 # ListInstanceConfigs.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400227 },
228 }
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 Kim4ed7d3f2020-05-27 12:20:54 -0700240 &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.
241 # different programming environments, including REST APIs and RPC APIs. It is
242 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
243 # three pieces of data: error code, error message, and error details.
244 #
245 # You can find out more about this error model and how to work with it in the
246 # [API Design Guide](https://cloud.google.com/apis/design/errors).
247 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
248 # message types for APIs to use.
249 {
250 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
251 },
252 ],
253 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
254 # user-facing error message should be localized and sent in the
255 # google.rpc.Status.details field, or localized by the client.
256 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
257 },
258 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
259 # contains progress information and common metadata such as create time.
260 # Some services might not provide such metadata. Any method that returns a
261 # long-running operation should document the metadata type, if any.
262 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
263 },
264 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
265 # originally returns it. If you use the default HTTP mapping, the
266 # `name` should be a resource name ending with `operations/{unique_id}`.
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 Kim65020912020-05-20 12:08:20 -0700339 &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 -0400340 # after the instance is created. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700341 # `projects/&lt;project&gt;/instances/a-z*[a-z0-9]`. The final
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700342 # segment of the name must be between 2 and 64 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700343 &quot;labels&quot;: { # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
344 # resources into groups that reflect a customer&#x27;s organizational needs and
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400345 # deployment strategies. Cloud Labels can be used to filter collections of
346 # resources. They can be used to control how resource metrics are aggregated.
347 # And they can be used as arguments to policy management rules (e.g. route,
348 # firewall, load balancing, etc.).
349 #
350 # * Label keys must be between 1 and 63 characters long and must conform to
351 # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
352 # * Label values must be between 0 and 63 characters long and must conform
353 # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
354 # * No more than 64 labels can be associated with a given resource.
355 #
356 # See https://goo.gl/xmQnxf for more information on and examples of labels.
357 #
358 # If you plan to use labels in your own code, please note that additional
359 # characters may be allowed in the future. And so you are advised to use an
Bu Sun Kim65020912020-05-20 12:08:20 -0700360 # internal label representation, such as JSON, which doesn&#x27;t rely upon
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400361 # specific characters being disallowed. For example, representing labels
Bu Sun Kim65020912020-05-20 12:08:20 -0700362 # as the string: name + &quot;_&quot; + value would prove problematic if we were to
363 # allow &quot;_&quot; in a future release.
364 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400365 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700366 &quot;endpointUris&quot;: [ # Deprecated. This field is not populated.
367 &quot;A String&quot;,
368 ],
369 &quot;displayName&quot;: &quot;A String&quot;, # Required. The descriptive name for this instance as it appears in UIs.
370 # Must be unique per project and between 4 and 30 characters in length.
371 &quot;nodeCount&quot;: 42, # The number of nodes allocated to this instance. This
372 # may be zero in API responses for instances that are not yet in state
373 # `READY`.
374 #
375 # See [the
376 # documentation](https://cloud.google.com/spanner/docs/instances#node_count)
377 # for more information about nodes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700378 &quot;state&quot;: &quot;A String&quot;, # Output only. The current instance state. For
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400379 # CreateInstance, the state must be
380 # either omitted or set to `CREATING`. For
381 # UpdateInstance, the state must be
382 # either omitted or set to `READY`.
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;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700503 #
504 # If the condition evaluates to `true`, then this binding applies to the
505 # current request.
506 #
507 # If the condition evaluates to `false`, then this binding does not apply to
508 # the current request. However, a different role binding might grant the same
509 # role to one or more of the members in this binding.
510 #
511 # To learn which resources support conditions in their IAM policies, see the
512 # [IAM
513 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim65020912020-05-20 12:08:20 -0700514 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
515 # are documented at https://github.com/google/cel-spec.
516 #
517 # Example (Comparison):
518 #
519 # title: &quot;Summary size limit&quot;
520 # description: &quot;Determines if a summary is less than 100 chars&quot;
521 # expression: &quot;document.summary.size() &lt; 100&quot;
522 #
523 # Example (Equality):
524 #
525 # title: &quot;Requestor is owner&quot;
526 # description: &quot;Determines if requestor is the document owner&quot;
527 # expression: &quot;document.owner == request.auth.claims.email&quot;
528 #
529 # Example (Logic):
530 #
531 # title: &quot;Public documents&quot;
532 # description: &quot;Determine whether the document should be publicly visible&quot;
533 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
534 #
535 # Example (Data Manipulation):
536 #
537 # title: &quot;Notification string&quot;
538 # description: &quot;Create a notification string with a timestamp.&quot;
539 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
540 #
541 # The exact variables and functions that may be referenced within an expression
542 # are determined by the service that evaluates it. See the service
543 # documentation for additional information.
544 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
545 # reporting, e.g. a file name and a position in the file.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700546 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
547 # syntax.
548 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
549 # describes the expression, e.g. when hovered over it in a UI.
Bu Sun Kim65020912020-05-20 12:08:20 -0700550 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
551 # its purpose. This can be used e.g. in UIs which allow to enter the
552 # expression.
Bu Sun Kim65020912020-05-20 12:08:20 -0700553 },
554 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400555 # `members` can have the following values:
556 #
557 # * `allUsers`: A special identifier that represents anyone who is
558 # on the internet; with or without a Google account.
559 #
560 # * `allAuthenticatedUsers`: A special identifier that represents anyone
561 # who is authenticated with a Google account or a service account.
562 #
563 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -0700564 # account. For example, `alice@example.com` .
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400565 #
566 #
567 # * `serviceAccount:{emailid}`: An email address that represents a service
568 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
569 #
570 # * `group:{emailid}`: An email address that represents a Google group.
571 # For example, `admins@example.com`.
572 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700573 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
574 # identifier) representing a user that has been recently deleted. For
575 # example, `alice@example.com?uid=123456789012345678901`. If the user is
576 # recovered, this value reverts to `user:{emailid}` and the recovered user
577 # retains the role in the binding.
578 #
579 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
580 # unique identifier) representing a service account that has been recently
581 # deleted. For example,
582 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
583 # If the service account is undeleted, this value reverts to
584 # `serviceAccount:{emailid}` and the undeleted service account retains the
585 # role in the binding.
586 #
587 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
588 # identifier) representing a Google group that has been recently
589 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
590 # the group is recovered, this value reverts to `group:{emailid}` and the
591 # recovered group retains the role in the binding.
592 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700593 #
594 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400595 # users of that domain. For example, `google.com` or `example.com`.
596 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700597 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400598 ],
599 },
600 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700601 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
602 # prevent simultaneous updates of a policy from overwriting each other.
603 # It is strongly suggested that systems make use of the `etag` in the
604 # read-modify-write cycle to perform policy updates in order to avoid race
605 # conditions: An `etag` is returned in the response to `getIamPolicy`, and
606 # systems are expected to put that etag in the request to `setIamPolicy` to
607 # ensure that their change will be applied to the same version of the policy.
608 #
609 # **Important:** If you use IAM Conditions, you must include the `etag` field
610 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
611 # you to overwrite a version `3` policy with a version `1` policy, and all of
612 # the conditions in the version `3` policy are lost.
613 &quot;version&quot;: 42, # Specifies the format of the policy.
614 #
615 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
616 # are rejected.
617 #
618 # Any operation that affects conditional role bindings must specify version
619 # `3`. This requirement applies to the following operations:
620 #
621 # * Getting a policy that includes a conditional role binding
622 # * Adding a conditional role binding to a policy
623 # * Changing a conditional role binding in a policy
624 # * Removing any role binding, with or without a condition, from a policy
625 # that includes conditions
626 #
627 # **Important:** If you use IAM Conditions, you must include the `etag` field
628 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
629 # you to overwrite a version `3` policy with a version `1` policy, and all of
630 # the conditions in the version `3` policy are lost.
631 #
632 # If a policy does not include any conditions, operations on that policy may
633 # specify any valid version or leave the field unset.
634 #
635 # To learn which resources support conditions in their IAM policies, see the
636 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400637 }</pre>
638</div>
639
640<div class="method">
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700641 <code class="details" id="list">list(parent, pageToken=None, filter=None, pageSize=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 Kim4ed7d3f2020-05-27 12:20:54 -0700647 pageToken: string, If non-empty, `page_token` should contain a
648next_page_token from a
649previous ListInstancesResponse.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700650 filter: string, An expression for filtering the results of the request. Filter rules are
651case insensitive. The fields eligible for filtering are:
652
653 * `name`
654 * `display_name`
655 * `labels.key` where key is the name of a label
656
657Some examples of using filters are:
658
Dan O'Mearadd494642020-05-01 07:42:23 -0700659 * `name:*` --&gt; The instance has a name.
Bu Sun Kim65020912020-05-20 12:08:20 -0700660 * `name:Howl` --&gt; The instance&#x27;s name contains the string &quot;howl&quot;.
Dan O'Mearadd494642020-05-01 07:42:23 -0700661 * `name:HOWL` --&gt; Equivalent to above.
662 * `NAME:howl` --&gt; Equivalent to above.
Bu Sun Kim65020912020-05-20 12:08:20 -0700663 * `labels.env:*` --&gt; The instance has the label &quot;env&quot;.
664 * `labels.env:dev` --&gt; The instance has the label &quot;env&quot; and the value of
665 the label contains the string &quot;dev&quot;.
666 * `name:howl labels.env:dev` --&gt; The instance&#x27;s name contains &quot;howl&quot; and
667 it has the label &quot;env&quot; with its value
668 containing &quot;dev&quot;.
Bu Sun Kim65020912020-05-20 12:08:20 -0700669 pageSize: integer, Number of instances to be returned in the response. If 0 or less, defaults
670to the server&#x27;s maximum allowed page size.
671 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 Kim65020912020-05-20 12:08:20 -0700680 &quot;instances&quot;: [ # The list of requested instances.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400681 { # An isolated set of Cloud Spanner resources on which databases can be hosted.
Bu Sun Kim65020912020-05-20 12:08:20 -0700682 &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 -0400683 # after the instance is created. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700684 # `projects/&lt;project&gt;/instances/a-z*[a-z0-9]`. The final
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700685 # segment of the name must be between 2 and 64 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700686 &quot;labels&quot;: { # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
687 # resources into groups that reflect a customer&#x27;s organizational needs and
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400688 # deployment strategies. Cloud Labels can be used to filter collections of
689 # resources. They can be used to control how resource metrics are aggregated.
690 # And they can be used as arguments to policy management rules (e.g. route,
691 # firewall, load balancing, etc.).
692 #
693 # * Label keys must be between 1 and 63 characters long and must conform to
694 # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
695 # * Label values must be between 0 and 63 characters long and must conform
696 # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
697 # * No more than 64 labels can be associated with a given resource.
698 #
699 # See https://goo.gl/xmQnxf for more information on and examples of labels.
700 #
701 # If you plan to use labels in your own code, please note that additional
702 # characters may be allowed in the future. And so you are advised to use an
Bu Sun Kim65020912020-05-20 12:08:20 -0700703 # internal label representation, such as JSON, which doesn&#x27;t rely upon
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400704 # specific characters being disallowed. For example, representing labels
Bu Sun Kim65020912020-05-20 12:08:20 -0700705 # as the string: name + &quot;_&quot; + value would prove problematic if we were to
706 # allow &quot;_&quot; in a future release.
707 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400708 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700709 &quot;endpointUris&quot;: [ # Deprecated. This field is not populated.
710 &quot;A String&quot;,
711 ],
712 &quot;displayName&quot;: &quot;A String&quot;, # Required. The descriptive name for this instance as it appears in UIs.
713 # Must be unique per project and between 4 and 30 characters in length.
714 &quot;nodeCount&quot;: 42, # The number of nodes allocated to this instance. This
715 # may be zero in API responses for instances that are not yet in state
716 # `READY`.
717 #
718 # See [the
719 # documentation](https://cloud.google.com/spanner/docs/instances#node_count)
720 # for more information about nodes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700721 &quot;state&quot;: &quot;A String&quot;, # Output only. The current instance state. For
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400722 # CreateInstance, the state must be
723 # either omitted or set to `CREATING`. For
724 # UpdateInstance, the state must be
725 # either omitted or set to `READY`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700726 &quot;config&quot;: &quot;A String&quot;, # Required. The name of the instance&#x27;s configuration. Values are of the form
727 # `projects/&lt;project&gt;/instanceConfigs/&lt;configuration&gt;`. See
728 # also InstanceConfig and
729 # ListInstanceConfigs.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400730 },
731 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700732 &quot;nextPageToken&quot;: &quot;A String&quot;, # `next_page_token` can be sent in a subsequent
733 # ListInstances call to fetch more
734 # of the matching instances.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400735 }</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 Kim65020912020-05-20 12:08:20 -0700804 &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 -0700805 # name. Otherwise, only fields mentioned in field_mask need be included.
Bu Sun Kim65020912020-05-20 12:08:20 -0700806 &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 -0400807 # after the instance is created. Values are of the form
Dan O'Mearadd494642020-05-01 07:42:23 -0700808 # `projects/&lt;project&gt;/instances/a-z*[a-z0-9]`. The final
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700809 # segment of the name must be between 2 and 64 characters in length.
Bu Sun Kim65020912020-05-20 12:08:20 -0700810 &quot;labels&quot;: { # Cloud Labels are a flexible and lightweight mechanism for organizing cloud
811 # resources into groups that reflect a customer&#x27;s organizational needs and
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400812 # deployment strategies. Cloud Labels can be used to filter collections of
813 # resources. They can be used to control how resource metrics are aggregated.
814 # And they can be used as arguments to policy management rules (e.g. route,
815 # firewall, load balancing, etc.).
816 #
817 # * Label keys must be between 1 and 63 characters long and must conform to
818 # the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
819 # * Label values must be between 0 and 63 characters long and must conform
820 # to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
821 # * No more than 64 labels can be associated with a given resource.
822 #
823 # See https://goo.gl/xmQnxf for more information on and examples of labels.
824 #
825 # If you plan to use labels in your own code, please note that additional
826 # characters may be allowed in the future. And so you are advised to use an
Bu Sun Kim65020912020-05-20 12:08:20 -0700827 # internal label representation, such as JSON, which doesn&#x27;t rely upon
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400828 # specific characters being disallowed. For example, representing labels
Bu Sun Kim65020912020-05-20 12:08:20 -0700829 # as the string: name + &quot;_&quot; + value would prove problematic if we were to
830 # allow &quot;_&quot; in a future release.
831 &quot;a_key&quot;: &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400832 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700833 &quot;endpointUris&quot;: [ # Deprecated. This field is not populated.
834 &quot;A String&quot;,
835 ],
836 &quot;displayName&quot;: &quot;A String&quot;, # Required. The descriptive name for this instance as it appears in UIs.
837 # Must be unique per project and between 4 and 30 characters in length.
838 &quot;nodeCount&quot;: 42, # The number of nodes allocated to this instance. This
839 # may be zero in API responses for instances that are not yet in state
840 # `READY`.
841 #
842 # See [the
843 # documentation](https://cloud.google.com/spanner/docs/instances#node_count)
844 # for more information about nodes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700845 &quot;state&quot;: &quot;A String&quot;, # Output only. The current instance state. For
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400846 # CreateInstance, the state must be
847 # either omitted or set to `CREATING`. For
848 # UpdateInstance, the state must be
849 # either omitted or set to `READY`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700850 &quot;config&quot;: &quot;A String&quot;, # Required. The name of the instance&#x27;s configuration. Values are of the form
851 # `projects/&lt;project&gt;/instanceConfigs/&lt;configuration&gt;`. See
852 # also InstanceConfig and
853 # ListInstanceConfigs.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400854 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700855 &quot;fieldMask&quot;: &quot;A String&quot;, # Required. A mask specifying which fields in Instance should be updated.
856 # The field mask must always be specified; this prevents any future fields in
857 # Instance from being erased accidentally by clients that do not know
858 # about them.
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 Kim4ed7d3f2020-05-27 12:20:54 -0700871 &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.
872 # different programming environments, including REST APIs and RPC APIs. It is
873 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
874 # three pieces of data: error code, error message, and error details.
875 #
876 # You can find out more about this error model and how to work with it in the
877 # [API Design Guide](https://cloud.google.com/apis/design/errors).
878 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
879 # message types for APIs to use.
880 {
881 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
882 },
883 ],
884 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
885 # user-facing error message should be localized and sent in the
886 # google.rpc.Status.details field, or localized by the client.
887 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
888 },
889 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically
890 # contains progress information and common metadata such as create time.
891 # Some services might not provide such metadata. Any method that returns a
892 # long-running operation should document the metadata type, if any.
893 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
894 },
895 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that
896 # originally returns it. If you use the default HTTP mapping, the
897 # `name` should be a resource name ending with `operations/{unique_id}`.
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;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001005 #
1006 # If the condition evaluates to `true`, then this binding applies to the
1007 # current request.
1008 #
1009 # If the condition evaluates to `false`, then this binding does not apply to
1010 # the current request. However, a different role binding might grant the same
1011 # role to one or more of the members in this binding.
1012 #
1013 # To learn which resources support conditions in their IAM policies, see the
1014 # [IAM
1015 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim65020912020-05-20 12:08:20 -07001016 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
1017 # are documented at https://github.com/google/cel-spec.
1018 #
1019 # Example (Comparison):
1020 #
1021 # title: &quot;Summary size limit&quot;
1022 # description: &quot;Determines if a summary is less than 100 chars&quot;
1023 # expression: &quot;document.summary.size() &lt; 100&quot;
1024 #
1025 # Example (Equality):
1026 #
1027 # title: &quot;Requestor is owner&quot;
1028 # description: &quot;Determines if requestor is the document owner&quot;
1029 # expression: &quot;document.owner == request.auth.claims.email&quot;
1030 #
1031 # Example (Logic):
1032 #
1033 # title: &quot;Public documents&quot;
1034 # description: &quot;Determine whether the document should be publicly visible&quot;
1035 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1036 #
1037 # Example (Data Manipulation):
1038 #
1039 # title: &quot;Notification string&quot;
1040 # description: &quot;Create a notification string with a timestamp.&quot;
1041 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1042 #
1043 # The exact variables and functions that may be referenced within an expression
1044 # are determined by the service that evaluates it. See the service
1045 # documentation for additional information.
1046 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
1047 # reporting, e.g. a file name and a position in the file.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001048 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
1049 # syntax.
1050 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
1051 # describes the expression, e.g. when hovered over it in a UI.
Bu Sun Kim65020912020-05-20 12:08:20 -07001052 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
1053 # its purpose. This can be used e.g. in UIs which allow to enter the
1054 # expression.
Bu Sun Kim65020912020-05-20 12:08:20 -07001055 },
1056 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001057 # `members` can have the following values:
1058 #
1059 # * `allUsers`: A special identifier that represents anyone who is
1060 # on the internet; with or without a Google account.
1061 #
1062 # * `allAuthenticatedUsers`: A special identifier that represents anyone
1063 # who is authenticated with a Google account or a service account.
1064 #
1065 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -07001066 # account. For example, `alice@example.com` .
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001067 #
1068 #
1069 # * `serviceAccount:{emailid}`: An email address that represents a service
1070 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
1071 #
1072 # * `group:{emailid}`: An email address that represents a Google group.
1073 # For example, `admins@example.com`.
1074 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001075 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
1076 # identifier) representing a user that has been recently deleted. For
1077 # example, `alice@example.com?uid=123456789012345678901`. If the user is
1078 # recovered, this value reverts to `user:{emailid}` and the recovered user
1079 # retains the role in the binding.
1080 #
1081 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
1082 # unique identifier) representing a service account that has been recently
1083 # deleted. For example,
1084 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
1085 # If the service account is undeleted, this value reverts to
1086 # `serviceAccount:{emailid}` and the undeleted service account retains the
1087 # role in the binding.
1088 #
1089 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
1090 # identifier) representing a Google group that has been recently
1091 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
1092 # the group is recovered, this value reverts to `group:{emailid}` and the
1093 # recovered group retains the role in the binding.
1094 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001095 #
1096 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001097 # users of that domain. For example, `google.com` or `example.com`.
1098 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001099 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001100 ],
1101 },
1102 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001103 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
1104 # prevent simultaneous updates of a policy from overwriting each other.
1105 # It is strongly suggested that systems make use of the `etag` in the
1106 # read-modify-write cycle to perform policy updates in order to avoid race
1107 # conditions: An `etag` is returned in the response to `getIamPolicy`, and
1108 # systems are expected to put that etag in the request to `setIamPolicy` to
1109 # ensure that their change will be applied to the same version of the policy.
1110 #
1111 # **Important:** If you use IAM Conditions, you must include the `etag` field
1112 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1113 # you to overwrite a version `3` policy with a version `1` policy, and all of
1114 # the conditions in the version `3` policy are lost.
1115 &quot;version&quot;: 42, # Specifies the format of the policy.
1116 #
1117 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
1118 # are rejected.
1119 #
1120 # Any operation that affects conditional role bindings must specify version
1121 # `3`. This requirement applies to the following operations:
1122 #
1123 # * Getting a policy that includes a conditional role binding
1124 # * Adding a conditional role binding to a policy
1125 # * Changing a conditional role binding in a policy
1126 # * Removing any role binding, with or without a condition, from a policy
1127 # that includes conditions
1128 #
1129 # **Important:** If you use IAM Conditions, you must include the `etag` field
1130 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1131 # you to overwrite a version `3` policy with a version `1` policy, and all of
1132 # the conditions in the version `3` policy are lost.
1133 #
1134 # If a policy does not include any conditions, operations on that policy may
1135 # specify any valid version or leave the field unset.
1136 #
1137 # To learn which resources support conditions in their IAM policies, see the
1138 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
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;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001224 #
1225 # If the condition evaluates to `true`, then this binding applies to the
1226 # current request.
1227 #
1228 # If the condition evaluates to `false`, then this binding does not apply to
1229 # the current request. However, a different role binding might grant the same
1230 # role to one or more of the members in this binding.
1231 #
1232 # To learn which resources support conditions in their IAM policies, see the
1233 # [IAM
1234 # documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim65020912020-05-20 12:08:20 -07001235 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
1236 # are documented at https://github.com/google/cel-spec.
1237 #
1238 # Example (Comparison):
1239 #
1240 # title: &quot;Summary size limit&quot;
1241 # description: &quot;Determines if a summary is less than 100 chars&quot;
1242 # expression: &quot;document.summary.size() &lt; 100&quot;
1243 #
1244 # Example (Equality):
1245 #
1246 # title: &quot;Requestor is owner&quot;
1247 # description: &quot;Determines if requestor is the document owner&quot;
1248 # expression: &quot;document.owner == request.auth.claims.email&quot;
1249 #
1250 # Example (Logic):
1251 #
1252 # title: &quot;Public documents&quot;
1253 # description: &quot;Determine whether the document should be publicly visible&quot;
1254 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1255 #
1256 # Example (Data Manipulation):
1257 #
1258 # title: &quot;Notification string&quot;
1259 # description: &quot;Create a notification string with a timestamp.&quot;
1260 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1261 #
1262 # The exact variables and functions that may be referenced within an expression
1263 # are determined by the service that evaluates it. See the service
1264 # documentation for additional information.
1265 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
1266 # reporting, e.g. a file name and a position in the file.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001267 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
1268 # syntax.
1269 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
1270 # describes the expression, e.g. when hovered over it in a UI.
Bu Sun Kim65020912020-05-20 12:08:20 -07001271 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
1272 # its purpose. This can be used e.g. in UIs which allow to enter the
1273 # expression.
Bu Sun Kim65020912020-05-20 12:08:20 -07001274 },
1275 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001276 # `members` can have the following values:
1277 #
1278 # * `allUsers`: A special identifier that represents anyone who is
1279 # on the internet; with or without a Google account.
1280 #
1281 # * `allAuthenticatedUsers`: A special identifier that represents anyone
1282 # who is authenticated with a Google account or a service account.
1283 #
1284 # * `user:{emailid}`: An email address that represents a specific Google
Dan O'Mearadd494642020-05-01 07:42:23 -07001285 # account. For example, `alice@example.com` .
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001286 #
1287 #
1288 # * `serviceAccount:{emailid}`: An email address that represents a service
1289 # account. For example, `my-other-app@appspot.gserviceaccount.com`.
1290 #
1291 # * `group:{emailid}`: An email address that represents a Google group.
1292 # For example, `admins@example.com`.
1293 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001294 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
1295 # identifier) representing a user that has been recently deleted. For
1296 # example, `alice@example.com?uid=123456789012345678901`. If the user is
1297 # recovered, this value reverts to `user:{emailid}` and the recovered user
1298 # retains the role in the binding.
1299 #
1300 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
1301 # unique identifier) representing a service account that has been recently
1302 # deleted. For example,
1303 # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
1304 # If the service account is undeleted, this value reverts to
1305 # `serviceAccount:{emailid}` and the undeleted service account retains the
1306 # role in the binding.
1307 #
1308 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
1309 # identifier) representing a Google group that has been recently
1310 # deleted. For example, `admins@example.com?uid=123456789012345678901`. If
1311 # the group is recovered, this value reverts to `group:{emailid}` and the
1312 # recovered group retains the role in the binding.
1313 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001314 #
1315 # * `domain:{domain}`: The G Suite domain (primary) that represents all the
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001316 # users of that domain. For example, `google.com` or `example.com`.
1317 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001318 &quot;A String&quot;,
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -04001319 ],
1320 },
1321 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001322 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help
1323 # prevent simultaneous updates of a policy from overwriting each other.
1324 # It is strongly suggested that systems make use of the `etag` in the
1325 # read-modify-write cycle to perform policy updates in order to avoid race
1326 # conditions: An `etag` is returned in the response to `getIamPolicy`, and
1327 # systems are expected to put that etag in the request to `setIamPolicy` to
1328 # ensure that their change will be applied to the same version of the policy.
1329 #
1330 # **Important:** If you use IAM Conditions, you must include the `etag` field
1331 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1332 # you to overwrite a version `3` policy with a version `1` policy, and all of
1333 # the conditions in the version `3` policy are lost.
1334 &quot;version&quot;: 42, # Specifies the format of the policy.
1335 #
1336 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value
1337 # are rejected.
1338 #
1339 # Any operation that affects conditional role bindings must specify version
1340 # `3`. This requirement applies to the following operations:
1341 #
1342 # * Getting a policy that includes a conditional role binding
1343 # * Adding a conditional role binding to a policy
1344 # * Changing a conditional role binding in a policy
1345 # * Removing any role binding, with or without a condition, from a policy
1346 # that includes conditions
1347 #
1348 # **Important:** If you use IAM Conditions, you must include the `etag` field
1349 # whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1350 # you to overwrite a version `3` policy with a version `1` policy, and all of
1351 # the conditions in the version `3` policy are lost.
1352 #
1353 # If a policy does not include any conditions, operations on that policy may
1354 # specify any valid version or leave the field unset.
1355 #
1356 # To learn which resources support conditions in their IAM policies, see the
1357 # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
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>