blob: 685048c73b505a980f0e7a7e471824ea89ae09e9 [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> . <a href="spanner_v1.projects.instances.databases.html">databases</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="spanner_v1.projects.instances.databases.operations.html">operations()</a></code>
79</p>
80<p class="firstline">Returns the operations Resource.</p>
81
82<p class="toc_element">
83 <code><a href="spanner_v1.projects.instances.databases.sessions.html">sessions()</a></code>
84</p>
85<p class="firstline">Returns the sessions Resource.</p>
86
87<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070088 <code><a href="#close">close()</a></code></p>
89<p class="firstline">Close httplib2 connections.</p>
90<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070091 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070092<p class="firstline">Creates a new Cloud Spanner database and starts to prepare it for serving. The returned long-running operation will have a name of the format `/operations/` and can be used to track preparation of the database. The metadata field type is CreateDatabaseMetadata. The response field type is Database, if successful.</p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040093<p class="toc_element">
94 <code><a href="#dropDatabase">dropDatabase(database, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070095<p class="firstline">Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their `expire_time`.</p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040096<p class="toc_element">
Thomas Coffee2f245372017-03-27 10:39:26 -070097 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040098<p class="firstline">Gets the state of a Cloud Spanner database.</p>
99<p class="toc_element">
100 <code><a href="#getDdl">getDdl(database, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700101<p class="firstline">Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the Operations API.</p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400102<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700103 <code><a href="#getIamPolicy">getIamPolicy(resource, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700104<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>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400105<p class="toc_element">
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800106 <code><a href="#list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400107<p class="firstline">Lists Cloud Spanner databases.</p>
108<p class="toc_element">
109 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
110<p class="firstline">Retrieves the next page of results.</p>
111<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700112 <code><a href="#restore">restore(parent, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700113<p class="firstline">Create a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance configuration as the instance containing the backup. The returned database long-running operation has a name of the format `projects//instances//databases//operations/`, and can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type is Database, if successful. Cancelling the returned operation will stop the restore and delete the database. There can be only one database being restored into an instance at a time. Once the restore operation completes, a new restore operation can be initiated, without waiting for the optimize operation associated with the first restore to complete.</p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400114<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700115 <code><a href="#setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700116<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>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400117<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700118 <code><a href="#testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700119<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>
Dan O'Mearadd494642020-05-01 07:42:23 -0700120<p class="toc_element">
121 <code><a href="#updateDdl">updateDdl(database, body=None, x__xgafv=None)</a></code></p>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700122<p class="firstline">Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned long-running operation will have a name of the format `/operations/` and can be used to track execution of the schema change(s). The metadata field type is UpdateDatabaseDdlMetadata. The operation has no response.</p>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400123<h3>Method Details</h3>
124<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700125 <code class="details" id="close">close()</code>
126 <pre>Close httplib2 connections.</pre>
127</div>
128
129<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700130 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700131 <pre>Creates a new Cloud Spanner database and starts to prepare it for serving. The returned long-running operation will have a name of the format `/operations/` and can be used to track preparation of the database. The metadata field type is CreateDatabaseMetadata. The response field type is Database, if successful.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400132
133Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700134 parent: string, Required. The name of the instance that will serve the new database. Values are of the form `projects//instances/`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700135 body: object, The request body.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400136 The object takes the form of:
137
138{ # The request for CreateDatabase.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800139 &quot;createStatement&quot;: &quot;A String&quot;, # Required. A `CREATE DATABASE` statement, which specifies the ID of the new database. The database ID must conform to the regular expression `a-z*[a-z0-9]` and be between 2 and 30 characters in length. If the database ID is a reserved word or if it contains a hyphen, the database ID must be enclosed in backticks (`` ` ``).
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800140 &quot;encryptionConfig&quot;: { # Encryption configuration for a Cloud Spanner database. # Optional. The encryption configuration for the database. If this field is not specified, Cloud Spanner will encrypt/decrypt all data at rest using Google default encryption.
141 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form `projects//locations//keyRings//cryptoKeys/`.
142 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800143 &quot;extraStatements&quot;: [ # Optional. A list of DDL statements to run inside the newly created database. Statements can create tables, indexes, etc. These statements execute atomically with the creation of the database: if there is an error in any statement, the database is not created.
144 &quot;A String&quot;,
145 ],
146}
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400147
148 x__xgafv: string, V1 error format.
149 Allowed values
150 1 - v1 error format
151 2 - v2 error format
152
153Returns:
154 An object of the form:
155
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700156 { # This resource represents a long-running operation that is the result of a network API call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800157 &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.
158 &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.
159 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
160 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
161 {
162 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
163 },
164 ],
165 &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.
166 },
167 &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.
168 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
169 },
170 &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}`.
171 &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`.
172 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
173 },
174}</pre>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400175</div>
176
177<div class="method">
178 <code class="details" id="dropDatabase">dropDatabase(database, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700179 <pre>Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their `expire_time`.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400180
181Args:
182 database: string, Required. The database to be dropped. (required)
183 x__xgafv: string, V1 error format.
184 Allowed values
185 1 - v1 error format
186 2 - v2 error format
187
188Returns:
189 An object of the form:
190
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700191 { # 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 `{}`.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800192}</pre>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400193</div>
194
195<div class="method">
Thomas Coffee2f245372017-03-27 10:39:26 -0700196 <code class="details" id="get">get(name, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400197 <pre>Gets the state of a Cloud Spanner database.
198
199Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700200 name: string, Required. The name of the requested database. Values are of the form `projects//instances//databases/`. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400201 x__xgafv: string, V1 error format.
202 Allowed values
203 1 - v1 error format
204 2 - v2 error format
205
206Returns:
207 An object of the form:
208
209 { # A Cloud Spanner database.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800210 &quot;createTime&quot;: &quot;A String&quot;, # Output only. If exists, the time at which the database creation started.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800211 &quot;earliestVersionTime&quot;: &quot;A String&quot;, # Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
212 &quot;encryptionConfig&quot;: { # Encryption configuration for a Cloud Spanner database. # Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
213 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form `projects//locations//keyRings//cryptoKeys/`.
214 },
215 &quot;encryptionInfo&quot;: [ # Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as encryption state and the Cloud KMS key versions that are in use. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
216 { # Encryption information for a Cloud Spanner database or backup.
217 &quot;encryptionStatus&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). # Output only. If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
218 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
219 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
220 {
221 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
222 },
223 ],
224 &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.
225 },
226 &quot;encryptionType&quot;: &quot;A String&quot;, # Output only. The type of encryption.
227 &quot;kmsKeyVersion&quot;: &quot;A String&quot;, # Output only. A Cloud KMS key version that is being used to protect the database or backup.
228 },
229 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800230 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the database. Values are of the form `projects//instances//databases/`, where `` is as specified in the `CREATE DATABASE` statement. This name can be passed to other API methods to identify the database.
231 &quot;restoreInfo&quot;: { # Information about the database restore. # Output only. Applicable only for restored databases. Contains information about the restore source.
232 &quot;backupInfo&quot;: { # Information about a backup. # Information about the backup used to restore the database. The backup may no longer exist.
233 &quot;backup&quot;: &quot;A String&quot;, # Name of the backup.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800234 &quot;createTime&quot;: &quot;A String&quot;, # The time the CreateBackup request was received.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800235 &quot;sourceDatabase&quot;: &quot;A String&quot;, # Name of the database the backup was created from.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800236 &quot;versionTime&quot;: &quot;A String&quot;, # The backup contains an externally consistent copy of `source_database` at the timestamp specified by `version_time`. If the CreateBackup request did not specify `version_time`, the `version_time` of the backup is equivalent to the `create_time`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700237 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800238 &quot;sourceType&quot;: &quot;A String&quot;, # The type of the restore source.
239 },
240 &quot;state&quot;: &quot;A String&quot;, # Output only. The current database state.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800241 &quot;versionRetentionPeriod&quot;: &quot;A String&quot;, # Output only. The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800242}</pre>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400243</div>
244
245<div class="method">
246 <code class="details" id="getDdl">getDdl(database, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700247 <pre>Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the Operations API.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400248
249Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700250 database: string, Required. The database whose schema we wish to get. Values are of the form `projects//instances//databases/` (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400251 x__xgafv: string, V1 error format.
252 Allowed values
253 1 - v1 error format
254 2 - v2 error format
255
256Returns:
257 An object of the form:
258
259 { # The response for GetDatabaseDdl.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800260 &quot;statements&quot;: [ # A list of formatted DDL statements defining the schema of the database specified in the request.
261 &quot;A String&quot;,
262 ],
263}</pre>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400264</div>
265
266<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700267 <code class="details" id="getIamPolicy">getIamPolicy(resource, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700268 <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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400269
270Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700271 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 Kim715bd7f2019-06-14 16:50:42 -0700272 body: object, The request body.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400273 The object takes the form of:
274
275{ # Request message for `GetIamPolicy` method.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800276 &quot;options&quot;: { # Encapsulates settings provided to GetIamPolicy. # OPTIONAL: A `GetPolicyOptions` object for specifying options to `GetIamPolicy`.
277 &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).
278 },
279}
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400280
281 x__xgafv: string, V1 error format.
282 Allowed values
283 1 - v1 error format
284 2 - v2 error format
285
286Returns:
287 An object of the form:
288
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700289 { # 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/).
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800290 &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.
291 { # Associates `members` with a `role`.
292 &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).
293 &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.
294 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
295 &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.
296 &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.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400297 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800298 &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`.
299 &quot;A String&quot;,
300 ],
301 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
302 },
303 ],
304 &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.
305 &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).
306}</pre>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400307</div>
308
309<div class="method">
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800310 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</code>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400311 <pre>Lists Cloud Spanner databases.
312
313Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700314 parent: string, Required. The instance whose databases should be listed. Values are of the form `projects//instances/`. (required)
Yoshi Automation Botb6971b02020-11-26 17:16:03 -0800315 pageSize: integer, Number of databases to be returned in the response. If 0 or less, defaults to the server&#x27;s maximum allowed page size.
Yoshi Automation Bot0bf565c2020-12-09 08:56:03 -0800316 pageToken: string, If non-empty, `page_token` should contain a next_page_token from a previous ListDatabasesResponse.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400317 x__xgafv: string, V1 error format.
318 Allowed values
319 1 - v1 error format
320 2 - v2 error format
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400321
322Returns:
323 An object of the form:
324
325 { # The response for ListDatabases.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800326 &quot;databases&quot;: [ # Databases that matched the request.
327 { # A Cloud Spanner database.
328 &quot;createTime&quot;: &quot;A String&quot;, # Output only. If exists, the time at which the database creation started.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800329 &quot;earliestVersionTime&quot;: &quot;A String&quot;, # Output only. Earliest timestamp at which older versions of the data can be read. This value is continuously updated by Cloud Spanner and becomes stale the moment it is queried. If you are using this value to recover data, make sure to account for the time from the moment when the value is queried to the moment when you initiate the recovery.
330 &quot;encryptionConfig&quot;: { # Encryption configuration for a Cloud Spanner database. # Output only. For databases that are using customer managed encryption, this field contains the encryption configuration for the database. For databases that are using Google default or other types of encryption, this field is empty.
331 &quot;kmsKeyName&quot;: &quot;A String&quot;, # The Cloud KMS key to be used for encrypting and decrypting the database. Values are of the form `projects//locations//keyRings//cryptoKeys/`.
332 },
333 &quot;encryptionInfo&quot;: [ # Output only. For databases that are using customer managed encryption, this field contains the encryption information for the database, such as encryption state and the Cloud KMS key versions that are in use. For databases that are using Google default or other types of encryption, this field is empty. This field is propagated lazily from the backend. There might be a delay from when a key version is being used and when it appears in this field.
334 { # Encryption information for a Cloud Spanner database or backup.
335 &quot;encryptionStatus&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). # Output only. If present, the status of a recent encrypt/decrypt call on underlying data for this database or backup. Regardless of status, data is always encrypted at rest.
336 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
337 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
338 {
339 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
340 },
341 ],
342 &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.
343 },
344 &quot;encryptionType&quot;: &quot;A String&quot;, # Output only. The type of encryption.
345 &quot;kmsKeyVersion&quot;: &quot;A String&quot;, # Output only. A Cloud KMS key version that is being used to protect the database or backup.
346 },
347 ],
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800348 &quot;name&quot;: &quot;A String&quot;, # Required. The name of the database. Values are of the form `projects//instances//databases/`, where `` is as specified in the `CREATE DATABASE` statement. This name can be passed to other API methods to identify the database.
349 &quot;restoreInfo&quot;: { # Information about the database restore. # Output only. Applicable only for restored databases. Contains information about the restore source.
350 &quot;backupInfo&quot;: { # Information about a backup. # Information about the backup used to restore the database. The backup may no longer exist.
351 &quot;backup&quot;: &quot;A String&quot;, # Name of the backup.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800352 &quot;createTime&quot;: &quot;A String&quot;, # The time the CreateBackup request was received.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800353 &quot;sourceDatabase&quot;: &quot;A String&quot;, # Name of the database the backup was created from.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800354 &quot;versionTime&quot;: &quot;A String&quot;, # The backup contains an externally consistent copy of `source_database` at the timestamp specified by `version_time`. If the CreateBackup request did not specify `version_time`, the `version_time` of the backup is equivalent to the `create_time`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700355 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800356 &quot;sourceType&quot;: &quot;A String&quot;, # The type of the restore source.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400357 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800358 &quot;state&quot;: &quot;A String&quot;, # Output only. The current database state.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800359 &quot;versionRetentionPeriod&quot;: &quot;A String&quot;, # Output only. The period in which Cloud Spanner retains all versions of data for the database. This is the same as the value of version_retention_period database option set using UpdateDatabaseDdl. Defaults to 1 hour, if not set.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800360 },
361 ],
362 &quot;nextPageToken&quot;: &quot;A String&quot;, # `next_page_token` can be sent in a subsequent ListDatabases call to fetch more of the matching databases.
363}</pre>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400364</div>
365
366<div class="method">
367 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
368 <pre>Retrieves the next page of results.
369
370Args:
371 previous_request: The request for the previous page. (required)
372 previous_response: The response from the request for the previous page. (required)
373
374Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700375 A request object that you can call &#x27;execute()&#x27; on to request the next
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400376 page. Returns None if there are no more items in the collection.
377 </pre>
378</div>
379
380<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700381 <code class="details" id="restore">restore(parent, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700382 <pre>Create a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance configuration as the instance containing the backup. The returned database long-running operation has a name of the format `projects//instances//databases//operations/`, and can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type is Database, if successful. Cancelling the returned operation will stop the restore and delete the database. There can be only one database being restored into an instance at a time. Once the restore operation completes, a new restore operation can be initiated, without waiting for the optimize operation associated with the first restore to complete.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400383
384Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700385 parent: string, Required. The name of the instance in which to create the restored database. This instance must be in the same project and have the same instance configuration as the instance containing the source backup. Values are of the form `projects//instances/`. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700386 body: object, The request body.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400387 The object takes the form of:
388
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700389{ # The request for RestoreDatabase.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800390 &quot;backup&quot;: &quot;A String&quot;, # Name of the backup from which to restore. Values are of the form `projects//instances//backups/`.
391 &quot;databaseId&quot;: &quot;A String&quot;, # Required. The id of the database to create and restore to. This database must not already exist. The `database_id` appended to `parent` forms the full database name of the form `projects//instances//databases/`.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800392 &quot;encryptionConfig&quot;: { # Encryption configuration for the restored database. # Optional. An encryption configuration describing the encryption type and key resources in Cloud KMS used to encrypt/decrypt the database to restore to. If this field is not specified, the restored database will use the same encryption configuration as the backup by default, namely encryption_type = `USE_CONFIG_DEFAULT_OR_DATABASE_ENCRYPTION`.
393 &quot;encryptionType&quot;: &quot;A String&quot;, # Required. The encryption type of the restored database.
394 &quot;kmsKeyName&quot;: &quot;A String&quot;, # Optional. The Cloud KMS key that will be used to encrypt/decrypt the restored database. This field should be set only when encryption_type is `CUSTOMER_MANAGED_ENCRYPTION`. Values are of the form `projects//locations//keyRings//cryptoKeys/`.
395 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800396}
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400397
398 x__xgafv: string, V1 error format.
399 Allowed values
400 1 - v1 error format
401 2 - v2 error format
402
403Returns:
404 An object of the form:
405
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700406 { # This resource represents a long-running operation that is the result of a network API call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800407 &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.
408 &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.
409 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
410 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
411 {
412 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
413 },
414 ],
415 &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.
416 },
417 &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.
418 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
419 },
420 &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}`.
421 &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`.
422 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
423 },
424}</pre>
Dan O'Mearadd494642020-05-01 07:42:23 -0700425</div>
426
427<div class="method">
428 <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700429 <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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700430
431Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700432 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)
Dan O'Mearadd494642020-05-01 07:42:23 -0700433 body: object, The request body.
434 The object takes the form of:
435
436{ # Request message for `SetIamPolicy` method.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800437 &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.
438 &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.
439 { # Associates `members` with a `role`.
440 &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).
441 &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.
442 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
443 &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.
444 &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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700445 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800446 &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`.
447 &quot;A String&quot;,
448 ],
449 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
450 },
451 ],
452 &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.
453 &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).
454 },
455}
Dan O'Mearadd494642020-05-01 07:42:23 -0700456
457 x__xgafv: string, V1 error format.
458 Allowed values
459 1 - v1 error format
460 2 - v2 error format
461
462Returns:
463 An object of the form:
464
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700465 { # 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/).
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800466 &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.
467 { # Associates `members` with a `role`.
468 &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).
469 &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.
470 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
471 &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.
472 &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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700473 },
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800474 &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`.
475 &quot;A String&quot;,
476 ],
477 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
478 },
479 ],
480 &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.
481 &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).
482}</pre>
Dan O'Mearadd494642020-05-01 07:42:23 -0700483</div>
484
485<div class="method">
486 <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700487 <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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700488
489Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700490 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)
Dan O'Mearadd494642020-05-01 07:42:23 -0700491 body: object, The request body.
492 The object takes the form of:
493
494{ # Request message for `TestIamPermissions` method.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800495 &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.
496 &quot;A String&quot;,
497 ],
498}
Dan O'Mearadd494642020-05-01 07:42:23 -0700499
500 x__xgafv: string, V1 error format.
501 Allowed values
502 1 - v1 error format
503 2 - v2 error format
504
505Returns:
506 An object of the form:
507
508 { # Response message for `TestIamPermissions` method.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800509 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
510 &quot;A String&quot;,
511 ],
512}</pre>
Dan O'Mearadd494642020-05-01 07:42:23 -0700513</div>
514
515<div class="method">
516 <code class="details" id="updateDdl">updateDdl(database, body=None, x__xgafv=None)</code>
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700517 <pre>Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned long-running operation will have a name of the format `/operations/` and can be used to track execution of the schema change(s). The metadata field type is UpdateDatabaseDdlMetadata. The operation has no response.
Dan O'Mearadd494642020-05-01 07:42:23 -0700518
519Args:
520 database: string, Required. The database to update. (required)
521 body: object, The request body.
522 The object takes the form of:
523
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700524{ # Enqueues the given DDL statements to be applied, in order but not necessarily all at once, to the database schema at some point (or points) in the future. The server checks that the statements are executable (syntactically valid, name tables that exist, etc.) before enqueueing them, but they may still fail upon later execution (e.g., if a statement from another batch of statements is applied first and it conflicts in some way, or if there is some data-related problem like a `NULL` value in a column to which `NOT NULL` would be added). If a statement fails, all subsequent statements in the batch are automatically cancelled. Each batch of statements is assigned a name which can be used with the Operations API to monitor progress. See the operation_id field for more details.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800525 &quot;operationId&quot;: &quot;A String&quot;, # If empty, the new update request is assigned an automatically-generated operation ID. Otherwise, `operation_id` is used to construct the name of the resulting Operation. Specifying an explicit operation ID simplifies determining whether the statements were executed in the event that the UpdateDatabaseDdl call is replayed, or the return value is otherwise lost: the database and `operation_id` fields can be combined to form the name of the resulting longrunning.Operation: `/operations/`. `operation_id` should be unique within the database, and must be a valid identifier: `a-z*`. Note that automatically-generated operation IDs always begin with an underscore. If the named operation already exists, UpdateDatabaseDdl returns `ALREADY_EXISTS`.
526 &quot;statements&quot;: [ # Required. DDL statements to be applied to the database.
527 &quot;A String&quot;,
528 ],
529}
Dan O'Mearadd494642020-05-01 07:42:23 -0700530
531 x__xgafv: string, V1 error format.
532 Allowed values
533 1 - v1 error format
534 2 - v2 error format
535
536Returns:
537 An object of the form:
538
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700539 { # This resource represents a long-running operation that is the result of a network API call.
Yoshi Automation Botcc94ec82021-01-15 07:10:04 -0800540 &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.
541 &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.
542 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
543 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
544 {
545 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
546 },
547 ],
548 &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.
549 },
550 &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.
551 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
552 },
553 &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}`.
554 &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`.
555 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
556 },
557}</pre>
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400558</div>
559
560</body></html>