Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 88 | <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 89 | <p class="firstline">Creates a new Cloud Spanner database and starts to prepare it for serving.</p> |
| 90 | <p class="toc_element"> |
| 91 | <code><a href="#dropDatabase">dropDatabase(database, x__xgafv=None)</a></code></p> |
| 92 | <p class="firstline">Drops (aka deletes) a Cloud Spanner database.</p> |
| 93 | <p class="toc_element"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 94 | <code><a href="#get">get(name, x__xgafv=None)</a></code></p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 95 | <p class="firstline">Gets the state of a Cloud Spanner database.</p> |
| 96 | <p class="toc_element"> |
| 97 | <code><a href="#getDdl">getDdl(database, x__xgafv=None)</a></code></p> |
| 98 | <p class="firstline">Returns the schema of a Cloud Spanner database as a list of formatted</p> |
| 99 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 100 | <code><a href="#getIamPolicy">getIamPolicy(resource, body=None, x__xgafv=None)</a></code></p> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 101 | <p class="firstline">Gets the access control policy for a database or backup resource.</p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 102 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 103 | <code><a href="#list">list(parent, pageToken=None, pageSize=None, x__xgafv=None)</a></code></p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 104 | <p class="firstline">Lists Cloud Spanner databases.</p> |
| 105 | <p class="toc_element"> |
| 106 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 107 | <p class="firstline">Retrieves the next page of results.</p> |
| 108 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 109 | <code><a href="#restore">restore(parent, body=None, x__xgafv=None)</a></code></p> |
| 110 | <p class="firstline">Create a new database by restoring from a completed backup. The new</p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 111 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 112 | <code><a href="#setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</a></code></p> |
| 113 | <p class="firstline">Sets the access control policy on a database or backup resource.</p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 114 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 115 | <code><a href="#testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</a></code></p> |
| 116 | <p class="firstline">Returns permissions that the caller has on the specified database or backup</p> |
| 117 | <p class="toc_element"> |
| 118 | <code><a href="#updateDdl">updateDdl(database, body=None, x__xgafv=None)</a></code></p> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 119 | <p class="firstline">Updates the schema of a Cloud Spanner database by</p> |
| 120 | <h3>Method Details</h3> |
| 121 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 122 | <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 123 | <pre>Creates a new Cloud Spanner database and starts to prepare it for serving. |
| 124 | The returned long-running operation will |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 125 | have a name of the format `<database_name>/operations/<operation_id>` and |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 126 | can be used to track preparation of the database. The |
| 127 | metadata field type is |
| 128 | CreateDatabaseMetadata. The |
| 129 | response field type is |
| 130 | Database, if successful. |
| 131 | |
| 132 | Args: |
| 133 | parent: string, Required. The name of the instance that will serve the new database. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 134 | Values are of the form `projects/<project>/instances/<instance>`. (required) |
| 135 | body: object, The request body. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 136 | The object takes the form of: |
| 137 | |
| 138 | { # The request for CreateDatabase. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 139 | "extraStatements": [ # Optional. A list of DDL statements to run inside the newly created |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 140 | # database. Statements can create tables, indexes, etc. These |
| 141 | # statements execute atomically with the creation of the database: |
| 142 | # if there is an error in any statement, the database is not created. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 143 | "A String", |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 144 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 145 | "createStatement": "A String", # Required. A `CREATE DATABASE` statement, which specifies the ID of the |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 146 | # new database. The database ID must conform to the regular expression |
| 147 | # `a-z*[a-z0-9]` and be between 2 and 30 characters in length. |
Sai Cheemalapati | 4ba8c23 | 2017-06-06 18:46:08 -0400 | [diff] [blame] | 148 | # If the database ID is a reserved word or if it contains a hyphen, the |
| 149 | # database ID must be enclosed in backticks (`` ` ``). |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | x__xgafv: string, V1 error format. |
| 153 | Allowed values |
| 154 | 1 - v1 error format |
| 155 | 2 - v2 error format |
| 156 | |
| 157 | Returns: |
| 158 | An object of the form: |
| 159 | |
| 160 | { # This resource represents a long-running operation that is the result of a |
| 161 | # network API call. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 162 | "error": { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation. |
| 163 | # different programming environments, including REST APIs and RPC APIs. It is |
| 164 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 165 | # three pieces of data: error code, error message, and error details. |
| 166 | # |
| 167 | # You can find out more about this error model and how to work with it in the |
| 168 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 169 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 170 | # message types for APIs to use. |
| 171 | { |
| 172 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 173 | }, |
| 174 | ], |
| 175 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 176 | # user-facing error message should be localized and sent in the |
| 177 | # google.rpc.Status.details field, or localized by the client. |
| 178 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 179 | }, |
| 180 | "metadata": { # Service-specific metadata associated with the operation. It typically |
| 181 | # contains progress information and common metadata such as create time. |
| 182 | # Some services might not provide such metadata. Any method that returns a |
| 183 | # long-running operation should document the metadata type, if any. |
| 184 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 185 | }, |
| 186 | "name": "A String", # The server-assigned name, which is only unique within the same service that |
| 187 | # originally returns it. If you use the default HTTP mapping, the |
| 188 | # `name` should be a resource name ending with `operations/{unique_id}`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 189 | "done": True or False, # If the value is `false`, it means the operation is still in progress. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 190 | # If `true`, the operation is completed, and either `error` or `response` is |
| 191 | # available. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 192 | "response": { # The normal response of the operation in case of success. If the original |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 193 | # method returns no data on success, such as `Delete`, the response is |
| 194 | # `google.protobuf.Empty`. If the original method is standard |
| 195 | # `Get`/`Create`/`Update`, the response should be the resource. For other |
| 196 | # methods, the response should have the type `XxxResponse`, where `Xxx` |
| 197 | # is the original method name. For example, if the original method name |
| 198 | # is `TakeSnapshot()`, the inferred response type is |
| 199 | # `TakeSnapshotResponse`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 200 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 201 | }, |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 202 | }</pre> |
| 203 | </div> |
| 204 | |
| 205 | <div class="method"> |
| 206 | <code class="details" id="dropDatabase">dropDatabase(database, x__xgafv=None)</code> |
| 207 | <pre>Drops (aka deletes) a Cloud Spanner database. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 208 | Completed backups for the database will be retained according to their |
| 209 | `expire_time`. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 210 | |
| 211 | Args: |
| 212 | database: string, Required. The database to be dropped. (required) |
| 213 | x__xgafv: string, V1 error format. |
| 214 | Allowed values |
| 215 | 1 - v1 error format |
| 216 | 2 - v2 error format |
| 217 | |
| 218 | Returns: |
| 219 | An object of the form: |
| 220 | |
| 221 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 222 | # empty messages in your APIs. A typical example is to use it as the request |
| 223 | # or the response type of an API method. For instance: |
| 224 | # |
| 225 | # service Foo { |
| 226 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 227 | # } |
| 228 | # |
| 229 | # The JSON representation for `Empty` is empty JSON object `{}`. |
| 230 | }</pre> |
| 231 | </div> |
| 232 | |
| 233 | <div class="method"> |
Thomas Coffee | 2f24537 | 2017-03-27 10:39:26 -0700 | [diff] [blame] | 234 | <code class="details" id="get">get(name, x__xgafv=None)</code> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 235 | <pre>Gets the state of a Cloud Spanner database. |
| 236 | |
| 237 | Args: |
| 238 | name: string, Required. The name of the requested database. Values are of the form |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 239 | `projects/<project>/instances/<instance>/databases/<database>`. (required) |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 240 | x__xgafv: string, V1 error format. |
| 241 | Allowed values |
| 242 | 1 - v1 error format |
| 243 | 2 - v2 error format |
| 244 | |
| 245 | Returns: |
| 246 | An object of the form: |
| 247 | |
| 248 | { # A Cloud Spanner database. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 249 | "restoreInfo": { # Information about the database restore. # Output only. Applicable only for restored databases. Contains information |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 250 | # about the restore source. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 251 | "backupInfo": { # Information about a backup. # Information about the backup used to restore the database. The backup |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 252 | # may no longer exist. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 253 | "sourceDatabase": "A String", # Name of the database the backup was created from. |
| 254 | "backup": "A String", # Name of the backup. |
| 255 | "createTime": "A String", # The backup contains an externally consistent copy of `source_database` at |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 256 | # the timestamp specified by `create_time`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 257 | }, |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 258 | "sourceType": "A String", # The type of the restore source. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 259 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 260 | "createTime": "A String", # Output only. If exists, the time at which the database creation started. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 261 | "name": "A String", # Required. The name of the database. Values are of the form |
| 262 | # `projects/<project>/instances/<instance>/databases/<database>`, |
| 263 | # where `<database>` is as specified in the `CREATE DATABASE` |
| 264 | # statement. This name can be passed to other API methods to |
| 265 | # identify the database. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 266 | "state": "A String", # Output only. The current database state. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 267 | }</pre> |
| 268 | </div> |
| 269 | |
| 270 | <div class="method"> |
| 271 | <code class="details" id="getDdl">getDdl(database, x__xgafv=None)</code> |
| 272 | <pre>Returns the schema of a Cloud Spanner database as a list of formatted |
| 273 | DDL statements. This method does not show pending schema updates, those may |
| 274 | be queried using the Operations API. |
| 275 | |
| 276 | Args: |
| 277 | database: string, Required. The database whose schema we wish to get. (required) |
| 278 | x__xgafv: string, V1 error format. |
| 279 | Allowed values |
| 280 | 1 - v1 error format |
| 281 | 2 - v2 error format |
| 282 | |
| 283 | Returns: |
| 284 | An object of the form: |
| 285 | |
| 286 | { # The response for GetDatabaseDdl. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 287 | "statements": [ # A list of formatted DDL statements defining the schema of the database |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 288 | # specified in the request. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 289 | "A String", |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 290 | ], |
| 291 | }</pre> |
| 292 | </div> |
| 293 | |
| 294 | <div class="method"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 295 | <code class="details" id="getIamPolicy">getIamPolicy(resource, body=None, x__xgafv=None)</code> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 296 | <pre>Gets the access control policy for a database or backup resource. |
| 297 | Returns an empty policy if a database or backup exists but does not have a |
| 298 | policy set. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 299 | |
| 300 | Authorization requires `spanner.databases.getIamPolicy` permission on |
| 301 | resource. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 302 | For backups, authorization requires `spanner.backups.getIamPolicy` |
| 303 | permission on resource. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 304 | |
| 305 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 306 | resource: string, REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects/<project ID>/instances/<instance ID>` for instance resources and `projects/<project ID>/instances/<instance ID>/databases/<database ID>` for database resources. (required) |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 307 | body: object, The request body. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 308 | The object takes the form of: |
| 309 | |
| 310 | { # Request message for `GetIamPolicy` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 311 | "options": { # Encapsulates settings provided to GetIamPolicy. # OPTIONAL: A `GetPolicyOptions` object for specifying options to |
| 312 | # `GetIamPolicy`. |
| 313 | "requestedPolicyVersion": 42, # Optional. The policy format version to be returned. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 314 | # |
| 315 | # Valid values are 0, 1, and 3. Requests specifying an invalid value will be |
| 316 | # rejected. |
| 317 | # |
| 318 | # Requests for policies with any conditional bindings must specify version 3. |
| 319 | # Policies without any conditional bindings may specify any valid value or |
| 320 | # leave the field unset. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 321 | # |
| 322 | # To learn which resources support conditions in their IAM policies, see the |
| 323 | # [IAM |
| 324 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 325 | }, |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 326 | } |
| 327 | |
| 328 | x__xgafv: string, V1 error format. |
| 329 | Allowed values |
| 330 | 1 - v1 error format |
| 331 | 2 - v2 error format |
| 332 | |
| 333 | Returns: |
| 334 | An object of the form: |
| 335 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 336 | { # An Identity and Access Management (IAM) policy, which specifies access |
| 337 | # controls for Google Cloud resources. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 338 | # |
| 339 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 340 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 341 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 342 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 343 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 344 | # custom role. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 345 | # |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 346 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 347 | # `condition`, which is a logical expression that allows access to a resource |
| 348 | # only if the expression evaluates to `true`. A condition can add constraints |
| 349 | # based on attributes of the request, the resource, or both. To learn which |
| 350 | # resources support conditions in their IAM policies, see the |
| 351 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 352 | # |
| 353 | # **JSON example:** |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 354 | # |
| 355 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 356 | # "bindings": [ |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 357 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 358 | # "role": "roles/resourcemanager.organizationAdmin", |
| 359 | # "members": [ |
| 360 | # "user:mike@example.com", |
| 361 | # "group:admins@example.com", |
| 362 | # "domain:google.com", |
| 363 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 364 | # ] |
| 365 | # }, |
| 366 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 367 | # "role": "roles/resourcemanager.organizationViewer", |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 368 | # "members": [ |
| 369 | # "user:eve@example.com" |
| 370 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 371 | # "condition": { |
| 372 | # "title": "expirable access", |
| 373 | # "description": "Does not grant access after Sep 2020", |
| 374 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 375 | # } |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 376 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 377 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 378 | # "etag": "BwWWja0YfJA=", |
| 379 | # "version": 3 |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 380 | # } |
| 381 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 382 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 383 | # |
| 384 | # bindings: |
| 385 | # - members: |
| 386 | # - user:mike@example.com |
| 387 | # - group:admins@example.com |
| 388 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 389 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 390 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 391 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 392 | # - user:eve@example.com |
| 393 | # role: roles/resourcemanager.organizationViewer |
| 394 | # condition: |
| 395 | # title: expirable access |
| 396 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 397 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 398 | # - etag: BwWWja0YfJA= |
| 399 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 400 | # |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 401 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 402 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 403 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 404 | # `condition` that determines how and when the `bindings` are applied. Each |
| 405 | # of the `bindings` must contain at least one member. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 406 | { # Associates `members` with a `role`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 407 | "role": "A String", # Role that is assigned to `members`. |
| 408 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 409 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 410 | # |
| 411 | # If the condition evaluates to `true`, then this binding applies to the |
| 412 | # current request. |
| 413 | # |
| 414 | # If the condition evaluates to `false`, then this binding does not apply to |
| 415 | # the current request. However, a different role binding might grant the same |
| 416 | # role to one or more of the members in this binding. |
| 417 | # |
| 418 | # To learn which resources support conditions in their IAM policies, see the |
| 419 | # [IAM |
| 420 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 421 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 422 | # are documented at https://github.com/google/cel-spec. |
| 423 | # |
| 424 | # Example (Comparison): |
| 425 | # |
| 426 | # title: "Summary size limit" |
| 427 | # description: "Determines if a summary is less than 100 chars" |
| 428 | # expression: "document.summary.size() < 100" |
| 429 | # |
| 430 | # Example (Equality): |
| 431 | # |
| 432 | # title: "Requestor is owner" |
| 433 | # description: "Determines if requestor is the document owner" |
| 434 | # expression: "document.owner == request.auth.claims.email" |
| 435 | # |
| 436 | # Example (Logic): |
| 437 | # |
| 438 | # title: "Public documents" |
| 439 | # description: "Determine whether the document should be publicly visible" |
| 440 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 441 | # |
| 442 | # Example (Data Manipulation): |
| 443 | # |
| 444 | # title: "Notification string" |
| 445 | # description: "Create a notification string with a timestamp." |
| 446 | # expression: "'New message received at ' + string(document.create_time)" |
| 447 | # |
| 448 | # The exact variables and functions that may be referenced within an expression |
| 449 | # are determined by the service that evaluates it. See the service |
| 450 | # documentation for additional information. |
| 451 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 452 | # reporting, e.g. a file name and a position in the file. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 453 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 454 | # syntax. |
| 455 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 456 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 457 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 458 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 459 | # expression. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 460 | }, |
| 461 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 462 | # `members` can have the following values: |
| 463 | # |
| 464 | # * `allUsers`: A special identifier that represents anyone who is |
| 465 | # on the internet; with or without a Google account. |
| 466 | # |
| 467 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 468 | # who is authenticated with a Google account or a service account. |
| 469 | # |
| 470 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 471 | # account. For example, `alice@example.com` . |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 472 | # |
| 473 | # |
| 474 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 475 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 476 | # |
| 477 | # * `group:{emailid}`: An email address that represents a Google group. |
| 478 | # For example, `admins@example.com`. |
| 479 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 480 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 481 | # identifier) representing a user that has been recently deleted. For |
| 482 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 483 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 484 | # retains the role in the binding. |
| 485 | # |
| 486 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 487 | # unique identifier) representing a service account that has been recently |
| 488 | # deleted. For example, |
| 489 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 490 | # If the service account is undeleted, this value reverts to |
| 491 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 492 | # role in the binding. |
| 493 | # |
| 494 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 495 | # identifier) representing a Google group that has been recently |
| 496 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 497 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 498 | # recovered group retains the role in the binding. |
| 499 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 500 | # |
| 501 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 502 | # users of that domain. For example, `google.com` or `example.com`. |
| 503 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 504 | "A String", |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 505 | ], |
| 506 | }, |
| 507 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 508 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 509 | # prevent simultaneous updates of a policy from overwriting each other. |
| 510 | # It is strongly suggested that systems make use of the `etag` in the |
| 511 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 512 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 513 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 514 | # ensure that their change will be applied to the same version of the policy. |
| 515 | # |
| 516 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 517 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 518 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 519 | # the conditions in the version `3` policy are lost. |
| 520 | "version": 42, # Specifies the format of the policy. |
| 521 | # |
| 522 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 523 | # are rejected. |
| 524 | # |
| 525 | # Any operation that affects conditional role bindings must specify version |
| 526 | # `3`. This requirement applies to the following operations: |
| 527 | # |
| 528 | # * Getting a policy that includes a conditional role binding |
| 529 | # * Adding a conditional role binding to a policy |
| 530 | # * Changing a conditional role binding in a policy |
| 531 | # * Removing any role binding, with or without a condition, from a policy |
| 532 | # that includes conditions |
| 533 | # |
| 534 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 535 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 536 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 537 | # the conditions in the version `3` policy are lost. |
| 538 | # |
| 539 | # If a policy does not include any conditions, operations on that policy may |
| 540 | # specify any valid version or leave the field unset. |
| 541 | # |
| 542 | # To learn which resources support conditions in their IAM policies, see the |
| 543 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 544 | }</pre> |
| 545 | </div> |
| 546 | |
| 547 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 548 | <code class="details" id="list">list(parent, pageToken=None, pageSize=None, x__xgafv=None)</code> |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 549 | <pre>Lists Cloud Spanner databases. |
| 550 | |
| 551 | Args: |
| 552 | parent: string, Required. The instance whose databases should be listed. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 553 | Values are of the form `projects/<project>/instances/<instance>`. (required) |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 554 | pageToken: string, If non-empty, `page_token` should contain a |
| 555 | next_page_token from a |
| 556 | previous ListDatabasesResponse. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 557 | pageSize: integer, Number of databases to be returned in the response. If 0 or less, |
| 558 | defaults to the server's maximum allowed page size. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 559 | x__xgafv: string, V1 error format. |
| 560 | Allowed values |
| 561 | 1 - v1 error format |
| 562 | 2 - v2 error format |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 563 | |
| 564 | Returns: |
| 565 | An object of the form: |
| 566 | |
| 567 | { # The response for ListDatabases. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 568 | "databases": [ # Databases that matched the request. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 569 | { # A Cloud Spanner database. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 570 | "restoreInfo": { # Information about the database restore. # Output only. Applicable only for restored databases. Contains information |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 571 | # about the restore source. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 572 | "backupInfo": { # Information about a backup. # Information about the backup used to restore the database. The backup |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 573 | # may no longer exist. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 574 | "sourceDatabase": "A String", # Name of the database the backup was created from. |
| 575 | "backup": "A String", # Name of the backup. |
| 576 | "createTime": "A String", # The backup contains an externally consistent copy of `source_database` at |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 577 | # the timestamp specified by `create_time`. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 578 | }, |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 579 | "sourceType": "A String", # The type of the restore source. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 580 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 581 | "createTime": "A String", # Output only. If exists, the time at which the database creation started. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 582 | "name": "A String", # Required. The name of the database. Values are of the form |
| 583 | # `projects/<project>/instances/<instance>/databases/<database>`, |
| 584 | # where `<database>` is as specified in the `CREATE DATABASE` |
| 585 | # statement. This name can be passed to other API methods to |
| 586 | # identify the database. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 587 | "state": "A String", # Output only. The current database state. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 588 | }, |
| 589 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 590 | "nextPageToken": "A String", # `next_page_token` can be sent in a subsequent |
| 591 | # ListDatabases call to fetch more |
| 592 | # of the matching databases. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 593 | }</pre> |
| 594 | </div> |
| 595 | |
| 596 | <div class="method"> |
| 597 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 598 | <pre>Retrieves the next page of results. |
| 599 | |
| 600 | Args: |
| 601 | previous_request: The request for the previous page. (required) |
| 602 | previous_response: The response from the request for the previous page. (required) |
| 603 | |
| 604 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 605 | A request object that you can call 'execute()' on to request the next |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 606 | page. Returns None if there are no more items in the collection. |
| 607 | </pre> |
| 608 | </div> |
| 609 | |
| 610 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 611 | <code class="details" id="restore">restore(parent, body=None, x__xgafv=None)</code> |
| 612 | <pre>Create a new database by restoring from a completed backup. The new |
| 613 | database must be in the same project and in an instance with the same |
| 614 | instance configuration as the instance containing |
| 615 | the backup. The returned database long-running |
| 616 | operation has a name of the format |
| 617 | `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`, |
| 618 | and can be used to track the progress of the operation, and to cancel it. |
| 619 | The metadata field type is |
| 620 | RestoreDatabaseMetadata. |
| 621 | The response type |
| 622 | is Database, if |
| 623 | successful. Cancelling the returned operation will stop the restore and |
| 624 | delete the database. |
| 625 | There can be only one database being restored into an instance at a time. |
| 626 | Once the restore operation completes, a new restore operation can be |
| 627 | initiated, without waiting for the optimize operation associated with the |
| 628 | first restore to complete. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 629 | |
| 630 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 631 | parent: string, Required. The name of the instance in which to create the |
| 632 | restored database. This instance must be in the same project and |
| 633 | have the same instance configuration as the instance containing |
| 634 | the source backup. Values are of the form |
| 635 | `projects/<project>/instances/<instance>`. (required) |
| 636 | body: object, The request body. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 637 | The object takes the form of: |
| 638 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 639 | { # The request for |
| 640 | # RestoreDatabase. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 641 | "databaseId": "A String", # Required. The id of the database to create and restore to. This |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 642 | # database must not already exist. The `database_id` appended to |
| 643 | # `parent` forms the full database name of the form |
| 644 | # `projects/<project>/instances/<instance>/databases/<database_id>`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 645 | "backup": "A String", # Name of the backup from which to restore. Values are of the form |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 646 | # `projects/<project>/instances/<instance>/backups/<backup>`. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 647 | } |
| 648 | |
| 649 | x__xgafv: string, V1 error format. |
| 650 | Allowed values |
| 651 | 1 - v1 error format |
| 652 | 2 - v2 error format |
| 653 | |
| 654 | Returns: |
| 655 | An object of the form: |
| 656 | |
| 657 | { # This resource represents a long-running operation that is the result of a |
| 658 | # network API call. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 659 | "error": { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation. |
| 660 | # different programming environments, including REST APIs and RPC APIs. It is |
| 661 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 662 | # three pieces of data: error code, error message, and error details. |
| 663 | # |
| 664 | # You can find out more about this error model and how to work with it in the |
| 665 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 666 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 667 | # message types for APIs to use. |
| 668 | { |
| 669 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 670 | }, |
| 671 | ], |
| 672 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 673 | # user-facing error message should be localized and sent in the |
| 674 | # google.rpc.Status.details field, or localized by the client. |
| 675 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 676 | }, |
| 677 | "metadata": { # Service-specific metadata associated with the operation. It typically |
| 678 | # contains progress information and common metadata such as create time. |
| 679 | # Some services might not provide such metadata. Any method that returns a |
| 680 | # long-running operation should document the metadata type, if any. |
| 681 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 682 | }, |
| 683 | "name": "A String", # The server-assigned name, which is only unique within the same service that |
| 684 | # originally returns it. If you use the default HTTP mapping, the |
| 685 | # `name` should be a resource name ending with `operations/{unique_id}`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 686 | "done": True or False, # If the value is `false`, it means the operation is still in progress. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 687 | # If `true`, the operation is completed, and either `error` or `response` is |
| 688 | # available. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 689 | "response": { # The normal response of the operation in case of success. If the original |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 690 | # method returns no data on success, such as `Delete`, the response is |
| 691 | # `google.protobuf.Empty`. If the original method is standard |
| 692 | # `Get`/`Create`/`Update`, the response should be the resource. For other |
| 693 | # methods, the response should have the type `XxxResponse`, where `Xxx` |
| 694 | # is the original method name. For example, if the original method name |
| 695 | # is `TakeSnapshot()`, the inferred response type is |
| 696 | # `TakeSnapshotResponse`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 697 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 698 | }, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 699 | }</pre> |
| 700 | </div> |
| 701 | |
| 702 | <div class="method"> |
| 703 | <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</code> |
| 704 | <pre>Sets the access control policy on a database or backup resource. |
| 705 | Replaces any existing policy. |
| 706 | |
| 707 | Authorization requires `spanner.databases.setIamPolicy` |
| 708 | permission on resource. |
| 709 | For backups, authorization requires `spanner.backups.setIamPolicy` |
| 710 | permission on resource. |
| 711 | |
| 712 | Args: |
| 713 | resource: string, REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects/<project ID>/instances/<instance ID>` for instance resources and `projects/<project ID>/instances/<instance ID>/databases/<database ID>` for databases resources. (required) |
| 714 | body: object, The request body. |
| 715 | The object takes the form of: |
| 716 | |
| 717 | { # Request message for `SetIamPolicy` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 718 | "policy": { # An Identity and Access Management (IAM) policy, which specifies access # REQUIRED: The complete policy to be applied to the `resource`. The size of |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 719 | # the policy is limited to a few 10s of KB. An empty policy is a |
| 720 | # valid policy but certain Cloud Platform services (such as Projects) |
| 721 | # might reject them. |
| 722 | # controls for Google Cloud resources. |
| 723 | # |
| 724 | # |
| 725 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 726 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 727 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 728 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 729 | # custom role. |
| 730 | # |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 731 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 732 | # `condition`, which is a logical expression that allows access to a resource |
| 733 | # only if the expression evaluates to `true`. A condition can add constraints |
| 734 | # based on attributes of the request, the resource, or both. To learn which |
| 735 | # resources support conditions in their IAM policies, see the |
| 736 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 737 | # |
| 738 | # **JSON example:** |
| 739 | # |
| 740 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 741 | # "bindings": [ |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 742 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 743 | # "role": "roles/resourcemanager.organizationAdmin", |
| 744 | # "members": [ |
| 745 | # "user:mike@example.com", |
| 746 | # "group:admins@example.com", |
| 747 | # "domain:google.com", |
| 748 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 749 | # ] |
| 750 | # }, |
| 751 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 752 | # "role": "roles/resourcemanager.organizationViewer", |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 753 | # "members": [ |
| 754 | # "user:eve@example.com" |
| 755 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 756 | # "condition": { |
| 757 | # "title": "expirable access", |
| 758 | # "description": "Does not grant access after Sep 2020", |
| 759 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 760 | # } |
| 761 | # } |
| 762 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 763 | # "etag": "BwWWja0YfJA=", |
| 764 | # "version": 3 |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 765 | # } |
| 766 | # |
| 767 | # **YAML example:** |
| 768 | # |
| 769 | # bindings: |
| 770 | # - members: |
| 771 | # - user:mike@example.com |
| 772 | # - group:admins@example.com |
| 773 | # - domain:google.com |
| 774 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 775 | # role: roles/resourcemanager.organizationAdmin |
| 776 | # - members: |
| 777 | # - user:eve@example.com |
| 778 | # role: roles/resourcemanager.organizationViewer |
| 779 | # condition: |
| 780 | # title: expirable access |
| 781 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 782 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 783 | # - etag: BwWWja0YfJA= |
| 784 | # - version: 3 |
| 785 | # |
| 786 | # For a description of IAM and its features, see the |
| 787 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 788 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 789 | # `condition` that determines how and when the `bindings` are applied. Each |
| 790 | # of the `bindings` must contain at least one member. |
| 791 | { # Associates `members` with a `role`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 792 | "role": "A String", # Role that is assigned to `members`. |
| 793 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 794 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 795 | # |
| 796 | # If the condition evaluates to `true`, then this binding applies to the |
| 797 | # current request. |
| 798 | # |
| 799 | # If the condition evaluates to `false`, then this binding does not apply to |
| 800 | # the current request. However, a different role binding might grant the same |
| 801 | # role to one or more of the members in this binding. |
| 802 | # |
| 803 | # To learn which resources support conditions in their IAM policies, see the |
| 804 | # [IAM |
| 805 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 806 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 807 | # are documented at https://github.com/google/cel-spec. |
| 808 | # |
| 809 | # Example (Comparison): |
| 810 | # |
| 811 | # title: "Summary size limit" |
| 812 | # description: "Determines if a summary is less than 100 chars" |
| 813 | # expression: "document.summary.size() < 100" |
| 814 | # |
| 815 | # Example (Equality): |
| 816 | # |
| 817 | # title: "Requestor is owner" |
| 818 | # description: "Determines if requestor is the document owner" |
| 819 | # expression: "document.owner == request.auth.claims.email" |
| 820 | # |
| 821 | # Example (Logic): |
| 822 | # |
| 823 | # title: "Public documents" |
| 824 | # description: "Determine whether the document should be publicly visible" |
| 825 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 826 | # |
| 827 | # Example (Data Manipulation): |
| 828 | # |
| 829 | # title: "Notification string" |
| 830 | # description: "Create a notification string with a timestamp." |
| 831 | # expression: "'New message received at ' + string(document.create_time)" |
| 832 | # |
| 833 | # The exact variables and functions that may be referenced within an expression |
| 834 | # are determined by the service that evaluates it. See the service |
| 835 | # documentation for additional information. |
| 836 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 837 | # reporting, e.g. a file name and a position in the file. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 838 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 839 | # syntax. |
| 840 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 841 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 842 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 843 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 844 | # expression. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 845 | }, |
| 846 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 847 | # `members` can have the following values: |
| 848 | # |
| 849 | # * `allUsers`: A special identifier that represents anyone who is |
| 850 | # on the internet; with or without a Google account. |
| 851 | # |
| 852 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 853 | # who is authenticated with a Google account or a service account. |
| 854 | # |
| 855 | # * `user:{emailid}`: An email address that represents a specific Google |
| 856 | # account. For example, `alice@example.com` . |
| 857 | # |
| 858 | # |
| 859 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 860 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 861 | # |
| 862 | # * `group:{emailid}`: An email address that represents a Google group. |
| 863 | # For example, `admins@example.com`. |
| 864 | # |
| 865 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 866 | # identifier) representing a user that has been recently deleted. For |
| 867 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 868 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 869 | # retains the role in the binding. |
| 870 | # |
| 871 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 872 | # unique identifier) representing a service account that has been recently |
| 873 | # deleted. For example, |
| 874 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 875 | # If the service account is undeleted, this value reverts to |
| 876 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 877 | # role in the binding. |
| 878 | # |
| 879 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 880 | # identifier) representing a Google group that has been recently |
| 881 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 882 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 883 | # recovered group retains the role in the binding. |
| 884 | # |
| 885 | # |
| 886 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
| 887 | # users of that domain. For example, `google.com` or `example.com`. |
| 888 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 889 | "A String", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 890 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 891 | }, |
| 892 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 893 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 894 | # prevent simultaneous updates of a policy from overwriting each other. |
| 895 | # It is strongly suggested that systems make use of the `etag` in the |
| 896 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 897 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 898 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 899 | # ensure that their change will be applied to the same version of the policy. |
| 900 | # |
| 901 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 902 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 903 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 904 | # the conditions in the version `3` policy are lost. |
| 905 | "version": 42, # Specifies the format of the policy. |
| 906 | # |
| 907 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 908 | # are rejected. |
| 909 | # |
| 910 | # Any operation that affects conditional role bindings must specify version |
| 911 | # `3`. This requirement applies to the following operations: |
| 912 | # |
| 913 | # * Getting a policy that includes a conditional role binding |
| 914 | # * Adding a conditional role binding to a policy |
| 915 | # * Changing a conditional role binding in a policy |
| 916 | # * Removing any role binding, with or without a condition, from a policy |
| 917 | # that includes conditions |
| 918 | # |
| 919 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 920 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 921 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 922 | # the conditions in the version `3` policy are lost. |
| 923 | # |
| 924 | # If a policy does not include any conditions, operations on that policy may |
| 925 | # specify any valid version or leave the field unset. |
| 926 | # |
| 927 | # To learn which resources support conditions in their IAM policies, see the |
| 928 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 929 | }, |
| 930 | } |
| 931 | |
| 932 | x__xgafv: string, V1 error format. |
| 933 | Allowed values |
| 934 | 1 - v1 error format |
| 935 | 2 - v2 error format |
| 936 | |
| 937 | Returns: |
| 938 | An object of the form: |
| 939 | |
| 940 | { # An Identity and Access Management (IAM) policy, which specifies access |
| 941 | # controls for Google Cloud resources. |
| 942 | # |
| 943 | # |
| 944 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 945 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 946 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 947 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 948 | # custom role. |
| 949 | # |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 950 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 951 | # `condition`, which is a logical expression that allows access to a resource |
| 952 | # only if the expression evaluates to `true`. A condition can add constraints |
| 953 | # based on attributes of the request, the resource, or both. To learn which |
| 954 | # resources support conditions in their IAM policies, see the |
| 955 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 956 | # |
| 957 | # **JSON example:** |
| 958 | # |
| 959 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 960 | # "bindings": [ |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 961 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 962 | # "role": "roles/resourcemanager.organizationAdmin", |
| 963 | # "members": [ |
| 964 | # "user:mike@example.com", |
| 965 | # "group:admins@example.com", |
| 966 | # "domain:google.com", |
| 967 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 968 | # ] |
| 969 | # }, |
| 970 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 971 | # "role": "roles/resourcemanager.organizationViewer", |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 972 | # "members": [ |
| 973 | # "user:eve@example.com" |
| 974 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 975 | # "condition": { |
| 976 | # "title": "expirable access", |
| 977 | # "description": "Does not grant access after Sep 2020", |
| 978 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 979 | # } |
| 980 | # } |
| 981 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 982 | # "etag": "BwWWja0YfJA=", |
| 983 | # "version": 3 |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 984 | # } |
| 985 | # |
| 986 | # **YAML example:** |
| 987 | # |
| 988 | # bindings: |
| 989 | # - members: |
| 990 | # - user:mike@example.com |
| 991 | # - group:admins@example.com |
| 992 | # - domain:google.com |
| 993 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 994 | # role: roles/resourcemanager.organizationAdmin |
| 995 | # - members: |
| 996 | # - user:eve@example.com |
| 997 | # role: roles/resourcemanager.organizationViewer |
| 998 | # condition: |
| 999 | # title: expirable access |
| 1000 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1001 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1002 | # - etag: BwWWja0YfJA= |
| 1003 | # - version: 3 |
| 1004 | # |
| 1005 | # For a description of IAM and its features, see the |
| 1006 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1007 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1008 | # `condition` that determines how and when the `bindings` are applied. Each |
| 1009 | # of the `bindings` must contain at least one member. |
| 1010 | { # Associates `members` with a `role`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1011 | "role": "A String", # Role that is assigned to `members`. |
| 1012 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1013 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1014 | # |
| 1015 | # If the condition evaluates to `true`, then this binding applies to the |
| 1016 | # current request. |
| 1017 | # |
| 1018 | # If the condition evaluates to `false`, then this binding does not apply to |
| 1019 | # the current request. However, a different role binding might grant the same |
| 1020 | # role to one or more of the members in this binding. |
| 1021 | # |
| 1022 | # To learn which resources support conditions in their IAM policies, see the |
| 1023 | # [IAM |
| 1024 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1025 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 1026 | # are documented at https://github.com/google/cel-spec. |
| 1027 | # |
| 1028 | # Example (Comparison): |
| 1029 | # |
| 1030 | # title: "Summary size limit" |
| 1031 | # description: "Determines if a summary is less than 100 chars" |
| 1032 | # expression: "document.summary.size() < 100" |
| 1033 | # |
| 1034 | # Example (Equality): |
| 1035 | # |
| 1036 | # title: "Requestor is owner" |
| 1037 | # description: "Determines if requestor is the document owner" |
| 1038 | # expression: "document.owner == request.auth.claims.email" |
| 1039 | # |
| 1040 | # Example (Logic): |
| 1041 | # |
| 1042 | # title: "Public documents" |
| 1043 | # description: "Determine whether the document should be publicly visible" |
| 1044 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 1045 | # |
| 1046 | # Example (Data Manipulation): |
| 1047 | # |
| 1048 | # title: "Notification string" |
| 1049 | # description: "Create a notification string with a timestamp." |
| 1050 | # expression: "'New message received at ' + string(document.create_time)" |
| 1051 | # |
| 1052 | # The exact variables and functions that may be referenced within an expression |
| 1053 | # are determined by the service that evaluates it. See the service |
| 1054 | # documentation for additional information. |
| 1055 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 1056 | # reporting, e.g. a file name and a position in the file. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1057 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 1058 | # syntax. |
| 1059 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 1060 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1061 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 1062 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 1063 | # expression. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1064 | }, |
| 1065 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1066 | # `members` can have the following values: |
| 1067 | # |
| 1068 | # * `allUsers`: A special identifier that represents anyone who is |
| 1069 | # on the internet; with or without a Google account. |
| 1070 | # |
| 1071 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 1072 | # who is authenticated with a Google account or a service account. |
| 1073 | # |
| 1074 | # * `user:{emailid}`: An email address that represents a specific Google |
| 1075 | # account. For example, `alice@example.com` . |
| 1076 | # |
| 1077 | # |
| 1078 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 1079 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 1080 | # |
| 1081 | # * `group:{emailid}`: An email address that represents a Google group. |
| 1082 | # For example, `admins@example.com`. |
| 1083 | # |
| 1084 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 1085 | # identifier) representing a user that has been recently deleted. For |
| 1086 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 1087 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 1088 | # retains the role in the binding. |
| 1089 | # |
| 1090 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 1091 | # unique identifier) representing a service account that has been recently |
| 1092 | # deleted. For example, |
| 1093 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 1094 | # If the service account is undeleted, this value reverts to |
| 1095 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 1096 | # role in the binding. |
| 1097 | # |
| 1098 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 1099 | # identifier) representing a Google group that has been recently |
| 1100 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 1101 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 1102 | # recovered group retains the role in the binding. |
| 1103 | # |
| 1104 | # |
| 1105 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
| 1106 | # users of that domain. For example, `google.com` or `example.com`. |
| 1107 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1108 | "A String", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1109 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1110 | }, |
| 1111 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1112 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 1113 | # prevent simultaneous updates of a policy from overwriting each other. |
| 1114 | # It is strongly suggested that systems make use of the `etag` in the |
| 1115 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 1116 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 1117 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 1118 | # ensure that their change will be applied to the same version of the policy. |
| 1119 | # |
| 1120 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 1121 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 1122 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 1123 | # the conditions in the version `3` policy are lost. |
| 1124 | "version": 42, # Specifies the format of the policy. |
| 1125 | # |
| 1126 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 1127 | # are rejected. |
| 1128 | # |
| 1129 | # Any operation that affects conditional role bindings must specify version |
| 1130 | # `3`. This requirement applies to the following operations: |
| 1131 | # |
| 1132 | # * Getting a policy that includes a conditional role binding |
| 1133 | # * Adding a conditional role binding to a policy |
| 1134 | # * Changing a conditional role binding in a policy |
| 1135 | # * Removing any role binding, with or without a condition, from a policy |
| 1136 | # that includes conditions |
| 1137 | # |
| 1138 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 1139 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 1140 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 1141 | # the conditions in the version `3` policy are lost. |
| 1142 | # |
| 1143 | # If a policy does not include any conditions, operations on that policy may |
| 1144 | # specify any valid version or leave the field unset. |
| 1145 | # |
| 1146 | # To learn which resources support conditions in their IAM policies, see the |
| 1147 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1148 | }</pre> |
| 1149 | </div> |
| 1150 | |
| 1151 | <div class="method"> |
| 1152 | <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</code> |
| 1153 | <pre>Returns permissions that the caller has on the specified database or backup |
| 1154 | resource. |
| 1155 | |
| 1156 | Attempting this RPC on a non-existent Cloud Spanner database will |
| 1157 | result in a NOT_FOUND error if the user has |
| 1158 | `spanner.databases.list` permission on the containing Cloud |
| 1159 | Spanner instance. Otherwise returns an empty set of permissions. |
| 1160 | Calling this method on a backup that does not exist will |
| 1161 | result in a NOT_FOUND error if the user has |
| 1162 | `spanner.backups.list` permission on the containing instance. |
| 1163 | |
| 1164 | Args: |
| 1165 | resource: string, REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects/<project ID>/instances/<instance ID>` for instance resources and `projects/<project ID>/instances/<instance ID>/databases/<database ID>` for database resources. (required) |
| 1166 | body: object, The request body. |
| 1167 | The object takes the form of: |
| 1168 | |
| 1169 | { # Request message for `TestIamPermissions` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1170 | "permissions": [ # REQUIRED: The set of permissions to check for 'resource'. |
| 1171 | # Permissions with wildcards (such as '*', 'spanner.*', 'spanner.instances.*') are not allowed. |
| 1172 | "A String", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1173 | ], |
| 1174 | } |
| 1175 | |
| 1176 | x__xgafv: string, V1 error format. |
| 1177 | Allowed values |
| 1178 | 1 - v1 error format |
| 1179 | 2 - v2 error format |
| 1180 | |
| 1181 | Returns: |
| 1182 | An object of the form: |
| 1183 | |
| 1184 | { # Response message for `TestIamPermissions` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1185 | "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1186 | # allowed. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1187 | "A String", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1188 | ], |
| 1189 | }</pre> |
| 1190 | </div> |
| 1191 | |
| 1192 | <div class="method"> |
| 1193 | <code class="details" id="updateDdl">updateDdl(database, body=None, x__xgafv=None)</code> |
| 1194 | <pre>Updates the schema of a Cloud Spanner database by |
| 1195 | creating/altering/dropping tables, columns, indexes, etc. The returned |
| 1196 | long-running operation will have a name of |
| 1197 | the format `<database_name>/operations/<operation_id>` and can be used to |
| 1198 | track execution of the schema change(s). The |
| 1199 | metadata field type is |
| 1200 | UpdateDatabaseDdlMetadata. The operation has no response. |
| 1201 | |
| 1202 | Args: |
| 1203 | database: string, Required. The database to update. (required) |
| 1204 | body: object, The request body. |
| 1205 | The object takes the form of: |
| 1206 | |
| 1207 | { # Enqueues the given DDL statements to be applied, in order but not |
| 1208 | # necessarily all at once, to the database schema at some point (or |
| 1209 | # points) in the future. The server checks that the statements |
| 1210 | # are executable (syntactically valid, name tables that exist, etc.) |
| 1211 | # before enqueueing them, but they may still fail upon |
| 1212 | # later execution (e.g., if a statement from another batch of |
| 1213 | # statements is applied first and it conflicts in some way, or if |
| 1214 | # there is some data-related problem like a `NULL` value in a column to |
| 1215 | # which `NOT NULL` would be added). If a statement fails, all |
| 1216 | # subsequent statements in the batch are automatically cancelled. |
| 1217 | # |
| 1218 | # Each batch of statements is assigned a name which can be used with |
| 1219 | # the Operations API to monitor |
| 1220 | # progress. See the |
| 1221 | # operation_id field for more |
| 1222 | # details. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1223 | "operationId": "A String", # If empty, the new update request is assigned an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1224 | # automatically-generated operation ID. Otherwise, `operation_id` |
| 1225 | # is used to construct the name of the resulting |
| 1226 | # Operation. |
| 1227 | # |
| 1228 | # Specifying an explicit operation ID simplifies determining |
| 1229 | # whether the statements were executed in the event that the |
| 1230 | # UpdateDatabaseDdl call is replayed, |
| 1231 | # or the return value is otherwise lost: the database and |
| 1232 | # `operation_id` fields can be combined to form the |
| 1233 | # name of the resulting |
| 1234 | # longrunning.Operation: `<database>/operations/<operation_id>`. |
| 1235 | # |
| 1236 | # `operation_id` should be unique within the database, and must be |
| 1237 | # a valid identifier: `a-z*`. Note that |
| 1238 | # automatically-generated operation IDs always begin with an |
| 1239 | # underscore. If the named operation already exists, |
| 1240 | # UpdateDatabaseDdl returns |
| 1241 | # `ALREADY_EXISTS`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1242 | "statements": [ # Required. DDL statements to be applied to the database. |
| 1243 | "A String", |
| 1244 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1245 | } |
| 1246 | |
| 1247 | x__xgafv: string, V1 error format. |
| 1248 | Allowed values |
| 1249 | 1 - v1 error format |
| 1250 | 2 - v2 error format |
| 1251 | |
| 1252 | Returns: |
| 1253 | An object of the form: |
| 1254 | |
| 1255 | { # This resource represents a long-running operation that is the result of a |
| 1256 | # network API call. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1257 | "error": { # The `Status` type defines a logical error model that is suitable for # The error result of the operation in case of failure or cancellation. |
| 1258 | # different programming environments, including REST APIs and RPC APIs. It is |
| 1259 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 1260 | # three pieces of data: error code, error message, and error details. |
| 1261 | # |
| 1262 | # You can find out more about this error model and how to work with it in the |
| 1263 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 1264 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 1265 | # message types for APIs to use. |
| 1266 | { |
| 1267 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1268 | }, |
| 1269 | ], |
| 1270 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 1271 | # user-facing error message should be localized and sent in the |
| 1272 | # google.rpc.Status.details field, or localized by the client. |
| 1273 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 1274 | }, |
| 1275 | "metadata": { # Service-specific metadata associated with the operation. It typically |
| 1276 | # contains progress information and common metadata such as create time. |
| 1277 | # Some services might not provide such metadata. Any method that returns a |
| 1278 | # long-running operation should document the metadata type, if any. |
| 1279 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1280 | }, |
| 1281 | "name": "A String", # The server-assigned name, which is only unique within the same service that |
| 1282 | # originally returns it. If you use the default HTTP mapping, the |
| 1283 | # `name` should be a resource name ending with `operations/{unique_id}`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1284 | "done": True or False, # If the value is `false`, it means the operation is still in progress. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1285 | # If `true`, the operation is completed, and either `error` or `response` is |
| 1286 | # available. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1287 | "response": { # The normal response of the operation in case of success. If the original |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1288 | # method returns no data on success, such as `Delete`, the response is |
| 1289 | # `google.protobuf.Empty`. If the original method is standard |
| 1290 | # `Get`/`Create`/`Update`, the response should be the resource. For other |
| 1291 | # methods, the response should have the type `XxxResponse`, where `Xxx` |
| 1292 | # is the original method name. For example, if the original method name |
| 1293 | # is `TakeSnapshot()`, the inferred response type is |
| 1294 | # `TakeSnapshotResponse`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1295 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1296 | }, |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1297 | }</pre> |
| 1298 | </div> |
| 1299 | |
| 1300 | </body></html> |