blob: f460c028acdafdf96c6e21637dd828c13da50c06 [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">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070081 <code><a href="#get">get(project, licenseCode)</a></code></p>
Dan O'Mearadd494642020-05-01 07:42:23 -070082<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 -070083<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#getIamPolicy">getIamPolicy(project, resource, optionsRequestedPolicyVersion=None)</a></code></p>
85<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 -070086<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070087 <code><a href="#setIamPolicy">setIamPolicy(project, resource, body=None)</a></code></p>
88<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 -070089<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#testIamPermissions">testIamPermissions(project, resource, body=None)</a></code></p>
91<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 -070092<h3>Method Details</h3>
93<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070094 <code class="details" id="close">close()</code>
95 <pre>Close httplib2 connections.</pre>
96</div>
97
98<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070099 <code class="details" id="get">get(project, licenseCode)</code>
Dan O'Mearadd494642020-05-01 07:42:23 -0700100 <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 -0700101
102Args:
103 project: string, Project ID for this request. (required)
104 licenseCode: string, Number corresponding to the License code resource to return. (required)
105
106Returns:
107 An object of the form:
108
Dan O'Mearadd494642020-05-01 07:42:23 -0700109 { # Represents a License Code resource.
110 #
111 # 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 -0700112 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
113 &quot;description&quot;: &quot;A String&quot;, # [Output Only] Description of this License Code.
114 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
115 &quot;kind&quot;: &quot;compute#licenseCode&quot;, # [Output Only] Type of resource. Always compute#licenseCode for licenses.
116 &quot;licenseAlias&quot;: [ # [Output Only] URL and description aliases of Licenses with the same License Code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700117 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700118 &quot;description&quot;: &quot;A String&quot;, # [Output Only] Description of this License Code.
119 &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 -0700120 },
121 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700122 &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.
123 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
124 &quot;state&quot;: &quot;A String&quot;, # [Output Only] Current state of this License Code.
125 &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 -0700126 }</pre>
127</div>
128
129<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700130 <code class="details" id="getIamPolicy">getIamPolicy(project, resource, optionsRequestedPolicyVersion=None)</code>
131 <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 -0700132
133Args:
134 project: string, Project ID for this request. (required)
135 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700136 optionsRequestedPolicyVersion: integer, Requested IAM Policy version.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700137
138Returns:
139 An object of the form:
140
Dan O'Mearadd494642020-05-01 07:42:23 -0700141 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700142 #
143 #
144 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700145 # 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 -0700146 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700147 # 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 -0700148 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700149 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700150 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700151 # { &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 -0700152 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700153 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700154 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700155 # 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 -0700156 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700157 # 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 -0700158 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700159 { # 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.
160 #
161 # 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.
162 #
163 # Example Policy with multiple AuditConfigs:
164 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700165 # { &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 -0700166 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700167 # 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 -0700168 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700169 { # Provides the configuration for logging a type of permissions. Example:
170 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700171 # { &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 -0700172 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700173 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
174 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
175 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700176 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700177 &quot;ignoreChildExemptions&quot;: True or False,
178 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700179 },
180 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700181 &quot;exemptedMembers&quot;: [
182 &quot;A String&quot;,
183 ],
184 &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 -0700185 },
186 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700187 &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 -0700188 { # Associates `members` with a `role`.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800189 &quot;bindingId&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -0700190 &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.
191 #
192 # If the condition evaluates to `true`, then this binding applies to the current request.
193 #
194 # 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.
195 #
196 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
197 #
198 # Example (Comparison):
199 #
200 # 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;
201 #
202 # Example (Equality):
203 #
204 # 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;
205 #
206 # Example (Logic):
207 #
208 # 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;
209 #
210 # Example (Data Manipulation):
211 #
212 # 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;
213 #
214 # 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.
215 &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.
216 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
217 &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.
218 &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.
219 },
220 &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 -0700221 #
222 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
223 #
224 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
225 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700226 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700227 #
228 #
229 #
230 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
231 #
232 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
233 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700234 # * `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.
235 #
236 # * `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.
237 #
238 # * `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.
239 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700240 #
241 #
242 # * `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 -0700243 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700244 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700245 &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 -0700246 },
247 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700248 &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.
249 #
250 # **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.
251 &quot;iamOwned&quot;: True or False,
252 &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.
253 { # A rule to be applied in a Policy.
254 &quot;action&quot;: &quot;A String&quot;, # Required
255 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
256 { # A condition to be met.
257 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
258 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
259 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
260 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
261 &quot;values&quot;: [ # The objects of the condition.
262 &quot;A String&quot;,
263 ],
264 },
265 ],
266 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
267 &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.
268 &quot;A String&quot;,
269 ],
270 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
271 { # Specifies what kind of log the caller must write
272 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
273 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
274 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
275 },
276 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
277 },
278 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
279 #
280 # 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.
281 #
282 # Field names correspond to IAM request parameters and field values are their respective values.
283 #
284 # 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.
285 #
286 # 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]}
287 &quot;customFields&quot;: [ # Custom fields.
288 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
289 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
290 &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.
291 },
292 ],
293 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
294 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
295 },
296 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
297 &quot;logMode&quot;: &quot;A String&quot;,
298 },
299 },
300 ],
301 &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.
302 &quot;A String&quot;,
303 ],
304 &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.
305 &quot;A String&quot;,
306 ],
307 },
308 ],
309 &quot;version&quot;: 42, # Specifies the format of the policy.
310 #
311 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
312 #
313 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
314 #
315 # * 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
316 #
317 # **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.
318 #
319 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
320 #
321 # 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 -0700322 }</pre>
323</div>
324
325<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700326 <code class="details" id="setIamPolicy">setIamPolicy(project, resource, body=None)</code>
327 <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 -0700328
329Args:
330 project: string, Project ID for this request. (required)
331 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700332 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700333 The object takes the form of:
334
335{
Bu Sun Kim65020912020-05-20 12:08:20 -0700336 &quot;bindings&quot;: [ # Flatten Policy to create a backward compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify bindings.
337 { # Associates `members` with a `role`.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800338 &quot;bindingId&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -0700339 &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.
340 #
341 # If the condition evaluates to `true`, then this binding applies to the current request.
342 #
343 # 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.
344 #
345 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
346 #
347 # Example (Comparison):
348 #
349 # 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;
350 #
351 # Example (Equality):
352 #
353 # 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;
354 #
355 # Example (Logic):
356 #
357 # 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;
358 #
359 # Example (Data Manipulation):
360 #
361 # 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;
362 #
363 # 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.
364 &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.
365 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
366 &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.
367 &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.
368 },
369 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
370 #
371 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
372 #
373 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
374 #
375 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
376 #
377 #
378 #
379 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
380 #
381 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
382 #
383 # * `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.
384 #
385 # * `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.
386 #
387 # * `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.
388 #
389 #
390 #
391 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
392 &quot;A String&quot;,
393 ],
394 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
395 },
396 ],
397 &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.
398 &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 -0700399 #
400 #
401 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700402 # 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 -0700403 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700404 # 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 -0700405 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700406 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700407 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700408 # { &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 -0700409 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700410 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700411 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700412 # 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 -0700413 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700414 # 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 -0700415 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700416 { # 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.
417 #
418 # 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.
419 #
420 # Example Policy with multiple AuditConfigs:
421 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700422 # { &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 -0700423 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700424 # 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 -0700425 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700426 { # Provides the configuration for logging a type of permissions. Example:
427 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700428 # { &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 -0700429 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700430 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
431 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
432 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700433 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700434 &quot;ignoreChildExemptions&quot;: True or False,
435 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700436 },
437 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700438 &quot;exemptedMembers&quot;: [
439 &quot;A String&quot;,
440 ],
441 &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 -0700442 },
443 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700444 &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 -0700445 { # Associates `members` with a `role`.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800446 &quot;bindingId&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -0700447 &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.
448 #
449 # If the condition evaluates to `true`, then this binding applies to the current request.
450 #
451 # 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.
452 #
453 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
454 #
455 # Example (Comparison):
456 #
457 # 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;
458 #
459 # Example (Equality):
460 #
461 # 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;
462 #
463 # Example (Logic):
464 #
465 # 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;
466 #
467 # Example (Data Manipulation):
468 #
469 # 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;
470 #
471 # 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.
472 &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.
473 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
474 &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.
475 &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.
476 },
477 &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 -0700478 #
479 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
480 #
481 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
482 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700483 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700484 #
485 #
486 #
487 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
488 #
489 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
490 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700491 # * `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.
492 #
493 # * `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.
494 #
495 # * `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.
496 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700497 #
498 #
499 # * `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 -0700500 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700501 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700502 &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 -0700503 },
504 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700505 &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.
506 #
507 # **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.
508 &quot;iamOwned&quot;: True or False,
509 &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.
510 { # A rule to be applied in a Policy.
511 &quot;action&quot;: &quot;A String&quot;, # Required
512 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
513 { # A condition to be met.
514 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
515 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
516 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
517 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
518 &quot;values&quot;: [ # The objects of the condition.
519 &quot;A String&quot;,
520 ],
521 },
522 ],
523 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
524 &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.
525 &quot;A String&quot;,
526 ],
527 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
528 { # Specifies what kind of log the caller must write
529 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
530 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
531 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
532 },
533 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
534 },
535 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
536 #
537 # 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.
538 #
539 # Field names correspond to IAM request parameters and field values are their respective values.
540 #
541 # 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.
542 #
543 # 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]}
544 &quot;customFields&quot;: [ # Custom fields.
545 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
546 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
547 &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.
548 },
549 ],
550 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
551 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
552 },
553 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
554 &quot;logMode&quot;: &quot;A String&quot;,
555 },
556 },
557 ],
558 &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.
559 &quot;A String&quot;,
560 ],
561 &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.
562 &quot;A String&quot;,
563 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700564 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700565 ],
566 &quot;version&quot;: 42, # Specifies the format of the policy.
567 #
568 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
569 #
570 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
571 #
572 # * 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
573 #
574 # **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.
575 #
576 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
577 #
578 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
579 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700580 }
581
582
583Returns:
584 An object of the form:
585
Dan O'Mearadd494642020-05-01 07:42:23 -0700586 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700587 #
588 #
589 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700590 # 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 -0700591 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700592 # 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 -0700593 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700594 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700595 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700596 # { &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 -0700597 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700598 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700599 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700600 # 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 -0700601 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700602 # 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 -0700603 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700604 { # 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.
605 #
606 # 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.
607 #
608 # Example Policy with multiple AuditConfigs:
609 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700610 # { &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 -0700611 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700612 # 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 -0700613 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700614 { # Provides the configuration for logging a type of permissions. Example:
615 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700616 # { &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 -0700617 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700618 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
619 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
620 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700621 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700622 &quot;ignoreChildExemptions&quot;: True or False,
623 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700624 },
625 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700626 &quot;exemptedMembers&quot;: [
627 &quot;A String&quot;,
628 ],
629 &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 -0700630 },
631 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700632 &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 -0700633 { # Associates `members` with a `role`.
Yoshi Automation Bot0d561ef2020-11-25 07:50:41 -0800634 &quot;bindingId&quot;: &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -0700635 &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.
636 #
637 # If the condition evaluates to `true`, then this binding applies to the current request.
638 #
639 # 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.
640 #
641 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
642 #
643 # Example (Comparison):
644 #
645 # 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;
646 #
647 # Example (Equality):
648 #
649 # 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;
650 #
651 # Example (Logic):
652 #
653 # 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;
654 #
655 # Example (Data Manipulation):
656 #
657 # 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;
658 #
659 # 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.
660 &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.
661 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
662 &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.
663 &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.
664 },
665 &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 -0700666 #
667 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
668 #
669 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
670 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700671 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700672 #
673 #
674 #
675 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
676 #
677 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
678 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700679 # * `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.
680 #
681 # * `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.
682 #
683 # * `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.
684 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700685 #
686 #
687 # * `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 -0700688 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700689 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700690 &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 -0700691 },
692 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700693 &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.
694 #
695 # **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.
696 &quot;iamOwned&quot;: True or False,
697 &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.
698 { # A rule to be applied in a Policy.
699 &quot;action&quot;: &quot;A String&quot;, # Required
700 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
701 { # A condition to be met.
702 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
703 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
704 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
705 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
706 &quot;values&quot;: [ # The objects of the condition.
707 &quot;A String&quot;,
708 ],
709 },
710 ],
711 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
712 &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.
713 &quot;A String&quot;,
714 ],
715 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
716 { # Specifies what kind of log the caller must write
717 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
718 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
719 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
720 },
721 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
722 },
723 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
724 #
725 # 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.
726 #
727 # Field names correspond to IAM request parameters and field values are their respective values.
728 #
729 # 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.
730 #
731 # 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]}
732 &quot;customFields&quot;: [ # Custom fields.
733 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
734 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
735 &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.
736 },
737 ],
738 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
739 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
740 },
741 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
742 &quot;logMode&quot;: &quot;A String&quot;,
743 },
744 },
745 ],
746 &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.
747 &quot;A String&quot;,
748 ],
749 &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.
750 &quot;A String&quot;,
751 ],
752 },
753 ],
754 &quot;version&quot;: 42, # Specifies the format of the policy.
755 #
756 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
757 #
758 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
759 #
760 # * 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
761 #
762 # **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.
763 #
764 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
765 #
766 # 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 -0700767 }</pre>
768</div>
769
770<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700771 <code class="details" id="testIamPermissions">testIamPermissions(project, resource, body=None)</code>
772 <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 -0700773
774Args:
775 project: string, Project ID for this request. (required)
776 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700777 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700778 The object takes the form of:
779
780{
Bu Sun Kim65020912020-05-20 12:08:20 -0700781 &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.
782 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700783 ],
784 }
785
786
787Returns:
788 An object of the form:
789
790 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700791 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
792 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700793 ],
794 }</pre>
795</div>
796
797</body></html>