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