Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [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 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 75 | <h1><a href="pubsub_v1.html">Cloud Pub/Sub API</a> . <a href="pubsub_v1.projects.html">projects</a> . <a href="pubsub_v1.projects.snapshots.html">snapshots</a></h1> |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 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="#create">create(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 79 | <p class="firstline">Creates a snapshot from the requested subscription. Snapshots are used in</p> |
| 80 | <p class="toc_element"> |
| 81 | <code><a href="#delete">delete(snapshot, x__xgafv=None)</a></code></p> |
| 82 | <p class="firstline">Removes an existing snapshot. Snapshots are used in</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#get">get(snapshot, x__xgafv=None)</a></code></p> |
| 85 | <p class="firstline">Gets the configuration details of a snapshot. Snapshots are used in</p> |
| 86 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 87 | <code><a href="#getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 88 | <p class="firstline">Gets the access control policy for a resource.</p> |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 89 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 90 | <code><a href="#list">list(project, pageToken=None, pageSize=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 91 | <p class="firstline">Lists the existing snapshots. Snapshots are used in</p> |
| 92 | <p class="toc_element"> |
| 93 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 94 | <p class="firstline">Retrieves the next page of results.</p> |
| 95 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 96 | <code><a href="#patch">patch(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 97 | <p class="firstline">Updates an existing snapshot. Snapshots are used in</p> |
| 98 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 99 | <code><a href="#setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</a></code></p> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 100 | <p class="firstline">Sets the access control policy on the specified resource. Replaces any</p> |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 101 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 102 | <code><a href="#testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</a></code></p> |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 103 | <p class="firstline">Returns permissions that a caller has on the specified resource.</p> |
| 104 | <h3>Method Details</h3> |
| 105 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 106 | <code class="details" id="create">create(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 107 | <pre>Creates a snapshot from the requested subscription. Snapshots are used in |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 108 | <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 109 | operations, which allow |
| 110 | you to manage message acknowledgments in bulk. That is, you can set the |
| 111 | acknowledgment state of messages in an existing subscription to the state |
| 112 | captured by a snapshot. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 113 | <br><br>If the snapshot already exists, returns `ALREADY_EXISTS`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 114 | If the requested subscription doesn't exist, returns `NOT_FOUND`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 115 | If the backlog in the subscription is too old -- and the resulting snapshot |
| 116 | would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. |
| 117 | See also the `Snapshot.expire_time` field. If the name is not provided in |
| 118 | the request, the server will assign a random |
| 119 | name for this snapshot on the same project as the subscription, conforming |
| 120 | to the |
| 121 | [resource name |
| 122 | format](https://cloud.google.com/pubsub/docs/admin#resource_names). The |
| 123 | generated name is populated in the returned Snapshot object. Note that for |
| 124 | REST API requests, you must specify a name in the request. |
| 125 | |
| 126 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 127 | name: string, Required. User-provided name for this snapshot. If the name is not provided in the |
| 128 | request, the server will assign a random name for this snapshot on the same |
| 129 | project as the subscription. Note that for REST API requests, you must |
| 130 | specify a name. See the <a |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 131 | href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 132 | name rules</a>. Format is `projects/{project}/snapshots/{snap}`. (required) |
| 133 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 134 | The object takes the form of: |
| 135 | |
| 136 | { # Request for the `CreateSnapshot` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 137 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 138 | # managing labels</a>. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 139 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 140 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 141 | "subscription": "A String", # Required. The subscription whose backlog the snapshot retains. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 142 | # Specifically, the created snapshot is guaranteed to retain: |
| 143 | # (a) The existing backlog on the subscription. More precisely, this is |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 144 | # defined as the messages in the subscription's backlog that are |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 145 | # unacknowledged upon the successful completion of the |
| 146 | # `CreateSnapshot` request; as well as: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 147 | # (b) Any messages published to the subscription's topic following the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 148 | # successful completion of the CreateSnapshot request. |
| 149 | # Format is `projects/{project}/subscriptions/{sub}`. |
| 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 | { # A snapshot resource. Snapshots are used in |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 161 | # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 162 | # operations, which allow |
| 163 | # you to manage message acknowledgments in bulk. That is, you can set the |
| 164 | # acknowledgment state of messages in an existing subscription to the state |
| 165 | # captured by a snapshot. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 166 | "topic": "A String", # The name of the topic from which this snapshot is retaining messages. |
| 167 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 168 | # managing labels</a>. |
| 169 | "a_key": "A String", |
| 170 | }, |
| 171 | "expireTime": "A String", # The snapshot is guaranteed to exist up until this time. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 172 | # A newly-created snapshot expires no later than 7 days from the time of its |
| 173 | # creation. Its exact lifetime is determined at creation by the existing |
| 174 | # backlog in the source subscription. Specifically, the lifetime of the |
| 175 | # snapshot is `7 days - (age of oldest unacked message in the subscription)`. |
| 176 | # For example, consider a subscription whose oldest unacked message is 3 days |
| 177 | # old. If a snapshot is created from this subscription, the snapshot -- which |
| 178 | # will always capture this 3-day-old backlog as long as the snapshot |
| 179 | # exists -- will expire in 4 days. The service will refuse to create a |
| 180 | # snapshot that would expire in less than 1 hour after creation. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 181 | "name": "A String", # The name of the snapshot. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 182 | }</pre> |
| 183 | </div> |
| 184 | |
| 185 | <div class="method"> |
| 186 | <code class="details" id="delete">delete(snapshot, x__xgafv=None)</code> |
| 187 | <pre>Removes an existing snapshot. Snapshots are used in |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 188 | <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 189 | operations, which allow |
| 190 | you to manage message acknowledgments in bulk. That is, you can set the |
| 191 | acknowledgment state of messages in an existing subscription to the state |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 192 | captured by a snapshot.<br><br> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 193 | When the snapshot is deleted, all messages retained in the snapshot |
| 194 | are immediately dropped. After a snapshot is deleted, a new one may be |
| 195 | created with the same name, but the new one has no association with the old |
| 196 | snapshot or its subscription, unless the same subscription is specified. |
| 197 | |
| 198 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 199 | snapshot: string, Required. The name of the snapshot to delete. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 200 | Format is `projects/{project}/snapshots/{snap}`. (required) |
| 201 | x__xgafv: string, V1 error format. |
| 202 | Allowed values |
| 203 | 1 - v1 error format |
| 204 | 2 - v2 error format |
| 205 | |
| 206 | Returns: |
| 207 | An object of the form: |
| 208 | |
| 209 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 210 | # empty messages in your APIs. A typical example is to use it as the request |
| 211 | # or the response type of an API method. For instance: |
| 212 | # |
| 213 | # service Foo { |
| 214 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 215 | # } |
| 216 | # |
| 217 | # The JSON representation for `Empty` is empty JSON object `{}`. |
| 218 | }</pre> |
| 219 | </div> |
| 220 | |
| 221 | <div class="method"> |
| 222 | <code class="details" id="get">get(snapshot, x__xgafv=None)</code> |
| 223 | <pre>Gets the configuration details of a snapshot. Snapshots are used in |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 224 | <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 225 | operations, which allow you to manage message acknowledgments in bulk. That |
| 226 | is, you can set the acknowledgment state of messages in an existing |
| 227 | subscription to the state captured by a snapshot. |
| 228 | |
| 229 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 230 | snapshot: string, Required. The name of the snapshot to get. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 231 | Format is `projects/{project}/snapshots/{snap}`. (required) |
| 232 | x__xgafv: string, V1 error format. |
| 233 | Allowed values |
| 234 | 1 - v1 error format |
| 235 | 2 - v2 error format |
| 236 | |
| 237 | Returns: |
| 238 | An object of the form: |
| 239 | |
| 240 | { # A snapshot resource. Snapshots are used in |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 241 | # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 242 | # operations, which allow |
| 243 | # you to manage message acknowledgments in bulk. That is, you can set the |
| 244 | # acknowledgment state of messages in an existing subscription to the state |
| 245 | # captured by a snapshot. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 246 | "topic": "A String", # The name of the topic from which this snapshot is retaining messages. |
| 247 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 248 | # managing labels</a>. |
| 249 | "a_key": "A String", |
| 250 | }, |
| 251 | "expireTime": "A String", # The snapshot is guaranteed to exist up until this time. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 252 | # A newly-created snapshot expires no later than 7 days from the time of its |
| 253 | # creation. Its exact lifetime is determined at creation by the existing |
| 254 | # backlog in the source subscription. Specifically, the lifetime of the |
| 255 | # snapshot is `7 days - (age of oldest unacked message in the subscription)`. |
| 256 | # For example, consider a subscription whose oldest unacked message is 3 days |
| 257 | # old. If a snapshot is created from this subscription, the snapshot -- which |
| 258 | # will always capture this 3-day-old backlog as long as the snapshot |
| 259 | # exists -- will expire in 4 days. The service will refuse to create a |
| 260 | # snapshot that would expire in less than 1 hour after creation. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 261 | "name": "A String", # The name of the snapshot. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 262 | }</pre> |
| 263 | </div> |
| 264 | |
| 265 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 266 | <code class="details" id="getIamPolicy">getIamPolicy(resource, options_requestedPolicyVersion=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 267 | <pre>Gets the access control policy for a resource. |
| 268 | Returns an empty policy if the resource exists and does not have a policy |
| 269 | set. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 270 | |
| 271 | Args: |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 272 | resource: string, REQUIRED: The resource for which the policy is being requested. |
Sai Cheemalapati | e833b79 | 2017-03-24 15:06:46 -0700 | [diff] [blame] | 273 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 274 | options_requestedPolicyVersion: integer, Optional. The policy format version to be returned. |
| 275 | |
| 276 | Valid values are 0, 1, and 3. Requests specifying an invalid value will be |
| 277 | rejected. |
| 278 | |
| 279 | Requests for policies with any conditional bindings must specify version 3. |
| 280 | Policies without any conditional bindings may specify any valid value or |
| 281 | leave the field unset. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 282 | |
| 283 | To learn which resources support conditions in their IAM policies, see the |
| 284 | [IAM |
| 285 | documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 286 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 287 | Allowed values |
| 288 | 1 - v1 error format |
| 289 | 2 - v2 error format |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 290 | |
| 291 | Returns: |
| 292 | An object of the form: |
| 293 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 294 | { # An Identity and Access Management (IAM) policy, which specifies access |
| 295 | # controls for Google Cloud resources. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 296 | # |
| 297 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 298 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 299 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 300 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 301 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 302 | # custom role. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 303 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 304 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 305 | # `condition`, which is a logical expression that allows access to a resource |
| 306 | # only if the expression evaluates to `true`. A condition can add constraints |
| 307 | # based on attributes of the request, the resource, or both. To learn which |
| 308 | # resources support conditions in their IAM policies, see the |
| 309 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 310 | # |
| 311 | # **JSON example:** |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 312 | # |
| 313 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 314 | # "bindings": [ |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 315 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 316 | # "role": "roles/resourcemanager.organizationAdmin", |
| 317 | # "members": [ |
| 318 | # "user:mike@example.com", |
| 319 | # "group:admins@example.com", |
| 320 | # "domain:google.com", |
| 321 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 322 | # ] |
| 323 | # }, |
| 324 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 325 | # "role": "roles/resourcemanager.organizationViewer", |
| 326 | # "members": [ |
| 327 | # "user:eve@example.com" |
| 328 | # ], |
| 329 | # "condition": { |
| 330 | # "title": "expirable access", |
| 331 | # "description": "Does not grant access after Sep 2020", |
| 332 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 333 | # } |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 334 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 335 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 336 | # "etag": "BwWWja0YfJA=", |
| 337 | # "version": 3 |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 338 | # } |
| 339 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 340 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 341 | # |
| 342 | # bindings: |
| 343 | # - members: |
| 344 | # - user:mike@example.com |
| 345 | # - group:admins@example.com |
| 346 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 347 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 348 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 349 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 350 | # - user:eve@example.com |
| 351 | # role: roles/resourcemanager.organizationViewer |
| 352 | # condition: |
| 353 | # title: expirable access |
| 354 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 355 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 356 | # - etag: BwWWja0YfJA= |
| 357 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 358 | # |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 359 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 360 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 361 | "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] | 362 | # `condition` that determines how and when the `bindings` are applied. Each |
| 363 | # of the `bindings` must contain at least one member. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 364 | { # Associates `members` with a `role`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 365 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 366 | # |
| 367 | # If the condition evaluates to `true`, then this binding applies to the |
| 368 | # current request. |
| 369 | # |
| 370 | # If the condition evaluates to `false`, then this binding does not apply to |
| 371 | # the current request. However, a different role binding might grant the same |
| 372 | # role to one or more of the members in this binding. |
| 373 | # |
| 374 | # To learn which resources support conditions in their IAM policies, see the |
| 375 | # [IAM |
| 376 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 377 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 378 | # are documented at https://github.com/google/cel-spec. |
| 379 | # |
| 380 | # Example (Comparison): |
| 381 | # |
| 382 | # title: "Summary size limit" |
| 383 | # description: "Determines if a summary is less than 100 chars" |
| 384 | # expression: "document.summary.size() < 100" |
| 385 | # |
| 386 | # Example (Equality): |
| 387 | # |
| 388 | # title: "Requestor is owner" |
| 389 | # description: "Determines if requestor is the document owner" |
| 390 | # expression: "document.owner == request.auth.claims.email" |
| 391 | # |
| 392 | # Example (Logic): |
| 393 | # |
| 394 | # title: "Public documents" |
| 395 | # description: "Determine whether the document should be publicly visible" |
| 396 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 397 | # |
| 398 | # Example (Data Manipulation): |
| 399 | # |
| 400 | # title: "Notification string" |
| 401 | # description: "Create a notification string with a timestamp." |
| 402 | # expression: "'New message received at ' + string(document.create_time)" |
| 403 | # |
| 404 | # The exact variables and functions that may be referenced within an expression |
| 405 | # are determined by the service that evaluates it. See the service |
| 406 | # documentation for additional information. |
| 407 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 408 | # reporting, e.g. a file name and a position in the file. |
| 409 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 410 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 411 | # expression. |
| 412 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 413 | # describes the expression, e.g. when hovered over it in a UI. |
| 414 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 415 | # syntax. |
| 416 | }, |
| 417 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 418 | # `members` can have the following values: |
| 419 | # |
| 420 | # * `allUsers`: A special identifier that represents anyone who is |
| 421 | # on the internet; with or without a Google account. |
| 422 | # |
| 423 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 424 | # who is authenticated with a Google account or a service account. |
| 425 | # |
| 426 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 427 | # account. For example, `alice@example.com` . |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 428 | # |
| 429 | # |
| 430 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 431 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 432 | # |
| 433 | # * `group:{emailid}`: An email address that represents a Google group. |
| 434 | # For example, `admins@example.com`. |
| 435 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 436 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 437 | # identifier) representing a user that has been recently deleted. For |
| 438 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 439 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 440 | # retains the role in the binding. |
| 441 | # |
| 442 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 443 | # unique identifier) representing a service account that has been recently |
| 444 | # deleted. For example, |
| 445 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 446 | # If the service account is undeleted, this value reverts to |
| 447 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 448 | # role in the binding. |
| 449 | # |
| 450 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 451 | # identifier) representing a Google group that has been recently |
| 452 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 453 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 454 | # recovered group retains the role in the binding. |
| 455 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 456 | # |
| 457 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 458 | # users of that domain. For example, `google.com` or `example.com`. |
| 459 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 460 | "A String", |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 461 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 462 | "role": "A String", # Role that is assigned to `members`. |
| 463 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 464 | }, |
| 465 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 466 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 467 | # prevent simultaneous updates of a policy from overwriting each other. |
| 468 | # It is strongly suggested that systems make use of the `etag` in the |
| 469 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 470 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 471 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 472 | # ensure that their change will be applied to the same version of the policy. |
| 473 | # |
| 474 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 475 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 476 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 477 | # the conditions in the version `3` policy are lost. |
| 478 | "version": 42, # Specifies the format of the policy. |
| 479 | # |
| 480 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 481 | # are rejected. |
| 482 | # |
| 483 | # Any operation that affects conditional role bindings must specify version |
| 484 | # `3`. This requirement applies to the following operations: |
| 485 | # |
| 486 | # * Getting a policy that includes a conditional role binding |
| 487 | # * Adding a conditional role binding to a policy |
| 488 | # * Changing a conditional role binding in a policy |
| 489 | # * Removing any role binding, with or without a condition, from a policy |
| 490 | # that includes conditions |
| 491 | # |
| 492 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 493 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 494 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 495 | # the conditions in the version `3` policy are lost. |
| 496 | # |
| 497 | # If a policy does not include any conditions, operations on that policy may |
| 498 | # specify any valid version or leave the field unset. |
| 499 | # |
| 500 | # To learn which resources support conditions in their IAM policies, see the |
| 501 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 502 | }</pre> |
| 503 | </div> |
| 504 | |
| 505 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 506 | <code class="details" id="list">list(project, pageToken=None, pageSize=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 507 | <pre>Lists the existing snapshots. Snapshots are used in |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 508 | <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 509 | operations, which allow |
| 510 | you to manage message acknowledgments in bulk. That is, you can set the |
| 511 | acknowledgment state of messages in an existing subscription to the state |
| 512 | captured by a snapshot. |
| 513 | |
| 514 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 515 | project: string, Required. The name of the project in which to list snapshots. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 516 | Format is `projects/{project-id}`. (required) |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 517 | pageToken: string, The value returned by the last `ListSnapshotsResponse`; indicates that this |
| 518 | is a continuation of a prior `ListSnapshots` call, and that the system |
| 519 | should return the next page of data. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 520 | pageSize: integer, Maximum number of snapshots to return. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 521 | x__xgafv: string, V1 error format. |
| 522 | Allowed values |
| 523 | 1 - v1 error format |
| 524 | 2 - v2 error format |
| 525 | |
| 526 | Returns: |
| 527 | An object of the form: |
| 528 | |
| 529 | { # Response for the `ListSnapshots` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 530 | "nextPageToken": "A String", # If not empty, indicates that there may be more snapshot that match the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 531 | # request; this value should be passed in a new `ListSnapshotsRequest`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 532 | "snapshots": [ # The resulting snapshots. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 533 | { # A snapshot resource. Snapshots are used in |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 534 | # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 535 | # operations, which allow |
| 536 | # you to manage message acknowledgments in bulk. That is, you can set the |
| 537 | # acknowledgment state of messages in an existing subscription to the state |
| 538 | # captured by a snapshot. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 539 | "topic": "A String", # The name of the topic from which this snapshot is retaining messages. |
| 540 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 541 | # managing labels</a>. |
| 542 | "a_key": "A String", |
| 543 | }, |
| 544 | "expireTime": "A String", # The snapshot is guaranteed to exist up until this time. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 545 | # A newly-created snapshot expires no later than 7 days from the time of its |
| 546 | # creation. Its exact lifetime is determined at creation by the existing |
| 547 | # backlog in the source subscription. Specifically, the lifetime of the |
| 548 | # snapshot is `7 days - (age of oldest unacked message in the subscription)`. |
| 549 | # For example, consider a subscription whose oldest unacked message is 3 days |
| 550 | # old. If a snapshot is created from this subscription, the snapshot -- which |
| 551 | # will always capture this 3-day-old backlog as long as the snapshot |
| 552 | # exists -- will expire in 4 days. The service will refuse to create a |
| 553 | # snapshot that would expire in less than 1 hour after creation. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 554 | "name": "A String", # The name of the snapshot. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 555 | }, |
| 556 | ], |
| 557 | }</pre> |
| 558 | </div> |
| 559 | |
| 560 | <div class="method"> |
| 561 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 562 | <pre>Retrieves the next page of results. |
| 563 | |
| 564 | Args: |
| 565 | previous_request: The request for the previous page. (required) |
| 566 | previous_response: The response from the request for the previous page. (required) |
| 567 | |
| 568 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 569 | A request object that you can call 'execute()' on to request the next |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 570 | page. Returns None if there are no more items in the collection. |
| 571 | </pre> |
| 572 | </div> |
| 573 | |
| 574 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 575 | <code class="details" id="patch">patch(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 576 | <pre>Updates an existing snapshot. Snapshots are used in |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 577 | <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 578 | operations, which allow |
| 579 | you to manage message acknowledgments in bulk. That is, you can set the |
| 580 | acknowledgment state of messages in an existing subscription to the state |
| 581 | captured by a snapshot. |
| 582 | |
| 583 | Args: |
| 584 | name: string, The name of the snapshot. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 585 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 586 | The object takes the form of: |
| 587 | |
| 588 | { # Request for the UpdateSnapshot method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 589 | "snapshot": { # A snapshot resource. Snapshots are used in # Required. The updated snapshot object. |
| 590 | # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 591 | # operations, which allow |
| 592 | # you to manage message acknowledgments in bulk. That is, you can set the |
| 593 | # acknowledgment state of messages in an existing subscription to the state |
| 594 | # captured by a snapshot. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 595 | "topic": "A String", # The name of the topic from which this snapshot is retaining messages. |
| 596 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 597 | # managing labels</a>. |
| 598 | "a_key": "A String", |
| 599 | }, |
| 600 | "expireTime": "A String", # The snapshot is guaranteed to exist up until this time. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 601 | # A newly-created snapshot expires no later than 7 days from the time of its |
| 602 | # creation. Its exact lifetime is determined at creation by the existing |
| 603 | # backlog in the source subscription. Specifically, the lifetime of the |
| 604 | # snapshot is `7 days - (age of oldest unacked message in the subscription)`. |
| 605 | # For example, consider a subscription whose oldest unacked message is 3 days |
| 606 | # old. If a snapshot is created from this subscription, the snapshot -- which |
| 607 | # will always capture this 3-day-old backlog as long as the snapshot |
| 608 | # exists -- will expire in 4 days. The service will refuse to create a |
| 609 | # snapshot that would expire in less than 1 hour after creation. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 610 | "name": "A String", # The name of the snapshot. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 611 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 612 | "updateMask": "A String", # Required. Indicates which fields in the provided snapshot to update. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 613 | # Must be specified and non-empty. |
| 614 | } |
| 615 | |
| 616 | x__xgafv: string, V1 error format. |
| 617 | Allowed values |
| 618 | 1 - v1 error format |
| 619 | 2 - v2 error format |
| 620 | |
| 621 | Returns: |
| 622 | An object of the form: |
| 623 | |
| 624 | { # A snapshot resource. Snapshots are used in |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 625 | # <a href="https://cloud.google.com/pubsub/docs/replay-overview">Seek</a> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 626 | # operations, which allow |
| 627 | # you to manage message acknowledgments in bulk. That is, you can set the |
| 628 | # acknowledgment state of messages in an existing subscription to the state |
| 629 | # captured by a snapshot. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 630 | "topic": "A String", # The name of the topic from which this snapshot is retaining messages. |
| 631 | "labels": { # See <a href="https://cloud.google.com/pubsub/docs/labels"> Creating and |
| 632 | # managing labels</a>. |
| 633 | "a_key": "A String", |
| 634 | }, |
| 635 | "expireTime": "A String", # The snapshot is guaranteed to exist up until this time. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 636 | # A newly-created snapshot expires no later than 7 days from the time of its |
| 637 | # creation. Its exact lifetime is determined at creation by the existing |
| 638 | # backlog in the source subscription. Specifically, the lifetime of the |
| 639 | # snapshot is `7 days - (age of oldest unacked message in the subscription)`. |
| 640 | # For example, consider a subscription whose oldest unacked message is 3 days |
| 641 | # old. If a snapshot is created from this subscription, the snapshot -- which |
| 642 | # will always capture this 3-day-old backlog as long as the snapshot |
| 643 | # exists -- will expire in 4 days. The service will refuse to create a |
| 644 | # snapshot that would expire in less than 1 hour after creation. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 645 | "name": "A String", # The name of the snapshot. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 646 | }</pre> |
| 647 | </div> |
| 648 | |
| 649 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 650 | <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None, x__xgafv=None)</code> |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 651 | <pre>Sets the access control policy on the specified resource. Replaces any |
| 652 | existing policy. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 653 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 654 | Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 655 | |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 656 | Args: |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 657 | resource: string, REQUIRED: The resource for which the policy is being specified. |
Sai Cheemalapati | e833b79 | 2017-03-24 15:06:46 -0700 | [diff] [blame] | 658 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 659 | body: object, The request body. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 660 | The object takes the form of: |
| 661 | |
| 662 | { # Request message for `SetIamPolicy` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 663 | "policy": { # An Identity and Access Management (IAM) policy, which specifies access # REQUIRED: The complete policy to be applied to the `resource`. The size of |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 664 | # the policy is limited to a few 10s of KB. An empty policy is a |
| 665 | # valid policy but certain Cloud Platform services (such as Projects) |
| 666 | # might reject them. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 667 | # controls for Google Cloud resources. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 668 | # |
| 669 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 670 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 671 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 672 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 673 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 674 | # custom role. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 675 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 676 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 677 | # `condition`, which is a logical expression that allows access to a resource |
| 678 | # only if the expression evaluates to `true`. A condition can add constraints |
| 679 | # based on attributes of the request, the resource, or both. To learn which |
| 680 | # resources support conditions in their IAM policies, see the |
| 681 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 682 | # |
| 683 | # **JSON example:** |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 684 | # |
| 685 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 686 | # "bindings": [ |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 687 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 688 | # "role": "roles/resourcemanager.organizationAdmin", |
| 689 | # "members": [ |
| 690 | # "user:mike@example.com", |
| 691 | # "group:admins@example.com", |
| 692 | # "domain:google.com", |
| 693 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 694 | # ] |
| 695 | # }, |
| 696 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 697 | # "role": "roles/resourcemanager.organizationViewer", |
| 698 | # "members": [ |
| 699 | # "user:eve@example.com" |
| 700 | # ], |
| 701 | # "condition": { |
| 702 | # "title": "expirable access", |
| 703 | # "description": "Does not grant access after Sep 2020", |
| 704 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 705 | # } |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 706 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 707 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 708 | # "etag": "BwWWja0YfJA=", |
| 709 | # "version": 3 |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 710 | # } |
| 711 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 712 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 713 | # |
| 714 | # bindings: |
| 715 | # - members: |
| 716 | # - user:mike@example.com |
| 717 | # - group:admins@example.com |
| 718 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 719 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 720 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 721 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 722 | # - user:eve@example.com |
| 723 | # role: roles/resourcemanager.organizationViewer |
| 724 | # condition: |
| 725 | # title: expirable access |
| 726 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 727 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 728 | # - etag: BwWWja0YfJA= |
| 729 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 730 | # |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 731 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 732 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 733 | "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] | 734 | # `condition` that determines how and when the `bindings` are applied. Each |
| 735 | # of the `bindings` must contain at least one member. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 736 | { # Associates `members` with a `role`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 737 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 738 | # |
| 739 | # If the condition evaluates to `true`, then this binding applies to the |
| 740 | # current request. |
| 741 | # |
| 742 | # If the condition evaluates to `false`, then this binding does not apply to |
| 743 | # the current request. However, a different role binding might grant the same |
| 744 | # role to one or more of the members in this binding. |
| 745 | # |
| 746 | # To learn which resources support conditions in their IAM policies, see the |
| 747 | # [IAM |
| 748 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 749 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 750 | # are documented at https://github.com/google/cel-spec. |
| 751 | # |
| 752 | # Example (Comparison): |
| 753 | # |
| 754 | # title: "Summary size limit" |
| 755 | # description: "Determines if a summary is less than 100 chars" |
| 756 | # expression: "document.summary.size() < 100" |
| 757 | # |
| 758 | # Example (Equality): |
| 759 | # |
| 760 | # title: "Requestor is owner" |
| 761 | # description: "Determines if requestor is the document owner" |
| 762 | # expression: "document.owner == request.auth.claims.email" |
| 763 | # |
| 764 | # Example (Logic): |
| 765 | # |
| 766 | # title: "Public documents" |
| 767 | # description: "Determine whether the document should be publicly visible" |
| 768 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 769 | # |
| 770 | # Example (Data Manipulation): |
| 771 | # |
| 772 | # title: "Notification string" |
| 773 | # description: "Create a notification string with a timestamp." |
| 774 | # expression: "'New message received at ' + string(document.create_time)" |
| 775 | # |
| 776 | # The exact variables and functions that may be referenced within an expression |
| 777 | # are determined by the service that evaluates it. See the service |
| 778 | # documentation for additional information. |
| 779 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 780 | # reporting, e.g. a file name and a position in the file. |
| 781 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 782 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 783 | # expression. |
| 784 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 785 | # describes the expression, e.g. when hovered over it in a UI. |
| 786 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 787 | # syntax. |
| 788 | }, |
| 789 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 790 | # `members` can have the following values: |
| 791 | # |
| 792 | # * `allUsers`: A special identifier that represents anyone who is |
| 793 | # on the internet; with or without a Google account. |
| 794 | # |
| 795 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 796 | # who is authenticated with a Google account or a service account. |
| 797 | # |
| 798 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 799 | # account. For example, `alice@example.com` . |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 800 | # |
| 801 | # |
| 802 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 803 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 804 | # |
| 805 | # * `group:{emailid}`: An email address that represents a Google group. |
| 806 | # For example, `admins@example.com`. |
| 807 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 808 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 809 | # identifier) representing a user that has been recently deleted. For |
| 810 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 811 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 812 | # retains the role in the binding. |
| 813 | # |
| 814 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 815 | # unique identifier) representing a service account that has been recently |
| 816 | # deleted. For example, |
| 817 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 818 | # If the service account is undeleted, this value reverts to |
| 819 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 820 | # role in the binding. |
| 821 | # |
| 822 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 823 | # identifier) representing a Google group that has been recently |
| 824 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 825 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 826 | # recovered group retains the role in the binding. |
| 827 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 828 | # |
| 829 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 830 | # users of that domain. For example, `google.com` or `example.com`. |
| 831 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 832 | "A String", |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 833 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 834 | "role": "A String", # Role that is assigned to `members`. |
| 835 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 836 | }, |
| 837 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 838 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 839 | # prevent simultaneous updates of a policy from overwriting each other. |
| 840 | # It is strongly suggested that systems make use of the `etag` in the |
| 841 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 842 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 843 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 844 | # ensure that their change will be applied to the same version of the policy. |
| 845 | # |
| 846 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 847 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 848 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 849 | # the conditions in the version `3` policy are lost. |
| 850 | "version": 42, # Specifies the format of the policy. |
| 851 | # |
| 852 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 853 | # are rejected. |
| 854 | # |
| 855 | # Any operation that affects conditional role bindings must specify version |
| 856 | # `3`. This requirement applies to the following operations: |
| 857 | # |
| 858 | # * Getting a policy that includes a conditional role binding |
| 859 | # * Adding a conditional role binding to a policy |
| 860 | # * Changing a conditional role binding in a policy |
| 861 | # * Removing any role binding, with or without a condition, from a policy |
| 862 | # that includes conditions |
| 863 | # |
| 864 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 865 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 866 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 867 | # the conditions in the version `3` policy are lost. |
| 868 | # |
| 869 | # If a policy does not include any conditions, operations on that policy may |
| 870 | # specify any valid version or leave the field unset. |
| 871 | # |
| 872 | # To learn which resources support conditions in their IAM policies, see the |
| 873 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 874 | }, |
| 875 | } |
| 876 | |
| 877 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 878 | Allowed values |
| 879 | 1 - v1 error format |
| 880 | 2 - v2 error format |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 881 | |
| 882 | Returns: |
| 883 | An object of the form: |
| 884 | |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 885 | { # An Identity and Access Management (IAM) policy, which specifies access |
| 886 | # controls for Google Cloud resources. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 887 | # |
| 888 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 889 | # A `Policy` is a collection of `bindings`. A `binding` binds one or more |
| 890 | # `members` to a single `role`. Members can be user accounts, service accounts, |
| 891 | # Google groups, and domains (such as G Suite). A `role` is a named list of |
| 892 | # permissions; each `role` can be an IAM predefined role or a user-created |
| 893 | # custom role. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 894 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 895 | # For some types of Google Cloud resources, a `binding` can also specify a |
| 896 | # `condition`, which is a logical expression that allows access to a resource |
| 897 | # only if the expression evaluates to `true`. A condition can add constraints |
| 898 | # based on attributes of the request, the resource, or both. To learn which |
| 899 | # resources support conditions in their IAM policies, see the |
| 900 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 901 | # |
| 902 | # **JSON example:** |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 903 | # |
| 904 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 905 | # "bindings": [ |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 906 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 907 | # "role": "roles/resourcemanager.organizationAdmin", |
| 908 | # "members": [ |
| 909 | # "user:mike@example.com", |
| 910 | # "group:admins@example.com", |
| 911 | # "domain:google.com", |
| 912 | # "serviceAccount:my-project-id@appspot.gserviceaccount.com" |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 913 | # ] |
| 914 | # }, |
| 915 | # { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 916 | # "role": "roles/resourcemanager.organizationViewer", |
| 917 | # "members": [ |
| 918 | # "user:eve@example.com" |
| 919 | # ], |
| 920 | # "condition": { |
| 921 | # "title": "expirable access", |
| 922 | # "description": "Does not grant access after Sep 2020", |
| 923 | # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 924 | # } |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 925 | # } |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 926 | # ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 927 | # "etag": "BwWWja0YfJA=", |
| 928 | # "version": 3 |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 929 | # } |
| 930 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 931 | # **YAML example:** |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 932 | # |
| 933 | # bindings: |
| 934 | # - members: |
| 935 | # - user:mike@example.com |
| 936 | # - group:admins@example.com |
| 937 | # - domain:google.com |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 938 | # - serviceAccount:my-project-id@appspot.gserviceaccount.com |
| 939 | # role: roles/resourcemanager.organizationAdmin |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 940 | # - members: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 941 | # - user:eve@example.com |
| 942 | # role: roles/resourcemanager.organizationViewer |
| 943 | # condition: |
| 944 | # title: expirable access |
| 945 | # description: Does not grant access after Sep 2020 |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 946 | # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 947 | # - etag: BwWWja0YfJA= |
| 948 | # - version: 3 |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 949 | # |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 950 | # For a description of IAM and its features, see the |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 951 | # [IAM documentation](https://cloud.google.com/iam/docs/). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 952 | "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] | 953 | # `condition` that determines how and when the `bindings` are applied. Each |
| 954 | # of the `bindings` must contain at least one member. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 955 | { # Associates `members` with a `role`. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 956 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 957 | # |
| 958 | # If the condition evaluates to `true`, then this binding applies to the |
| 959 | # current request. |
| 960 | # |
| 961 | # If the condition evaluates to `false`, then this binding does not apply to |
| 962 | # the current request. However, a different role binding might grant the same |
| 963 | # role to one or more of the members in this binding. |
| 964 | # |
| 965 | # To learn which resources support conditions in their IAM policies, see the |
| 966 | # [IAM |
| 967 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 968 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 969 | # are documented at https://github.com/google/cel-spec. |
| 970 | # |
| 971 | # Example (Comparison): |
| 972 | # |
| 973 | # title: "Summary size limit" |
| 974 | # description: "Determines if a summary is less than 100 chars" |
| 975 | # expression: "document.summary.size() < 100" |
| 976 | # |
| 977 | # Example (Equality): |
| 978 | # |
| 979 | # title: "Requestor is owner" |
| 980 | # description: "Determines if requestor is the document owner" |
| 981 | # expression: "document.owner == request.auth.claims.email" |
| 982 | # |
| 983 | # Example (Logic): |
| 984 | # |
| 985 | # title: "Public documents" |
| 986 | # description: "Determine whether the document should be publicly visible" |
| 987 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 988 | # |
| 989 | # Example (Data Manipulation): |
| 990 | # |
| 991 | # title: "Notification string" |
| 992 | # description: "Create a notification string with a timestamp." |
| 993 | # expression: "'New message received at ' + string(document.create_time)" |
| 994 | # |
| 995 | # The exact variables and functions that may be referenced within an expression |
| 996 | # are determined by the service that evaluates it. See the service |
| 997 | # documentation for additional information. |
| 998 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 999 | # reporting, e.g. a file name and a position in the file. |
| 1000 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 1001 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 1002 | # expression. |
| 1003 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 1004 | # describes the expression, e.g. when hovered over it in a UI. |
| 1005 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 1006 | # syntax. |
| 1007 | }, |
| 1008 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1009 | # `members` can have the following values: |
| 1010 | # |
| 1011 | # * `allUsers`: A special identifier that represents anyone who is |
| 1012 | # on the internet; with or without a Google account. |
| 1013 | # |
| 1014 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 1015 | # who is authenticated with a Google account or a service account. |
| 1016 | # |
| 1017 | # * `user:{emailid}`: An email address that represents a specific Google |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1018 | # account. For example, `alice@example.com` . |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1019 | # |
| 1020 | # |
| 1021 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 1022 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 1023 | # |
| 1024 | # * `group:{emailid}`: An email address that represents a Google group. |
| 1025 | # For example, `admins@example.com`. |
| 1026 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1027 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 1028 | # identifier) representing a user that has been recently deleted. For |
| 1029 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 1030 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 1031 | # retains the role in the binding. |
| 1032 | # |
| 1033 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 1034 | # unique identifier) representing a service account that has been recently |
| 1035 | # deleted. For example, |
| 1036 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 1037 | # If the service account is undeleted, this value reverts to |
| 1038 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 1039 | # role in the binding. |
| 1040 | # |
| 1041 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 1042 | # identifier) representing a Google group that has been recently |
| 1043 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 1044 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 1045 | # recovered group retains the role in the binding. |
| 1046 | # |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1047 | # |
| 1048 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1049 | # users of that domain. For example, `google.com` or `example.com`. |
| 1050 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1051 | "A String", |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1052 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1053 | "role": "A String", # Role that is assigned to `members`. |
| 1054 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1055 | }, |
| 1056 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1057 | "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help |
| 1058 | # prevent simultaneous updates of a policy from overwriting each other. |
| 1059 | # It is strongly suggested that systems make use of the `etag` in the |
| 1060 | # read-modify-write cycle to perform policy updates in order to avoid race |
| 1061 | # conditions: An `etag` is returned in the response to `getIamPolicy`, and |
| 1062 | # systems are expected to put that etag in the request to `setIamPolicy` to |
| 1063 | # ensure that their change will be applied to the same version of the policy. |
| 1064 | # |
| 1065 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 1066 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 1067 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 1068 | # the conditions in the version `3` policy are lost. |
| 1069 | "version": 42, # Specifies the format of the policy. |
| 1070 | # |
| 1071 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 1072 | # are rejected. |
| 1073 | # |
| 1074 | # Any operation that affects conditional role bindings must specify version |
| 1075 | # `3`. This requirement applies to the following operations: |
| 1076 | # |
| 1077 | # * Getting a policy that includes a conditional role binding |
| 1078 | # * Adding a conditional role binding to a policy |
| 1079 | # * Changing a conditional role binding in a policy |
| 1080 | # * Removing any role binding, with or without a condition, from a policy |
| 1081 | # that includes conditions |
| 1082 | # |
| 1083 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 1084 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 1085 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 1086 | # the conditions in the version `3` policy are lost. |
| 1087 | # |
| 1088 | # If a policy does not include any conditions, operations on that policy may |
| 1089 | # specify any valid version or leave the field unset. |
| 1090 | # |
| 1091 | # To learn which resources support conditions in their IAM policies, see the |
| 1092 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1093 | }</pre> |
| 1094 | </div> |
| 1095 | |
| 1096 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1097 | <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None, x__xgafv=None)</code> |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1098 | <pre>Returns permissions that a caller has on the specified resource. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1099 | If the resource does not exist, this will return an empty set of |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1100 | permissions, not a `NOT_FOUND` error. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1101 | |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1102 | Note: This operation is designed to be used for building permission-aware |
| 1103 | UIs and command-line tools, not for authorization checking. This operation |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1104 | may "fail open" without warning. |
Sai Cheemalapati | c30d2b5 | 2017-03-13 12:12:03 -0400 | [diff] [blame] | 1105 | |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1106 | Args: |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1107 | resource: string, REQUIRED: The resource for which the policy detail is being requested. |
Sai Cheemalapati | e833b79 | 2017-03-24 15:06:46 -0700 | [diff] [blame] | 1108 | See the operation documentation for the appropriate value for this field. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1109 | body: object, The request body. |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1110 | The object takes the form of: |
| 1111 | |
| 1112 | { # Request message for `TestIamPermissions` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1113 | "permissions": [ # The set of permissions to check for the `resource`. Permissions with |
| 1114 | # wildcards (such as '*' or 'storage.*') are not allowed. For more |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1115 | # information see |
| 1116 | # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1117 | "A String", |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1118 | ], |
| 1119 | } |
| 1120 | |
| 1121 | x__xgafv: string, V1 error format. |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1122 | Allowed values |
| 1123 | 1 - v1 error format |
| 1124 | 2 - v2 error format |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1125 | |
| 1126 | Returns: |
| 1127 | An object of the form: |
| 1128 | |
| 1129 | { # Response message for `TestIamPermissions` method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1130 | "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is |
Jon Wayne Parrott | 692617a | 2017-01-06 09:58:29 -0800 | [diff] [blame] | 1131 | # allowed. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1132 | "A String", |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 1133 | ], |
| 1134 | }</pre> |
| 1135 | </div> |
| 1136 | |
| 1137 | </body></html> |