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