blob: ab24c15050fe13f73f0b653275f230f2664461f5 [file] [log] [blame]
Bu Sun Kim65020912020-05-20 12:08:20 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="spanner_v1.html">Cloud Spanner API</a> . <a href="spanner_v1.projects.html">projects</a> . <a href="spanner_v1.projects.instances.html">instances</a> . <a href="spanner_v1.projects.instances.backups.html">backups</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="spanner_v1.projects.instances.backups.operations.html">operations()</a></code>
79</p>
80<p class="firstline">Returns the operations Resource.</p>
81
82<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070083 <code><a href="#close">close()</a></code></p>
84<p class="firstline">Close httplib2 connections.</p>
85<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070086 <code><a href="#create">create(parent, body=None, backupId=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070087<p class="firstline">Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format `projects//instances//backups//operations/` and can be used to track creation of the backup. The metadata field type is CreateBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the creation and delete the backup. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070088<p class="toc_element">
89 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
90<p class="firstline">Deletes a pending or completed Backup.</p>
91<p class="toc_element">
92 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
93<p class="firstline">Gets metadata on a pending or completed Backup.</p>
94<p class="toc_element">
95 <code><a href="#getIamPolicy">getIamPolicy(resource, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070096<p class="firstline">Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set. Authorization requires `spanner.databases.getIamPolicy` permission on resource. For backups, authorization requires `spanner.backups.getIamPolicy` permission on resource.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -070097<p class="toc_element">
Yoshi Automation Botc2228be2020-11-24 15:48:03 -080098 <code><a href="#list">list(parent, pageToken=None, pageSize=None, filter=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070099<p class="firstline">Lists completed and pending backups. Backups returned are ordered by `create_time` in descending order, starting from the most recent `create_time`.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -0700100<p class="toc_element">
101 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
102<p class="firstline">Retrieves the next page of results.</p>
103<p class="toc_element">
104 <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
105<p class="firstline">Updates a pending or completed Backup.</p>
106<p class="toc_element">
107 <code><a href="#setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700108<p class="firstline">Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires `spanner.databases.setIamPolicy` permission on resource. For backups, authorization requires `spanner.backups.setIamPolicy` permission on resource.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -0700109<p class="toc_element">
110 <code><a href="#testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700111<p class="firstline">Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has `spanner.databases.list` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list` permission on the containing instance.</p>
Bu Sun Kim65020912020-05-20 12:08:20 -0700112<h3>Method Details</h3>
113<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700114 <code class="details" id="close">close()</code>
115 <pre>Close httplib2 connections.</pre>
116</div>
117
118<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700119 <code class="details" id="create">create(parent, body=None, backupId=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700120 <pre>Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format `projects//instances//backups//operations/` and can be used to track creation of the backup. The metadata field type is CreateBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the creation and delete the backup. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently.
Bu Sun Kim65020912020-05-20 12:08:20 -0700121
122Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700123 parent: string, Required. The name of the instance in which the backup will be created. This must be the same instance that contains the database the backup will be created from. The backup will be stored in the location(s) specified in the instance configuration of this instance. Values are of the form `projects//instances/`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700124 body: object, The request body.
125 The object takes the form of:
126
127{ # A backup of a Cloud Spanner database.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800128 &quot;name&quot;: &quot;A String&quot;, # Output only for the CreateBackup operation. Required for the UpdateBackup operation. A globally unique identifier for the backup which cannot be changed. Values are of the form `projects//instances//backups/a-z*[a-z0-9]` The final segment of the name must be between 2 and 60 characters in length. The backup is stored in the location(s) specified in the instance configuration of the instance containing the backup, identified by the prefix of the backup name of the form `projects//instances/`.
129 &quot;expireTime&quot;: &quot;A String&quot;, # Required for the CreateBackup operation. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 366 days from the time the CreateBackup request is processed. Once the `expire_time` has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup.
130 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The backup will contain an externally consistent copy of the database at the timestamp specified by `create_time`. `create_time` is approximately the time the CreateBackup request is received.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700131 &quot;database&quot;: &quot;A String&quot;, # Required for the CreateBackup operation. Name of the database from which this backup was created. This needs to be in the same instance as the backup. Values are of the form `projects//instances//databases/`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800132 &quot;sizeBytes&quot;: &quot;A String&quot;, # Output only. Size of the backup in bytes.
133 &quot;state&quot;: &quot;A String&quot;, # Output only. The current state of the backup.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700134 &quot;referencingDatabases&quot;: [ # Output only. The names of the restored databases that reference the backup. The database names are of the form `projects//instances//databases/`. Referencing databases may exist in different instances. The existence of any referencing database prevents the backup from being deleted. When a restored database from the backup enters the `READY` state, the reference to the backup is removed.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700135 &quot;A String&quot;,
136 ],
137}
Bu Sun Kim65020912020-05-20 12:08:20 -0700138
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700139 backupId: string, Required. The id of the backup to be created. The `backup_id` appended to `parent` forms the full backup name of the form `projects//instances//backups/`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700140 x__xgafv: string, V1 error format.
141 Allowed values
142 1 - v1 error format
143 2 - v2 error format
144
145Returns:
146 An object of the form:
147
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700148 { # This resource represents a long-running operation that is the result of a network API call.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800149 &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
150 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
151 },
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700152 &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800153 &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700154 &quot;response&quot;: { # The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700155 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
156 },
157 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800158 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700159 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700160 {
161 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
162 },
163 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700164 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
165 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700166 }</pre>
167</div>
168
169<div class="method">
170 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
171 <pre>Deletes a pending or completed Backup.
172
173Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700174 name: string, Required. Name of the backup to delete. Values are of the form `projects//instances//backups/`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700175 x__xgafv: string, V1 error format.
176 Allowed values
177 1 - v1 error format
178 2 - v2 error format
179
180Returns:
181 An object of the form:
182
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700183 { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700184 }</pre>
185</div>
186
187<div class="method">
188 <code class="details" id="get">get(name, x__xgafv=None)</code>
189 <pre>Gets metadata on a pending or completed Backup.
190
191Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700192 name: string, Required. Name of the backup. Values are of the form `projects//instances//backups/`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700193 x__xgafv: string, V1 error format.
194 Allowed values
195 1 - v1 error format
196 2 - v2 error format
197
198Returns:
199 An object of the form:
200
201 { # A backup of a Cloud Spanner database.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800202 &quot;name&quot;: &quot;A String&quot;, # Output only for the CreateBackup operation. Required for the UpdateBackup operation. A globally unique identifier for the backup which cannot be changed. Values are of the form `projects//instances//backups/a-z*[a-z0-9]` The final segment of the name must be between 2 and 60 characters in length. The backup is stored in the location(s) specified in the instance configuration of the instance containing the backup, identified by the prefix of the backup name of the form `projects//instances/`.
203 &quot;expireTime&quot;: &quot;A String&quot;, # Required for the CreateBackup operation. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 366 days from the time the CreateBackup request is processed. Once the `expire_time` has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup.
204 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The backup will contain an externally consistent copy of the database at the timestamp specified by `create_time`. `create_time` is approximately the time the CreateBackup request is received.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700205 &quot;database&quot;: &quot;A String&quot;, # Required for the CreateBackup operation. Name of the database from which this backup was created. This needs to be in the same instance as the backup. Values are of the form `projects//instances//databases/`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800206 &quot;sizeBytes&quot;: &quot;A String&quot;, # Output only. Size of the backup in bytes.
207 &quot;state&quot;: &quot;A String&quot;, # Output only. The current state of the backup.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700208 &quot;referencingDatabases&quot;: [ # Output only. The names of the restored databases that reference the backup. The database names are of the form `projects//instances//databases/`. Referencing databases may exist in different instances. The existence of any referencing database prevents the backup from being deleted. When a restored database from the backup enters the `READY` state, the reference to the backup is removed.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700209 &quot;A String&quot;,
210 ],
211 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700212</div>
213
214<div class="method">
215 <code class="details" id="getIamPolicy">getIamPolicy(resource, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700216 <pre>Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set. Authorization requires `spanner.databases.getIamPolicy` permission on resource. For backups, authorization requires `spanner.backups.getIamPolicy` permission on resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700217
218Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700219 resource: string, REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700220 body: object, The request body.
221 The object takes the form of:
222
223{ # Request message for `GetIamPolicy` method.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700224 &quot;options&quot;: { # Encapsulates settings provided to GetIamPolicy. # OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
225 &quot;requestedPolicyVersion&quot;: 42, # Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim65020912020-05-20 12:08:20 -0700226 },
227 }
228
229 x__xgafv: string, V1 error format.
230 Allowed values
231 1 - v1 error format
232 2 - v2 error format
233
234Returns:
235 An object of the form:
236
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700237 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700238 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim65020912020-05-20 12:08:20 -0700239 { # Associates `members` with a `role`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700240 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700241 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700242 &quot;A String&quot;,
243 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700244 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot; Example (Equality): title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot; Example (Logic): title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot; Example (Data Manipulation): title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot; The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. # The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700245 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
246 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700247 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
248 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700249 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700250 },
251 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700252 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
253 &quot;version&quot;: 42, # Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim65020912020-05-20 12:08:20 -0700254 }</pre>
255</div>
256
257<div class="method">
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800258 <code class="details" id="list">list(parent, pageToken=None, pageSize=None, filter=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700259 <pre>Lists completed and pending backups. Backups returned are ordered by `create_time` in descending order, starting from the most recent `create_time`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700260
261Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700262 parent: string, Required. The instance to list backups from. Values are of the form `projects//instances/`. (required)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700263 pageToken: string, If non-empty, `page_token` should contain a next_page_token from a previous ListBackupsResponse to the same `parent` and with the same `filter`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800264 pageSize: integer, Number of backups to be returned in the response. If 0 or less, defaults to the server&#x27;s maximum allowed page size.
265 filter: string, An expression that filters the list of returned backups. A filter expression consists of a field name, a comparison operator, and a value for filtering. The value must be a string, a number, or a boolean. The comparison operator must be one of: `&lt;`, `&gt;`, `&lt;=`, `&gt;=`, `!=`, `=`, or `:`. Colon `:` is the contains operator. Filter rules are not case sensitive. The following fields in the Backup are eligible for filtering: * `name` * `database` * `state` * `create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * `expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * `size_bytes` You can combine multiple expressions by enclosing each expression in parentheses. By default, expressions are combined with AND logic, but you can specify AND, OR, and NOT logic explicitly. Here are a few examples: * `name:Howl` - The backup&#x27;s name contains the string &quot;howl&quot;. * `database:prod` - The database&#x27;s name contains the string &quot;prod&quot;. * `state:CREATING` - The backup is pending creation. * `state:READY` - The backup is fully created and ready for use. * `(name:howl) AND (create_time &lt; \&quot;2018-03-28T14:50:00Z\&quot;)` - The backup name contains the string &quot;howl&quot; and `create_time` of the backup is before 2018-03-28T14:50:00Z. * `expire_time &lt; \&quot;2018-03-28T14:50:00Z\&quot;` - The backup `expire_time` is before 2018-03-28T14:50:00Z. * `size_bytes &gt; 10000000000` - The backup&#x27;s size is greater than 10GB
Bu Sun Kim65020912020-05-20 12:08:20 -0700266 x__xgafv: string, V1 error format.
267 Allowed values
268 1 - v1 error format
269 2 - v2 error format
270
271Returns:
272 An object of the form:
273
274 { # The response for ListBackups.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700275 &quot;nextPageToken&quot;: &quot;A String&quot;, # `next_page_token` can be sent in a subsequent ListBackups call to fetch more of the matching backups.
276 &quot;backups&quot;: [ # The list of matching backups. Backups returned are ordered by `create_time` in descending order, starting from the most recent `create_time`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700277 { # A backup of a Cloud Spanner database.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800278 &quot;name&quot;: &quot;A String&quot;, # Output only for the CreateBackup operation. Required for the UpdateBackup operation. A globally unique identifier for the backup which cannot be changed. Values are of the form `projects//instances//backups/a-z*[a-z0-9]` The final segment of the name must be between 2 and 60 characters in length. The backup is stored in the location(s) specified in the instance configuration of the instance containing the backup, identified by the prefix of the backup name of the form `projects//instances/`.
279 &quot;expireTime&quot;: &quot;A String&quot;, # Required for the CreateBackup operation. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 366 days from the time the CreateBackup request is processed. Once the `expire_time` has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup.
280 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The backup will contain an externally consistent copy of the database at the timestamp specified by `create_time`. `create_time` is approximately the time the CreateBackup request is received.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700281 &quot;database&quot;: &quot;A String&quot;, # Required for the CreateBackup operation. Name of the database from which this backup was created. This needs to be in the same instance as the backup. Values are of the form `projects//instances//databases/`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800282 &quot;sizeBytes&quot;: &quot;A String&quot;, # Output only. Size of the backup in bytes.
283 &quot;state&quot;: &quot;A String&quot;, # Output only. The current state of the backup.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700284 &quot;referencingDatabases&quot;: [ # Output only. The names of the restored databases that reference the backup. The database names are of the form `projects//instances//databases/`. Referencing databases may exist in different instances. The existence of any referencing database prevents the backup from being deleted. When a restored database from the backup enters the `READY` state, the reference to the backup is removed.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700285 &quot;A String&quot;,
286 ],
287 },
288 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700289 }</pre>
290</div>
291
292<div class="method">
293 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
294 <pre>Retrieves the next page of results.
295
296Args:
297 previous_request: The request for the previous page. (required)
298 previous_response: The response from the request for the previous page. (required)
299
300Returns:
301 A request object that you can call &#x27;execute()&#x27; on to request the next
302 page. Returns None if there are no more items in the collection.
303 </pre>
304</div>
305
306<div class="method">
307 <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
308 <pre>Updates a pending or completed Backup.
309
310Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700311 name: string, Output only for the CreateBackup operation. Required for the UpdateBackup operation. A globally unique identifier for the backup which cannot be changed. Values are of the form `projects//instances//backups/a-z*[a-z0-9]` The final segment of the name must be between 2 and 60 characters in length. The backup is stored in the location(s) specified in the instance configuration of the instance containing the backup, identified by the prefix of the backup name of the form `projects//instances/`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700312 body: object, The request body.
313 The object takes the form of:
314
315{ # A backup of a Cloud Spanner database.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800316 &quot;name&quot;: &quot;A String&quot;, # Output only for the CreateBackup operation. Required for the UpdateBackup operation. A globally unique identifier for the backup which cannot be changed. Values are of the form `projects//instances//backups/a-z*[a-z0-9]` The final segment of the name must be between 2 and 60 characters in length. The backup is stored in the location(s) specified in the instance configuration of the instance containing the backup, identified by the prefix of the backup name of the form `projects//instances/`.
317 &quot;expireTime&quot;: &quot;A String&quot;, # Required for the CreateBackup operation. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 366 days from the time the CreateBackup request is processed. Once the `expire_time` has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup.
318 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The backup will contain an externally consistent copy of the database at the timestamp specified by `create_time`. `create_time` is approximately the time the CreateBackup request is received.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700319 &quot;database&quot;: &quot;A String&quot;, # Required for the CreateBackup operation. Name of the database from which this backup was created. This needs to be in the same instance as the backup. Values are of the form `projects//instances//databases/`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800320 &quot;sizeBytes&quot;: &quot;A String&quot;, # Output only. Size of the backup in bytes.
321 &quot;state&quot;: &quot;A String&quot;, # Output only. The current state of the backup.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700322 &quot;referencingDatabases&quot;: [ # Output only. The names of the restored databases that reference the backup. The database names are of the form `projects//instances//databases/`. Referencing databases may exist in different instances. The existence of any referencing database prevents the backup from being deleted. When a restored database from the backup enters the `READY` state, the reference to the backup is removed.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700323 &quot;A String&quot;,
324 ],
325}
Bu Sun Kim65020912020-05-20 12:08:20 -0700326
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700327 updateMask: string, Required. A mask specifying which fields (e.g. `expire_time`) in the Backup resource should be updated. This mask is relative to the Backup resource, not to the request message. The field mask must always be specified; this prevents any future fields from being erased accidentally by clients that do not know about them.
Bu Sun Kim65020912020-05-20 12:08:20 -0700328 x__xgafv: string, V1 error format.
329 Allowed values
330 1 - v1 error format
331 2 - v2 error format
332
333Returns:
334 An object of the form:
335
336 { # A backup of a Cloud Spanner database.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800337 &quot;name&quot;: &quot;A String&quot;, # Output only for the CreateBackup operation. Required for the UpdateBackup operation. A globally unique identifier for the backup which cannot be changed. Values are of the form `projects//instances//backups/a-z*[a-z0-9]` The final segment of the name must be between 2 and 60 characters in length. The backup is stored in the location(s) specified in the instance configuration of the instance containing the backup, identified by the prefix of the backup name of the form `projects//instances/`.
338 &quot;expireTime&quot;: &quot;A String&quot;, # Required for the CreateBackup operation. The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 366 days from the time the CreateBackup request is processed. Once the `expire_time` has passed, the backup is eligible to be automatically deleted by Cloud Spanner to free the resources used by the backup.
339 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The backup will contain an externally consistent copy of the database at the timestamp specified by `create_time`. `create_time` is approximately the time the CreateBackup request is received.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700340 &quot;database&quot;: &quot;A String&quot;, # Required for the CreateBackup operation. Name of the database from which this backup was created. This needs to be in the same instance as the backup. Values are of the form `projects//instances//databases/`.
Yoshi Automation Botc2228be2020-11-24 15:48:03 -0800341 &quot;sizeBytes&quot;: &quot;A String&quot;, # Output only. Size of the backup in bytes.
342 &quot;state&quot;: &quot;A String&quot;, # Output only. The current state of the backup.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700343 &quot;referencingDatabases&quot;: [ # Output only. The names of the restored databases that reference the backup. The database names are of the form `projects//instances//databases/`. Referencing databases may exist in different instances. The existence of any referencing database prevents the backup from being deleted. When a restored database from the backup enters the `READY` state, the reference to the backup is removed.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700344 &quot;A String&quot;,
345 ],
346 }</pre>
Bu Sun Kim65020912020-05-20 12:08:20 -0700347</div>
348
349<div class="method">
350 <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700351 <pre>Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires `spanner.databases.setIamPolicy` permission on resource. For backups, authorization requires `spanner.backups.setIamPolicy` permission on resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700352
353Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700354 resource: string, REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700355 body: object, The request body.
356 The object takes the form of:
357
358{ # Request message for `SetIamPolicy` method.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700359 &quot;policy&quot;: { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/). # REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700360 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim65020912020-05-20 12:08:20 -0700361 { # Associates `members` with a `role`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700362 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700363 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700364 &quot;A String&quot;,
365 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700366 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot; Example (Equality): title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot; Example (Logic): title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot; Example (Data Manipulation): title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot; The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. # The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700367 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
368 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700369 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
370 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700371 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700372 },
373 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700374 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
375 &quot;version&quot;: 42, # Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim65020912020-05-20 12:08:20 -0700376 },
377 }
378
379 x__xgafv: string, V1 error format.
380 Allowed values
381 1 - v1 error format
382 2 - v2 error format
383
384Returns:
385 An object of the form:
386
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700387 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 } **YAML example:** bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3 For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700388 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim65020912020-05-20 12:08:20 -0700389 { # Associates `members` with a `role`.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700390 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700391 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700392 &quot;A String&quot;,
393 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700394 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot; Example (Equality): title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot; Example (Logic): title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot; Example (Data Manipulation): title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot; The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. # The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700395 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
396 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700397 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
398 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700399 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700400 },
401 ],
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700402 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
403 &quot;version&quot;: 42, # Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim65020912020-05-20 12:08:20 -0700404 }</pre>
405</div>
406
407<div class="method">
408 <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700409 <pre>Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has `spanner.databases.list` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has `spanner.backups.list` permission on the containing instance.
Bu Sun Kim65020912020-05-20 12:08:20 -0700410
411Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700412 resource: string, REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700413 body: object, The request body.
414 The object takes the form of:
415
416{ # Request message for `TestIamPermissions` method.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700417 &quot;permissions&quot;: [ # REQUIRED: The set of permissions to check for &#x27;resource&#x27;. Permissions with wildcards (such as &#x27;*&#x27;, &#x27;spanner.*&#x27;, &#x27;spanner.instances.*&#x27;) are not allowed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700418 &quot;A String&quot;,
419 ],
420 }
421
422 x__xgafv: string, V1 error format.
423 Allowed values
424 1 - v1 error format
425 2 - v2 error format
426
427Returns:
428 An object of the form:
429
430 { # Response message for `TestIamPermissions` method.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700431 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700432 &quot;A String&quot;,
433 ],
434 }</pre>
435</div>
436
437</body></html>