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 | 4ed7d3f | 2020-05-27 12:20:54 -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 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
| 205 | # `condition` that determines how and when the `bindings` are applied. Each |
| 206 | # of the `bindings` must contain at least one member. |
| 207 | { # Associates `members` with a `role`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 208 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 209 | # |
| 210 | # If the condition evaluates to `true`, then this binding applies to the |
| 211 | # current request. |
| 212 | # |
| 213 | # If the condition evaluates to `false`, then this binding does not apply to |
| 214 | # the current request. However, a different role binding might grant the same |
| 215 | # role to one or more of the members in this binding. |
| 216 | # |
| 217 | # To learn which resources support conditions in their IAM policies, see the |
| 218 | # [IAM |
| 219 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 220 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 221 | # are documented at https://github.com/google/cel-spec. |
| 222 | # |
| 223 | # Example (Comparison): |
| 224 | # |
| 225 | # title: "Summary size limit" |
| 226 | # description: "Determines if a summary is less than 100 chars" |
| 227 | # expression: "document.summary.size() < 100" |
| 228 | # |
| 229 | # Example (Equality): |
| 230 | # |
| 231 | # title: "Requestor is owner" |
| 232 | # description: "Determines if requestor is the document owner" |
| 233 | # expression: "document.owner == request.auth.claims.email" |
| 234 | # |
| 235 | # Example (Logic): |
| 236 | # |
| 237 | # title: "Public documents" |
| 238 | # description: "Determine whether the document should be publicly visible" |
| 239 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 240 | # |
| 241 | # Example (Data Manipulation): |
| 242 | # |
| 243 | # title: "Notification string" |
| 244 | # description: "Create a notification string with a timestamp." |
| 245 | # expression: "'New message received at ' + string(document.create_time)" |
| 246 | # |
| 247 | # The exact variables and functions that may be referenced within an expression |
| 248 | # are determined by the service that evaluates it. See the service |
| 249 | # documentation for additional information. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 250 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 251 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 252 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 253 | # reporting, e.g. a file name and a position in the file. |
| 254 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 255 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 256 | # expression. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 257 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 258 | # syntax. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 259 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 260 | "role": "A String", # Role that is assigned to `members`. |
| 261 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 262 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
| 263 | # `members` can have the following values: |
| 264 | # |
| 265 | # * `allUsers`: A special identifier that represents anyone who is |
| 266 | # on the internet; with or without a Google account. |
| 267 | # |
| 268 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 269 | # who is authenticated with a Google account or a service account. |
| 270 | # |
| 271 | # * `user:{emailid}`: An email address that represents a specific Google |
| 272 | # account. For example, `alice@example.com` . |
| 273 | # |
| 274 | # |
| 275 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 276 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 277 | # |
| 278 | # * `group:{emailid}`: An email address that represents a Google group. |
| 279 | # For example, `admins@example.com`. |
| 280 | # |
| 281 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 282 | # identifier) representing a user that has been recently deleted. For |
| 283 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 284 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 285 | # retains the role in the binding. |
| 286 | # |
| 287 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 288 | # unique identifier) representing a service account that has been recently |
| 289 | # deleted. For example, |
| 290 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 291 | # If the service account is undeleted, this value reverts to |
| 292 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 293 | # role in the binding. |
| 294 | # |
| 295 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 296 | # identifier) representing a Google group that has been recently |
| 297 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 298 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 299 | # recovered group retains the role in the binding. |
| 300 | # |
| 301 | # |
| 302 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
| 303 | # users of that domain. For example, `google.com` or `example.com`. |
| 304 | # |
| 305 | "A String", |
| 306 | ], |
| 307 | }, |
| 308 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 309 | "version": 42, # Specifies the format of the policy. |
| 310 | # |
| 311 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 312 | # are rejected. |
| 313 | # |
| 314 | # Any operation that affects conditional role bindings must specify version |
| 315 | # `3`. This requirement applies to the following operations: |
| 316 | # |
| 317 | # * Getting a policy that includes a conditional role binding |
| 318 | # * Adding a conditional role binding to a policy |
| 319 | # * Changing a conditional role binding in a policy |
| 320 | # * Removing any role binding, with or without a condition, from a policy |
| 321 | # that includes conditions |
| 322 | # |
| 323 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 324 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 325 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 326 | # the conditions in the version `3` policy are lost. |
| 327 | # |
| 328 | # If a policy does not include any conditions, operations on that policy may |
| 329 | # specify any valid version or leave the field unset. |
| 330 | # |
| 331 | # To learn which resources support conditions in their IAM policies, see the |
| 332 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 333 | "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. |
| 334 | { # Specifies the audit configuration for a service. |
| 335 | # The configuration determines which permission types are logged, and what |
| 336 | # identities, if any, are exempted from logging. |
| 337 | # An AuditConfig must have one or more AuditLogConfigs. |
| 338 | # |
| 339 | # If there are AuditConfigs for both `allServices` and a specific service, |
| 340 | # the union of the two AuditConfigs is used for that service: the log_types |
| 341 | # specified in each AuditConfig are enabled, and the exempted_members in each |
| 342 | # AuditLogConfig are exempted. |
| 343 | # |
| 344 | # Example Policy with multiple AuditConfigs: |
| 345 | # |
| 346 | # { |
| 347 | # "audit_configs": [ |
| 348 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 349 | # "service": "allServices", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 350 | # "audit_log_configs": [ |
| 351 | # { |
| 352 | # "log_type": "DATA_READ", |
| 353 | # "exempted_members": [ |
| 354 | # "user:jose@example.com" |
| 355 | # ] |
| 356 | # }, |
| 357 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 358 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 359 | # }, |
| 360 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 361 | # "log_type": "ADMIN_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 362 | # } |
| 363 | # ] |
| 364 | # }, |
| 365 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 366 | # "service": "sampleservice.googleapis.com", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 367 | # "audit_log_configs": [ |
| 368 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 369 | # "log_type": "DATA_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 370 | # }, |
| 371 | # { |
| 372 | # "log_type": "DATA_WRITE", |
| 373 | # "exempted_members": [ |
| 374 | # "user:aliya@example.com" |
| 375 | # ] |
| 376 | # } |
| 377 | # ] |
| 378 | # } |
| 379 | # ] |
| 380 | # } |
| 381 | # |
| 382 | # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ |
| 383 | # logging. It also exempts jose@example.com from DATA_READ logging, and |
| 384 | # aliya@example.com from DATA_WRITE logging. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 385 | "service": "A String", # Specifies a service that will be enabled for audit logging. |
| 386 | # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. |
| 387 | # `allServices` is a special value that covers all services. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 388 | "auditLogConfigs": [ # The configuration for logging of each type of permission. |
| 389 | { # Provides the configuration for logging a type of permissions. |
| 390 | # Example: |
| 391 | # |
| 392 | # { |
| 393 | # "audit_log_configs": [ |
| 394 | # { |
| 395 | # "log_type": "DATA_READ", |
| 396 | # "exempted_members": [ |
| 397 | # "user:jose@example.com" |
| 398 | # ] |
| 399 | # }, |
| 400 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 401 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 402 | # } |
| 403 | # ] |
| 404 | # } |
| 405 | # |
| 406 | # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting |
| 407 | # jose@example.com from DATA_READ logging. |
| 408 | "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of |
| 409 | # permission. |
| 410 | # Follows the same format of Binding.members. |
| 411 | "A String", |
| 412 | ], |
| 413 | "logType": "A String", # The log type that this config enables. |
| 414 | }, |
| 415 | ], |
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 | d059ad8 | 2020-07-22 17:02:09 -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"` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 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 | 4ed7d3f | 2020-05-27 12:20:54 -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 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
| 523 | # `condition` that determines how and when the `bindings` are applied. Each |
| 524 | # of the `bindings` must contain at least one member. |
| 525 | { # Associates `members` with a `role`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 526 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 527 | # |
| 528 | # If the condition evaluates to `true`, then this binding applies to the |
| 529 | # current request. |
| 530 | # |
| 531 | # If the condition evaluates to `false`, then this binding does not apply to |
| 532 | # the current request. However, a different role binding might grant the same |
| 533 | # role to one or more of the members in this binding. |
| 534 | # |
| 535 | # To learn which resources support conditions in their IAM policies, see the |
| 536 | # [IAM |
| 537 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 538 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 539 | # are documented at https://github.com/google/cel-spec. |
| 540 | # |
| 541 | # Example (Comparison): |
| 542 | # |
| 543 | # title: "Summary size limit" |
| 544 | # description: "Determines if a summary is less than 100 chars" |
| 545 | # expression: "document.summary.size() < 100" |
| 546 | # |
| 547 | # Example (Equality): |
| 548 | # |
| 549 | # title: "Requestor is owner" |
| 550 | # description: "Determines if requestor is the document owner" |
| 551 | # expression: "document.owner == request.auth.claims.email" |
| 552 | # |
| 553 | # Example (Logic): |
| 554 | # |
| 555 | # title: "Public documents" |
| 556 | # description: "Determine whether the document should be publicly visible" |
| 557 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 558 | # |
| 559 | # Example (Data Manipulation): |
| 560 | # |
| 561 | # title: "Notification string" |
| 562 | # description: "Create a notification string with a timestamp." |
| 563 | # expression: "'New message received at ' + string(document.create_time)" |
| 564 | # |
| 565 | # The exact variables and functions that may be referenced within an expression |
| 566 | # are determined by the service that evaluates it. See the service |
| 567 | # documentation for additional information. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 568 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 569 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 570 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 571 | # reporting, e.g. a file name and a position in the file. |
| 572 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 573 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 574 | # expression. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 575 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 576 | # syntax. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 577 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 578 | "role": "A String", # Role that is assigned to `members`. |
| 579 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 580 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
| 581 | # `members` can have the following values: |
| 582 | # |
| 583 | # * `allUsers`: A special identifier that represents anyone who is |
| 584 | # on the internet; with or without a Google account. |
| 585 | # |
| 586 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 587 | # who is authenticated with a Google account or a service account. |
| 588 | # |
| 589 | # * `user:{emailid}`: An email address that represents a specific Google |
| 590 | # account. For example, `alice@example.com` . |
| 591 | # |
| 592 | # |
| 593 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 594 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 595 | # |
| 596 | # * `group:{emailid}`: An email address that represents a Google group. |
| 597 | # For example, `admins@example.com`. |
| 598 | # |
| 599 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 600 | # identifier) representing a user that has been recently deleted. For |
| 601 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 602 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 603 | # retains the role in the binding. |
| 604 | # |
| 605 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 606 | # unique identifier) representing a service account that has been recently |
| 607 | # deleted. For example, |
| 608 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 609 | # If the service account is undeleted, this value reverts to |
| 610 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 611 | # role in the binding. |
| 612 | # |
| 613 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 614 | # identifier) representing a Google group that has been recently |
| 615 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 616 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 617 | # recovered group retains the role in the binding. |
| 618 | # |
| 619 | # |
| 620 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
| 621 | # users of that domain. For example, `google.com` or `example.com`. |
| 622 | # |
| 623 | "A String", |
| 624 | ], |
| 625 | }, |
| 626 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 627 | "version": 42, # Specifies the format of the policy. |
| 628 | # |
| 629 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 630 | # are rejected. |
| 631 | # |
| 632 | # Any operation that affects conditional role bindings must specify version |
| 633 | # `3`. This requirement applies to the following operations: |
| 634 | # |
| 635 | # * Getting a policy that includes a conditional role binding |
| 636 | # * Adding a conditional role binding to a policy |
| 637 | # * Changing a conditional role binding in a policy |
| 638 | # * Removing any role binding, with or without a condition, from a policy |
| 639 | # that includes conditions |
| 640 | # |
| 641 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 642 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 643 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 644 | # the conditions in the version `3` policy are lost. |
| 645 | # |
| 646 | # If a policy does not include any conditions, operations on that policy may |
| 647 | # specify any valid version or leave the field unset. |
| 648 | # |
| 649 | # To learn which resources support conditions in their IAM policies, see the |
| 650 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 651 | "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. |
| 652 | { # Specifies the audit configuration for a service. |
| 653 | # The configuration determines which permission types are logged, and what |
| 654 | # identities, if any, are exempted from logging. |
| 655 | # An AuditConfig must have one or more AuditLogConfigs. |
| 656 | # |
| 657 | # If there are AuditConfigs for both `allServices` and a specific service, |
| 658 | # the union of the two AuditConfigs is used for that service: the log_types |
| 659 | # specified in each AuditConfig are enabled, and the exempted_members in each |
| 660 | # AuditLogConfig are exempted. |
| 661 | # |
| 662 | # Example Policy with multiple AuditConfigs: |
| 663 | # |
| 664 | # { |
| 665 | # "audit_configs": [ |
| 666 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 667 | # "service": "allServices", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 668 | # "audit_log_configs": [ |
| 669 | # { |
| 670 | # "log_type": "DATA_READ", |
| 671 | # "exempted_members": [ |
| 672 | # "user:jose@example.com" |
| 673 | # ] |
| 674 | # }, |
| 675 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 676 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 677 | # }, |
| 678 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 679 | # "log_type": "ADMIN_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 680 | # } |
| 681 | # ] |
| 682 | # }, |
| 683 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 684 | # "service": "sampleservice.googleapis.com", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 685 | # "audit_log_configs": [ |
| 686 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 687 | # "log_type": "DATA_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 688 | # }, |
| 689 | # { |
| 690 | # "log_type": "DATA_WRITE", |
| 691 | # "exempted_members": [ |
| 692 | # "user:aliya@example.com" |
| 693 | # ] |
| 694 | # } |
| 695 | # ] |
| 696 | # } |
| 697 | # ] |
| 698 | # } |
| 699 | # |
| 700 | # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ |
| 701 | # logging. It also exempts jose@example.com from DATA_READ logging, and |
| 702 | # aliya@example.com from DATA_WRITE logging. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 703 | "service": "A String", # Specifies a service that will be enabled for audit logging. |
| 704 | # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. |
| 705 | # `allServices` is a special value that covers all services. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 706 | "auditLogConfigs": [ # The configuration for logging of each type of permission. |
| 707 | { # Provides the configuration for logging a type of permissions. |
| 708 | # Example: |
| 709 | # |
| 710 | # { |
| 711 | # "audit_log_configs": [ |
| 712 | # { |
| 713 | # "log_type": "DATA_READ", |
| 714 | # "exempted_members": [ |
| 715 | # "user:jose@example.com" |
| 716 | # ] |
| 717 | # }, |
| 718 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 719 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 720 | # } |
| 721 | # ] |
| 722 | # } |
| 723 | # |
| 724 | # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting |
| 725 | # jose@example.com from DATA_READ logging. |
| 726 | "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of |
| 727 | # permission. |
| 728 | # Follows the same format of Binding.members. |
| 729 | "A String", |
| 730 | ], |
| 731 | "logType": "A String", # The log type that this config enables. |
| 732 | }, |
| 733 | ], |
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 | 4ed7d3f | 2020-05-27 12:20:54 -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 | "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a |
| 827 | # `condition` that determines how and when the `bindings` are applied. Each |
| 828 | # of the `bindings` must contain at least one member. |
| 829 | { # Associates `members` with a `role`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 830 | "condition": { # Represents a textual expression in the Common Expression Language (CEL) # The condition that is associated with this binding. |
| 831 | # |
| 832 | # If the condition evaluates to `true`, then this binding applies to the |
| 833 | # current request. |
| 834 | # |
| 835 | # If the condition evaluates to `false`, then this binding does not apply to |
| 836 | # the current request. However, a different role binding might grant the same |
| 837 | # role to one or more of the members in this binding. |
| 838 | # |
| 839 | # To learn which resources support conditions in their IAM policies, see the |
| 840 | # [IAM |
| 841 | # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
| 842 | # syntax. CEL is a C-like expression language. The syntax and semantics of CEL |
| 843 | # are documented at https://github.com/google/cel-spec. |
| 844 | # |
| 845 | # Example (Comparison): |
| 846 | # |
| 847 | # title: "Summary size limit" |
| 848 | # description: "Determines if a summary is less than 100 chars" |
| 849 | # expression: "document.summary.size() < 100" |
| 850 | # |
| 851 | # Example (Equality): |
| 852 | # |
| 853 | # title: "Requestor is owner" |
| 854 | # description: "Determines if requestor is the document owner" |
| 855 | # expression: "document.owner == request.auth.claims.email" |
| 856 | # |
| 857 | # Example (Logic): |
| 858 | # |
| 859 | # title: "Public documents" |
| 860 | # description: "Determine whether the document should be publicly visible" |
| 861 | # expression: "document.type != 'private' && document.type != 'internal'" |
| 862 | # |
| 863 | # Example (Data Manipulation): |
| 864 | # |
| 865 | # title: "Notification string" |
| 866 | # description: "Create a notification string with a timestamp." |
| 867 | # expression: "'New message received at ' + string(document.create_time)" |
| 868 | # |
| 869 | # The exact variables and functions that may be referenced within an expression |
| 870 | # are determined by the service that evaluates it. See the service |
| 871 | # documentation for additional information. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 872 | "description": "A String", # Optional. Description of the expression. This is a longer text which |
| 873 | # describes the expression, e.g. when hovered over it in a UI. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 874 | "location": "A String", # Optional. String indicating the location of the expression for error |
| 875 | # reporting, e.g. a file name and a position in the file. |
| 876 | "title": "A String", # Optional. Title for the expression, i.e. a short string describing |
| 877 | # its purpose. This can be used e.g. in UIs which allow to enter the |
| 878 | # expression. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 879 | "expression": "A String", # Textual representation of an expression in Common Expression Language |
| 880 | # syntax. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 881 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 882 | "role": "A String", # Role that is assigned to `members`. |
| 883 | # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 884 | "members": [ # Specifies the identities requesting access for a Cloud Platform resource. |
| 885 | # `members` can have the following values: |
| 886 | # |
| 887 | # * `allUsers`: A special identifier that represents anyone who is |
| 888 | # on the internet; with or without a Google account. |
| 889 | # |
| 890 | # * `allAuthenticatedUsers`: A special identifier that represents anyone |
| 891 | # who is authenticated with a Google account or a service account. |
| 892 | # |
| 893 | # * `user:{emailid}`: An email address that represents a specific Google |
| 894 | # account. For example, `alice@example.com` . |
| 895 | # |
| 896 | # |
| 897 | # * `serviceAccount:{emailid}`: An email address that represents a service |
| 898 | # account. For example, `my-other-app@appspot.gserviceaccount.com`. |
| 899 | # |
| 900 | # * `group:{emailid}`: An email address that represents a Google group. |
| 901 | # For example, `admins@example.com`. |
| 902 | # |
| 903 | # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 904 | # identifier) representing a user that has been recently deleted. For |
| 905 | # example, `alice@example.com?uid=123456789012345678901`. If the user is |
| 906 | # recovered, this value reverts to `user:{emailid}` and the recovered user |
| 907 | # retains the role in the binding. |
| 908 | # |
| 909 | # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus |
| 910 | # unique identifier) representing a service account that has been recently |
| 911 | # deleted. For example, |
| 912 | # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. |
| 913 | # If the service account is undeleted, this value reverts to |
| 914 | # `serviceAccount:{emailid}` and the undeleted service account retains the |
| 915 | # role in the binding. |
| 916 | # |
| 917 | # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique |
| 918 | # identifier) representing a Google group that has been recently |
| 919 | # deleted. For example, `admins@example.com?uid=123456789012345678901`. If |
| 920 | # the group is recovered, this value reverts to `group:{emailid}` and the |
| 921 | # recovered group retains the role in the binding. |
| 922 | # |
| 923 | # |
| 924 | # * `domain:{domain}`: The G Suite domain (primary) that represents all the |
| 925 | # users of that domain. For example, `google.com` or `example.com`. |
| 926 | # |
| 927 | "A String", |
| 928 | ], |
| 929 | }, |
| 930 | ], |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 931 | "version": 42, # Specifies the format of the policy. |
| 932 | # |
| 933 | # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value |
| 934 | # are rejected. |
| 935 | # |
| 936 | # Any operation that affects conditional role bindings must specify version |
| 937 | # `3`. This requirement applies to the following operations: |
| 938 | # |
| 939 | # * Getting a policy that includes a conditional role binding |
| 940 | # * Adding a conditional role binding to a policy |
| 941 | # * Changing a conditional role binding in a policy |
| 942 | # * Removing any role binding, with or without a condition, from a policy |
| 943 | # that includes conditions |
| 944 | # |
| 945 | # **Important:** If you use IAM Conditions, you must include the `etag` field |
| 946 | # whenever you call `setIamPolicy`. If you omit this field, then IAM allows |
| 947 | # you to overwrite a version `3` policy with a version `1` policy, and all of |
| 948 | # the conditions in the version `3` policy are lost. |
| 949 | # |
| 950 | # If a policy does not include any conditions, operations on that policy may |
| 951 | # specify any valid version or leave the field unset. |
| 952 | # |
| 953 | # To learn which resources support conditions in their IAM policies, see the |
| 954 | # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 955 | "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. |
| 956 | { # Specifies the audit configuration for a service. |
| 957 | # The configuration determines which permission types are logged, and what |
| 958 | # identities, if any, are exempted from logging. |
| 959 | # An AuditConfig must have one or more AuditLogConfigs. |
| 960 | # |
| 961 | # If there are AuditConfigs for both `allServices` and a specific service, |
| 962 | # the union of the two AuditConfigs is used for that service: the log_types |
| 963 | # specified in each AuditConfig are enabled, and the exempted_members in each |
| 964 | # AuditLogConfig are exempted. |
| 965 | # |
| 966 | # Example Policy with multiple AuditConfigs: |
| 967 | # |
| 968 | # { |
| 969 | # "audit_configs": [ |
| 970 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 971 | # "service": "allServices", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 972 | # "audit_log_configs": [ |
| 973 | # { |
| 974 | # "log_type": "DATA_READ", |
| 975 | # "exempted_members": [ |
| 976 | # "user:jose@example.com" |
| 977 | # ] |
| 978 | # }, |
| 979 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 980 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 981 | # }, |
| 982 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 983 | # "log_type": "ADMIN_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 984 | # } |
| 985 | # ] |
| 986 | # }, |
| 987 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 988 | # "service": "sampleservice.googleapis.com", |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 989 | # "audit_log_configs": [ |
| 990 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 991 | # "log_type": "DATA_READ" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 992 | # }, |
| 993 | # { |
| 994 | # "log_type": "DATA_WRITE", |
| 995 | # "exempted_members": [ |
| 996 | # "user:aliya@example.com" |
| 997 | # ] |
| 998 | # } |
| 999 | # ] |
| 1000 | # } |
| 1001 | # ] |
| 1002 | # } |
| 1003 | # |
| 1004 | # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ |
| 1005 | # logging. It also exempts jose@example.com from DATA_READ logging, and |
| 1006 | # aliya@example.com from DATA_WRITE logging. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1007 | "service": "A String", # Specifies a service that will be enabled for audit logging. |
| 1008 | # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. |
| 1009 | # `allServices` is a special value that covers all services. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1010 | "auditLogConfigs": [ # The configuration for logging of each type of permission. |
| 1011 | { # Provides the configuration for logging a type of permissions. |
| 1012 | # Example: |
| 1013 | # |
| 1014 | # { |
| 1015 | # "audit_log_configs": [ |
| 1016 | # { |
| 1017 | # "log_type": "DATA_READ", |
| 1018 | # "exempted_members": [ |
| 1019 | # "user:jose@example.com" |
| 1020 | # ] |
| 1021 | # }, |
| 1022 | # { |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1023 | # "log_type": "DATA_WRITE" |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1024 | # } |
| 1025 | # ] |
| 1026 | # } |
| 1027 | # |
| 1028 | # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting |
| 1029 | # jose@example.com from DATA_READ logging. |
| 1030 | "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of |
| 1031 | # permission. |
| 1032 | # Follows the same format of Binding.members. |
| 1033 | "A String", |
| 1034 | ], |
| 1035 | "logType": "A String", # The log type that this config enables. |
| 1036 | }, |
| 1037 | ], |
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> |