blob: cf5f59a92da8157f9a86aef927a492b0ba973bec [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, 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
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_alpha.html">Compute Engine API</a> . <a href="compute_alpha.licenseCodes.html">licenseCodes</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#get">get(project, licenseCode)</a></code></p>
Dan O'Mearadd494642020-05-01 07:42:23 -070079<p class="firstline">Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070080<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#getIamPolicy">getIamPolicy(project, resource, optionsRequestedPolicyVersion=None)</a></code></p>
82<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070083<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#setIamPolicy">setIamPolicy(project, resource, body=None)</a></code></p>
85<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070086<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#testIamPermissions">testIamPermissions(project, resource, body=None)</a></code></p>
88<p class="firstline">Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070089<h3>Method Details</h3>
90<div class="method">
91 <code class="details" id="get">get(project, licenseCode)</code>
Dan O'Mearadd494642020-05-01 07:42:23 -070092 <pre>Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070093
94Args:
95 project: string, Project ID for this request. (required)
96 licenseCode: string, Number corresponding to the License code resource to return. (required)
97
98Returns:
99 An object of the form:
100
Dan O'Mearadd494642020-05-01 07:42:23 -0700101 { # Represents a License Code resource.
102 #
103 # A License Code is a unique identifier used to represent a license resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. (== resource_for {$api_version}.licenseCodes ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700104 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
105 &quot;description&quot;: &quot;A String&quot;, # [Output Only] Description of this License Code.
106 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
107 &quot;kind&quot;: &quot;compute#licenseCode&quot;, # [Output Only] Type of resource. Always compute#licenseCode for licenses.
108 &quot;licenseAlias&quot;: [ # [Output Only] URL and description aliases of Licenses with the same License Code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700110 &quot;description&quot;: &quot;A String&quot;, # [Output Only] Description of this License Code.
111 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] URL of license corresponding to this License Code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700112 },
113 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700114 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer.
115 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
116 &quot;state&quot;: &quot;A String&quot;, # [Output Only] Current state of this License Code.
117 &quot;transferable&quot;: True or False, # [Output Only] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118 }</pre>
119</div>
120
121<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700122 <code class="details" id="getIamPolicy">getIamPolicy(project, resource, optionsRequestedPolicyVersion=None)</code>
123 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700124
125Args:
126 project: string, Project ID for this request. (required)
127 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700128 optionsRequestedPolicyVersion: integer, Requested IAM Policy version.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700129
130Returns:
131 An object of the form:
132
Dan O'Mearadd494642020-05-01 07:42:23 -0700133 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700134 #
135 #
136 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700137 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700138 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700139 # For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700140 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700141 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700142 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700143 # { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700144 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700145 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700146 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700147 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700148 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700149 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -0700150 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700151 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.
152 #
153 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted.
154 #
155 # Example Policy with multiple AuditConfigs:
156 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700157 # { &quot;audit_configs&quot;: [ { &quot;service&quot;: &quot;allServices&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; }, { &quot;log_type&quot;: &quot;ADMIN_READ&quot; } ] }, { &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot; }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot;, &quot;exempted_members&quot;: [ &quot;user:aliya@example.com&quot; ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700158 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700159 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim65020912020-05-20 12:08:20 -0700160 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700161 { # Provides the configuration for logging a type of permissions. Example:
162 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700163 # { &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700164 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700165 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
166 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
167 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700168 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700169 &quot;ignoreChildExemptions&quot;: True or False,
170 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700171 },
172 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700173 &quot;exemptedMembers&quot;: [
174 &quot;A String&quot;,
175 ],
176 &quot;service&quot;: &quot;A String&quot;, # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700177 },
178 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700179 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700180 { # Associates `members` with a `role`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700181 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding.
182 #
183 # If the condition evaluates to `true`, then this binding applies to the current request.
184 #
185 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
186 #
187 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
188 #
189 # Example (Comparison):
190 #
191 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
192 #
193 # Example (Equality):
194 #
195 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
196 #
197 # Example (Logic):
198 #
199 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
200 #
201 # Example (Data Manipulation):
202 #
203 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
204 #
205 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
206 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
207 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
208 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
209 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
210 },
211 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700212 #
213 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
214 #
215 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
216 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700217 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700218 #
219 #
220 #
221 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
222 #
223 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
224 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700225 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
226 #
227 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
228 #
229 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
230 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700231 #
232 #
233 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700234 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700235 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700236 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700237 },
238 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700239 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
240 #
241 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
242 &quot;iamOwned&quot;: True or False,
243 &quot;rules&quot;: [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
244 { # A rule to be applied in a Policy.
245 &quot;action&quot;: &quot;A String&quot;, # Required
246 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
247 { # A condition to be met.
248 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
249 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
250 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
251 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
252 &quot;values&quot;: [ # The objects of the condition.
253 &quot;A String&quot;,
254 ],
255 },
256 ],
257 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
258 &quot;ins&quot;: [ # If one or more &#x27;in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
259 &quot;A String&quot;,
260 ],
261 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
262 { # Specifies what kind of log the caller must write
263 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
264 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
265 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
266 },
267 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
268 },
269 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
270 #
271 # Metric names should start with a &#x27;/&#x27;, generally be lowercase-only, and end in &quot;_count&quot;. Field names should not contain an initial slash. The actual exported metric names will have &quot;/iam/policy&quot; prepended.
272 #
273 # Field names correspond to IAM request parameters and field values are their respective values.
274 #
275 # Supported field names: - &quot;authority&quot;, which is &quot;[token]&quot; if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - &quot;iam_principal&quot;, a representation of IAMContext.principal even if a token or authority selector is present; or - &quot;&quot; (empty string), resulting in a counter with no fields.
276 #
277 # Examples: counter { metric: &quot;/debug_access_count&quot; field: &quot;iam_principal&quot; } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
278 &quot;customFields&quot;: [ # Custom fields.
279 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
280 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
281 &quot;value&quot;: &quot;A String&quot;, # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
282 },
283 ],
284 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
285 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
286 },
287 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
288 &quot;logMode&quot;: &quot;A String&quot;,
289 },
290 },
291 ],
292 &quot;notIns&quot;: [ # If one or more &#x27;not_in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
293 &quot;A String&quot;,
294 ],
295 &quot;permissions&quot;: [ # A permission is a string of form &#x27;..&#x27; (e.g., &#x27;storage.buckets.list&#x27;). A value of &#x27;*&#x27; matches all permissions, and a verb part of &#x27;*&#x27; (e.g., &#x27;storage.buckets.*&#x27;) matches all verbs.
296 &quot;A String&quot;,
297 ],
298 },
299 ],
300 &quot;version&quot;: 42, # Specifies the format of the policy.
301 #
302 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
303 #
304 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
305 #
306 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
307 #
308 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
309 #
310 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
311 #
312 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700313 }</pre>
314</div>
315
316<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700317 <code class="details" id="setIamPolicy">setIamPolicy(project, resource, body=None)</code>
318 <pre>Sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700319
320Args:
321 project: string, Project ID for this request. (required)
322 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700323 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700324 The object takes the form of:
325
326{
Bu Sun Kim65020912020-05-20 12:08:20 -0700327 &quot;bindings&quot;: [ # Flatten Policy to create a backward compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify bindings.
328 { # Associates `members` with a `role`.
329 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding.
330 #
331 # If the condition evaluates to `true`, then this binding applies to the current request.
332 #
333 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
334 #
335 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
336 #
337 # Example (Comparison):
338 #
339 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
340 #
341 # Example (Equality):
342 #
343 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
344 #
345 # Example (Logic):
346 #
347 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
348 #
349 # Example (Data Manipulation):
350 #
351 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
352 #
353 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
354 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
355 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
356 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
357 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
358 },
359 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
360 #
361 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
362 #
363 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
364 #
365 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
366 #
367 #
368 #
369 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
370 #
371 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
372 #
373 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
374 #
375 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
376 #
377 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
378 #
379 #
380 #
381 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
382 &quot;A String&quot;,
383 ],
384 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
385 },
386 ],
387 &quot;etag&quot;: &quot;A String&quot;, # Flatten Policy to create a backward compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify the etag.
388 &quot;policy&quot;: { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. # REQUIRED: The complete policy to be applied to the &#x27;resource&#x27;. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700389 #
390 #
391 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700392 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700393 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700394 # For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700395 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700396 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700397 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700398 # { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700399 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700400 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700401 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700402 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700403 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700404 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -0700405 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700406 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.
407 #
408 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted.
409 #
410 # Example Policy with multiple AuditConfigs:
411 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700412 # { &quot;audit_configs&quot;: [ { &quot;service&quot;: &quot;allServices&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; }, { &quot;log_type&quot;: &quot;ADMIN_READ&quot; } ] }, { &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot; }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot;, &quot;exempted_members&quot;: [ &quot;user:aliya@example.com&quot; ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700413 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700414 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim65020912020-05-20 12:08:20 -0700415 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700416 { # Provides the configuration for logging a type of permissions. Example:
417 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700418 # { &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700419 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700420 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
421 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
422 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700423 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700424 &quot;ignoreChildExemptions&quot;: True or False,
425 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700426 },
427 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700428 &quot;exemptedMembers&quot;: [
429 &quot;A String&quot;,
430 ],
431 &quot;service&quot;: &quot;A String&quot;, # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700432 },
433 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700434 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700435 { # Associates `members` with a `role`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700436 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding.
437 #
438 # If the condition evaluates to `true`, then this binding applies to the current request.
439 #
440 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
441 #
442 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
443 #
444 # Example (Comparison):
445 #
446 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
447 #
448 # Example (Equality):
449 #
450 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
451 #
452 # Example (Logic):
453 #
454 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
455 #
456 # Example (Data Manipulation):
457 #
458 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
459 #
460 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
461 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
462 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
463 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
464 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
465 },
466 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700467 #
468 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
469 #
470 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
471 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700472 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700473 #
474 #
475 #
476 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
477 #
478 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
479 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700480 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
481 #
482 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
483 #
484 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
485 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700486 #
487 #
488 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700489 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700490 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700491 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700492 },
493 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700494 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
495 #
496 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
497 &quot;iamOwned&quot;: True or False,
498 &quot;rules&quot;: [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
499 { # A rule to be applied in a Policy.
500 &quot;action&quot;: &quot;A String&quot;, # Required
501 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
502 { # A condition to be met.
503 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
504 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
505 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
506 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
507 &quot;values&quot;: [ # The objects of the condition.
508 &quot;A String&quot;,
509 ],
510 },
511 ],
512 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
513 &quot;ins&quot;: [ # If one or more &#x27;in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
514 &quot;A String&quot;,
515 ],
516 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
517 { # Specifies what kind of log the caller must write
518 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
519 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
520 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
521 },
522 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
523 },
524 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
525 #
526 # Metric names should start with a &#x27;/&#x27;, generally be lowercase-only, and end in &quot;_count&quot;. Field names should not contain an initial slash. The actual exported metric names will have &quot;/iam/policy&quot; prepended.
527 #
528 # Field names correspond to IAM request parameters and field values are their respective values.
529 #
530 # Supported field names: - &quot;authority&quot;, which is &quot;[token]&quot; if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - &quot;iam_principal&quot;, a representation of IAMContext.principal even if a token or authority selector is present; or - &quot;&quot; (empty string), resulting in a counter with no fields.
531 #
532 # Examples: counter { metric: &quot;/debug_access_count&quot; field: &quot;iam_principal&quot; } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
533 &quot;customFields&quot;: [ # Custom fields.
534 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
535 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
536 &quot;value&quot;: &quot;A String&quot;, # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
537 },
538 ],
539 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
540 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
541 },
542 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
543 &quot;logMode&quot;: &quot;A String&quot;,
544 },
545 },
546 ],
547 &quot;notIns&quot;: [ # If one or more &#x27;not_in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
548 &quot;A String&quot;,
549 ],
550 &quot;permissions&quot;: [ # A permission is a string of form &#x27;..&#x27; (e.g., &#x27;storage.buckets.list&#x27;). A value of &#x27;*&#x27; matches all permissions, and a verb part of &#x27;*&#x27; (e.g., &#x27;storage.buckets.*&#x27;) matches all verbs.
551 &quot;A String&quot;,
552 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700553 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700554 ],
555 &quot;version&quot;: 42, # Specifies the format of the policy.
556 #
557 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
558 #
559 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
560 #
561 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
562 #
563 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
564 #
565 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
566 #
567 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
568 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700569 }
570
571
572Returns:
573 An object of the form:
574
Dan O'Mearadd494642020-05-01 07:42:23 -0700575 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700576 #
577 #
578 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700579 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700580 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700581 # For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700582 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700583 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700584 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700585 # { &quot;bindings&quot;: [ { &quot;role&quot;: &quot;roles/resourcemanager.organizationAdmin&quot;, &quot;members&quot;: [ &quot;user:mike@example.com&quot;, &quot;group:admins@example.com&quot;, &quot;domain:google.com&quot;, &quot;serviceAccount:my-project-id@appspot.gserviceaccount.com&quot; ] }, { &quot;role&quot;: &quot;roles/resourcemanager.organizationViewer&quot;, &quot;members&quot;: [ &quot;user:eve@example.com&quot; ], &quot;condition&quot;: { &quot;title&quot;: &quot;expirable access&quot;, &quot;description&quot;: &quot;Does not grant access after Sep 2020&quot;, &quot;expression&quot;: &quot;request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;)&quot;, } } ], &quot;etag&quot;: &quot;BwWWja0YfJA=&quot;, &quot;version&quot;: 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700586 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700587 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700588 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700589 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp(&#x27;2020-10-01T00:00:00.000Z&#x27;) - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700590 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700591 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim65020912020-05-20 12:08:20 -0700592 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700593 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.
594 #
595 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted.
596 #
597 # Example Policy with multiple AuditConfigs:
598 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700599 # { &quot;audit_configs&quot;: [ { &quot;service&quot;: &quot;allServices&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; }, { &quot;log_type&quot;: &quot;ADMIN_READ&quot; } ] }, { &quot;service&quot;: &quot;sampleservice.googleapis.com&quot;, &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot; }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot;, &quot;exempted_members&quot;: [ &quot;user:aliya@example.com&quot; ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700600 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700601 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim65020912020-05-20 12:08:20 -0700602 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700603 { # Provides the configuration for logging a type of permissions. Example:
604 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700605 # { &quot;audit_log_configs&quot;: [ { &quot;log_type&quot;: &quot;DATA_READ&quot;, &quot;exempted_members&quot;: [ &quot;user:jose@example.com&quot; ] }, { &quot;log_type&quot;: &quot;DATA_WRITE&quot; } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700606 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700607 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
608 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
609 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700610 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700611 &quot;ignoreChildExemptions&quot;: True or False,
612 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700613 },
614 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700615 &quot;exemptedMembers&quot;: [
616 &quot;A String&quot;,
617 ],
618 &quot;service&quot;: &quot;A String&quot;, # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700619 },
620 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700621 &quot;bindings&quot;: [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700622 { # Associates `members` with a `role`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700623 &quot;condition&quot;: { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding.
624 #
625 # If the condition evaluates to `true`, then this binding applies to the current request.
626 #
627 # If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding.
628 #
629 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
630 #
631 # Example (Comparison):
632 #
633 # title: &quot;Summary size limit&quot; description: &quot;Determines if a summary is less than 100 chars&quot; expression: &quot;document.summary.size() &lt; 100&quot;
634 #
635 # Example (Equality):
636 #
637 # title: &quot;Requestor is owner&quot; description: &quot;Determines if requestor is the document owner&quot; expression: &quot;document.owner == request.auth.claims.email&quot;
638 #
639 # Example (Logic):
640 #
641 # title: &quot;Public documents&quot; description: &quot;Determine whether the document should be publicly visible&quot; expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
642 #
643 # Example (Data Manipulation):
644 #
645 # title: &quot;Notification string&quot; description: &quot;Create a notification string with a timestamp.&quot; expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
646 #
647 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
648 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
649 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
650 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
651 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
652 },
653 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700654 #
655 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
656 #
657 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
658 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700659 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700660 #
661 #
662 #
663 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
664 #
665 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
666 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700667 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
668 #
669 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
670 #
671 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
672 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700673 #
674 #
675 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
Bu Sun Kim65020912020-05-20 12:08:20 -0700676 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700677 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700678 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700679 },
680 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700681 &quot;etag&quot;: &quot;A String&quot;, # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
682 #
683 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
684 &quot;iamOwned&quot;: True or False,
685 &quot;rules&quot;: [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
686 { # A rule to be applied in a Policy.
687 &quot;action&quot;: &quot;A String&quot;, # Required
688 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
689 { # A condition to be met.
690 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
691 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
692 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
693 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
694 &quot;values&quot;: [ # The objects of the condition.
695 &quot;A String&quot;,
696 ],
697 },
698 ],
699 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
700 &quot;ins&quot;: [ # If one or more &#x27;in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
701 &quot;A String&quot;,
702 ],
703 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
704 { # Specifies what kind of log the caller must write
705 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
706 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
707 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
708 },
709 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
710 },
711 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
712 #
713 # Metric names should start with a &#x27;/&#x27;, generally be lowercase-only, and end in &quot;_count&quot;. Field names should not contain an initial slash. The actual exported metric names will have &quot;/iam/policy&quot; prepended.
714 #
715 # Field names correspond to IAM request parameters and field values are their respective values.
716 #
717 # Supported field names: - &quot;authority&quot;, which is &quot;[token]&quot; if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - &quot;iam_principal&quot;, a representation of IAMContext.principal even if a token or authority selector is present; or - &quot;&quot; (empty string), resulting in a counter with no fields.
718 #
719 # Examples: counter { metric: &quot;/debug_access_count&quot; field: &quot;iam_principal&quot; } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
720 &quot;customFields&quot;: [ # Custom fields.
721 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
722 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
723 &quot;value&quot;: &quot;A String&quot;, # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
724 },
725 ],
726 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
727 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
728 },
729 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
730 &quot;logMode&quot;: &quot;A String&quot;,
731 },
732 },
733 ],
734 &quot;notIns&quot;: [ # If one or more &#x27;not_in&#x27; clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
735 &quot;A String&quot;,
736 ],
737 &quot;permissions&quot;: [ # A permission is a string of form &#x27;..&#x27; (e.g., &#x27;storage.buckets.list&#x27;). A value of &#x27;*&#x27; matches all permissions, and a verb part of &#x27;*&#x27; (e.g., &#x27;storage.buckets.*&#x27;) matches all verbs.
738 &quot;A String&quot;,
739 ],
740 },
741 ],
742 &quot;version&quot;: 42, # Specifies the format of the policy.
743 #
744 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
745 #
746 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
747 #
748 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
749 #
750 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
751 #
752 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
753 #
754 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700755 }</pre>
756</div>
757
758<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700759 <code class="details" id="testIamPermissions">testIamPermissions(project, resource, body=None)</code>
760 <pre>Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700761
762Args:
763 project: string, Project ID for this request. (required)
764 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700765 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700766 The object takes the form of:
767
768{
Bu Sun Kim65020912020-05-20 12:08:20 -0700769 &quot;permissions&quot;: [ # The set of permissions to check for the &#x27;resource&#x27;. Permissions with wildcards (such as &#x27;*&#x27; or &#x27;storage.*&#x27;) are not allowed.
770 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700771 ],
772 }
773
774
775Returns:
776 An object of the form:
777
778 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700779 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
780 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700781 ],
782 }</pre>
783</div>
784
785</body></html>