blob: 4fa161097dedc30ed2cdbfc0e48ebf67d9a66dd2 [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 Kim715bd7f2019-06-14 16:50:42 -0700104 "kind": "compute#licenseCode", # [Output Only] Type of resource. Always compute#licenseCode for licenses.
105 "description": "A String", # [Output Only] Description of this License Code.
106 "transferable": 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.
107 "state": "A String", # [Output Only] Current state of this License Code.
108 "licenseAlias": [ # [Output Only] URL and description aliases of Licenses with the same License Code.
109 {
110 "description": "A String", # [Output Only] Description of this License Code.
111 "selfLink": "A String", # [Output Only] URL of license corresponding to this License Code.
112 },
113 ],
114 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
115 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
116 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
117 "name": "A String", # [Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer.
118 }</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 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700139 # Optionally, a `binding` can 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.
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 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700143 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 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 #
Dan O'Mearadd494642020-05-01 07:42:23 -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('2020-10-01T00:00:00.000Z') - 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 Kim715bd7f2019-06-14 16:50:42 -0700150 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
151 { # 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 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700157 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
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 Kim715bd7f2019-06-14 16:50:42 -0700160 "exemptedMembers": [
161 "A String",
162 ],
163 "auditLogConfigs": [ # The configuration for logging of each type of permission.
164 { # Provides the configuration for logging a type of permissions. Example:
165 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700166 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700167 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700168 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700169 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
170 "A String",
171 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700172 "ignoreChildExemptions": True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700173 "logType": "A String", # The log type that this config enables.
174 },
175 ],
176 "service": "A String", # 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.
177 },
178 ],
179 "rules": [ # 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.
180 { # A rule to be applied in a Policy.
181 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
182 { # Specifies what kind of log the caller must write
183 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
184 #
185 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
186 #
187 # Field names correspond to IAM request parameters and field values are their respective values.
188 #
189 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
190 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700191 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700192 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -0700193 "customFields": [ # Custom fields.
194 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
195 "name": "A String", # Name is the field name.
196 "value": "A String", # 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.
197 },
198 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700199 "metric": "A String", # The metric to update.
200 },
201 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -0700202 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700203 },
204 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
205 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
206 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
207 "permissionType": "A String", # The type of the permission that was checked.
208 },
209 },
210 },
211 ],
212 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
213 "A String",
214 ],
215 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
216 "A String",
217 ],
218 "action": "A String", # Required
219 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
220 "A String",
221 ],
222 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
223 { # A condition to be met.
224 "iam": "A String", # Trusted attributes supplied by the IAM system.
225 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
226 "values": [ # The objects of the condition.
227 "A String",
228 ],
229 "svc": "A String", # Trusted attributes discharged by the service.
230 "op": "A String", # An operator to apply the subject with.
231 },
232 ],
233 "description": "A String", # Human-readable description of the rule.
234 },
235 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700236 "version": 42, # Specifies the format of the policy.
237 #
238 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
239 #
240 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
241 #
242 # * 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
243 #
244 # **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.
245 #
246 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700247 "etag": "A String", # `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.
248 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700249 # **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.
250 "bindings": [ # 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 -0700251 { # Associates `members` with a `role`.
252 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
253 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
254 #
255 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
256 #
257 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
258 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700259 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700260 #
261 #
262 #
263 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
264 #
265 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
266 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700267 # * `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.
268 #
269 # * `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.
270 #
271 # * `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.
272 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700273 #
274 #
275 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
276 "A String",
277 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700278 "condition": { # 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. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700279 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700280 # Example (Comparison):
281 #
282 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
283 #
284 # Example (Equality):
285 #
286 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
287 #
288 # Example (Logic):
289 #
290 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
291 #
292 # Example (Data Manipulation):
293 #
294 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
295 #
296 # 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.
297 "title": "A String", # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700298 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -0700299 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
300 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700301 },
302 },
303 ],
304 "iamOwned": True or False,
305 }</pre>
306</div>
307
308<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700309 <code class="details" id="setIamPolicy">setIamPolicy(project, resource, body=None)</code>
310 <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 -0700311
312Args:
313 project: string, Project ID for this request. (required)
314 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700315 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700316 The object takes the form of:
317
318{
Dan O'Mearadd494642020-05-01 07:42:23 -0700319 "policy": { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. # REQUIRED: The complete policy to be applied to the 'resource'. 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 -0700320 #
321 #
322 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700323 # 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 -0700324 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700325 # Optionally, a `binding` can 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700326 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700327 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700328 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700329 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700330 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700331 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700332 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700333 # 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('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700334 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700335 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700336 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
337 { # 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.
338 #
339 # 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.
340 #
341 # Example Policy with multiple AuditConfigs:
342 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700343 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700344 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700345 # 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 Kim715bd7f2019-06-14 16:50:42 -0700346 "exemptedMembers": [
347 "A String",
348 ],
349 "auditLogConfigs": [ # The configuration for logging of each type of permission.
350 { # Provides the configuration for logging a type of permissions. Example:
351 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700352 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700353 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700354 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700355 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
356 "A String",
357 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700358 "ignoreChildExemptions": True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700359 "logType": "A String", # The log type that this config enables.
360 },
361 ],
362 "service": "A String", # 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.
363 },
364 ],
365 "rules": [ # 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.
366 { # A rule to be applied in a Policy.
367 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
368 { # Specifies what kind of log the caller must write
369 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
370 #
371 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
372 #
373 # Field names correspond to IAM request parameters and field values are their respective values.
374 #
375 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
376 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700377 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700378 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -0700379 "customFields": [ # Custom fields.
380 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
381 "name": "A String", # Name is the field name.
382 "value": "A String", # 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.
383 },
384 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700385 "metric": "A String", # The metric to update.
386 },
387 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -0700388 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700389 },
390 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
391 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
392 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
393 "permissionType": "A String", # The type of the permission that was checked.
394 },
395 },
396 },
397 ],
398 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
399 "A String",
400 ],
401 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
402 "A String",
403 ],
404 "action": "A String", # Required
405 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
406 "A String",
407 ],
408 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
409 { # A condition to be met.
410 "iam": "A String", # Trusted attributes supplied by the IAM system.
411 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
412 "values": [ # The objects of the condition.
413 "A String",
414 ],
415 "svc": "A String", # Trusted attributes discharged by the service.
416 "op": "A String", # An operator to apply the subject with.
417 },
418 ],
419 "description": "A String", # Human-readable description of the rule.
420 },
421 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700422 "version": 42, # Specifies the format of the policy.
423 #
424 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
425 #
426 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
427 #
428 # * 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
429 #
430 # **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.
431 #
432 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700433 "etag": "A String", # `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.
434 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700435 # **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.
436 "bindings": [ # 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 -0700437 { # Associates `members` with a `role`.
438 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
439 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
440 #
441 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
442 #
443 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
444 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700445 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700446 #
447 #
448 #
449 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
450 #
451 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
452 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700453 # * `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.
454 #
455 # * `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.
456 #
457 # * `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.
458 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700459 #
460 #
461 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
462 "A String",
463 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700464 "condition": { # 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. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700465 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700466 # Example (Comparison):
467 #
468 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
469 #
470 # Example (Equality):
471 #
472 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
473 #
474 # Example (Logic):
475 #
476 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
477 #
478 # Example (Data Manipulation):
479 #
480 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
481 #
482 # 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.
483 "title": "A String", # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700484 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -0700485 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
486 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700487 },
488 },
489 ],
490 "iamOwned": True or False,
491 },
492 "bindings": [ # Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings.
493 { # Associates `members` with a `role`.
494 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
495 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
496 #
497 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
498 #
499 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
500 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700501 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700502 #
503 #
504 #
505 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
506 #
507 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
508 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700509 # * `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.
510 #
511 # * `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.
512 #
513 # * `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.
514 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700515 #
516 #
517 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
518 "A String",
519 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700520 "condition": { # 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. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700521 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700522 # Example (Comparison):
523 #
524 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
525 #
526 # Example (Equality):
527 #
528 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
529 #
530 # Example (Logic):
531 #
532 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
533 #
534 # Example (Data Manipulation):
535 #
536 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
537 #
538 # 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.
539 "title": "A String", # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700540 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -0700541 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
542 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700543 },
544 },
545 ],
546 "etag": "A String", # Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag.
547 }
548
549
550Returns:
551 An object of the form:
552
Dan O'Mearadd494642020-05-01 07:42:23 -0700553 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700554 #
555 #
556 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700557 # 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 -0700558 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700559 # Optionally, a `binding` can 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700560 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700561 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700562 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700563 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700564 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700565 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700566 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700567 # 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('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700568 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700569 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700570 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
571 { # 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.
572 #
573 # 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.
574 #
575 # Example Policy with multiple AuditConfigs:
576 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700577 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700578 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700579 # 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 Kim715bd7f2019-06-14 16:50:42 -0700580 "exemptedMembers": [
581 "A String",
582 ],
583 "auditLogConfigs": [ # The configuration for logging of each type of permission.
584 { # Provides the configuration for logging a type of permissions. Example:
585 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700586 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700587 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700588 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700589 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
590 "A String",
591 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700592 "ignoreChildExemptions": True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700593 "logType": "A String", # The log type that this config enables.
594 },
595 ],
596 "service": "A String", # 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.
597 },
598 ],
599 "rules": [ # 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.
600 { # A rule to be applied in a Policy.
601 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
602 { # Specifies what kind of log the caller must write
603 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
604 #
605 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
606 #
607 # Field names correspond to IAM request parameters and field values are their respective values.
608 #
609 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
610 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700611 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700612 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -0700613 "customFields": [ # Custom fields.
614 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
615 "name": "A String", # Name is the field name.
616 "value": "A String", # 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.
617 },
618 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700619 "metric": "A String", # The metric to update.
620 },
621 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -0700622 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700623 },
624 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
625 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
626 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
627 "permissionType": "A String", # The type of the permission that was checked.
628 },
629 },
630 },
631 ],
632 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
633 "A String",
634 ],
635 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
636 "A String",
637 ],
638 "action": "A String", # Required
639 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
640 "A String",
641 ],
642 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
643 { # A condition to be met.
644 "iam": "A String", # Trusted attributes supplied by the IAM system.
645 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
646 "values": [ # The objects of the condition.
647 "A String",
648 ],
649 "svc": "A String", # Trusted attributes discharged by the service.
650 "op": "A String", # An operator to apply the subject with.
651 },
652 ],
653 "description": "A String", # Human-readable description of the rule.
654 },
655 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700656 "version": 42, # Specifies the format of the policy.
657 #
658 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
659 #
660 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
661 #
662 # * 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
663 #
664 # **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.
665 #
666 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700667 "etag": "A String", # `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.
668 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700669 # **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.
670 "bindings": [ # 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 -0700671 { # Associates `members` with a `role`.
672 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
673 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
674 #
675 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
676 #
677 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
678 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700679 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700680 #
681 #
682 #
683 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
684 #
685 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
686 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700687 # * `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.
688 #
689 # * `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.
690 #
691 # * `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.
692 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700693 #
694 #
695 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
696 "A String",
697 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700698 "condition": { # 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. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700699 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700700 # Example (Comparison):
701 #
702 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
703 #
704 # Example (Equality):
705 #
706 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
707 #
708 # Example (Logic):
709 #
710 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
711 #
712 # Example (Data Manipulation):
713 #
714 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
715 #
716 # 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.
717 "title": "A String", # 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.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700718 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -0700719 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
720 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700721 },
722 },
723 ],
724 "iamOwned": True or False,
725 }</pre>
726</div>
727
728<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700729 <code class="details" id="testIamPermissions">testIamPermissions(project, resource, body=None)</code>
730 <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 -0700731
732Args:
733 project: string, Project ID for this request. (required)
734 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700735 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700736 The object takes the form of:
737
738{
739 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
740 "A String",
741 ],
742 }
743
744
745Returns:
746 An object of the form:
747
748 {
749 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
750 "A String",
751 ],
752 }</pre>
753</div>
754
755</body></html>