blob: 9fc48622a00153f9e49c8649f897580070c08b29 [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.resourcePolicies.html">resourcePolicies</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070078 <code><a href="#aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Retrieves an aggregated list of resource policies.</p>
80<p class="toc_element">
81 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
82<p class="firstline">Retrieves the next page of results.</p>
83<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070084 <code><a href="#close">close()</a></code></p>
85<p class="firstline">Close httplib2 connections.</p>
86<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087 <code><a href="#delete">delete(project, region, resourcePolicy, requestId=None)</a></code></p>
88<p class="firstline">Deletes the specified resource policy.</p>
89<p class="toc_element">
90 <code><a href="#get">get(project, region, resourcePolicy)</a></code></p>
91<p class="firstline">Retrieves all information of the specified resource policy.</p>
92<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#getIamPolicy">getIamPolicy(project, region, resource, optionsRequestedPolicyVersion=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p>
95<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#insert">insert(project, region, body=None, requestId=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097<p class="firstline">Creates a new resource policy.</p>
98<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070099 <code><a href="#list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100<p class="firstline">A list all the resource policies that have been configured for the specified project in specified region.</p>
101<p class="toc_element">
102 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
103<p class="firstline">Retrieves the next page of results.</p>
104<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 <code><a href="#setIamPolicy">setIamPolicy(project, region, resource, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p>
107<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 <code><a href="#testIamPermissions">testIamPermissions(project, region, resource, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
110<h3>Method Details</h3>
111<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700112 <code class="details" id="aggregatedList">aggregatedList(project, filter=None, includeAllScopes=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700113 <pre>Retrieves an aggregated list of resource policies.
114
115Args:
116 project: string, Project ID for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700117 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700118
Dan O'Mearadd494642020-05-01 07:42:23 -0700119For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700120
Dan O'Mearadd494642020-05-01 07:42:23 -0700121You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700122
Bu Sun Kim65020912020-05-20 12:08:20 -0700123To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = &quot;Intel Skylake&quot;) ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = &quot;Intel Skylake&quot;) OR (cpuPlatform = &quot;Intel Broadwell&quot;) AND (scheduling.automaticRestart = true) ```
Dan O'Mearadd494642020-05-01 07:42:23 -0700124 includeAllScopes: boolean, Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
Bu Sun Kim65020912020-05-20 12:08:20 -0700125 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
126 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
127
128You can also sort results in descending order based on the creation timestamp using `orderBy=&quot;creationTimestamp desc&quot;`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
129
130Currently, only sorting by `name` or `creationTimestamp desc` is supported.
131 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
132 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700133
134Returns:
135 An object of the form:
136
137 { # Contains a list of resourcePolicies.
Bu Sun Kim65020912020-05-20 12:08:20 -0700138 &quot;etag&quot;: &quot;A String&quot;,
139 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
140 &quot;items&quot;: { # A list of ResourcePolicy resources.
141 &quot;a_key&quot;: { # Name of the scope containing this set of resourcePolicies.
142 &quot;resourcePolicies&quot;: [ # A list of resourcePolicies contained in this scope.
Dan O'Mearadd494642020-05-01 07:42:23 -0700143 { # Represents a Resource Policy resource. You can use resource policies to schedule actions for some Compute Engine resources. For example, you can use them to schedule persistent disk snapshots.
Bu Sun Kim65020912020-05-20 12:08:20 -0700144 #
145 # (== resource_for {$api_version}.resourcePolicies ==)
146 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
147 &quot;description&quot;: &quot;A String&quot;,
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700148 &quot;groupPlacementPolicy&quot;: { # A GroupPlacementPolicy specifies resource placement configuration. It specifies the failure bucket separation as well as network locality # Resource policy for instances for placement configuration.
Bu Sun Kim65020912020-05-20 12:08:20 -0700149 &quot;availabilityDomainCount&quot;: 42, # The number of availability domains instances will be spread across. If two instances are in different availability domain, they will not be put in the same low latency network
150 &quot;collocation&quot;: &quot;A String&quot;, # Specifies network collocation
151 &quot;locality&quot;: &quot;A String&quot;, # Specifies network locality
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700152 &quot;scope&quot;: &quot;A String&quot;, # Scope specifies the availability domain to which the VMs should be spread.
Bu Sun Kim65020912020-05-20 12:08:20 -0700153 &quot;style&quot;: &quot;A String&quot;, # Specifies instances to hosts placement relationship
154 &quot;vmCount&quot;: 42, # Number of vms in this placement group
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700155 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700156 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700157 &quot;instanceSchedulePolicy&quot;: { # An InstanceSchedulePolicy specifies when and how frequent certain operations are performed on the instance. # Resource policy for scheduling instance operations.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700158 &quot;timeZone&quot;: &quot;A String&quot;, # Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database.
159 &quot;vmStartSchedule&quot;: { # Schedule for an instance operation. # Specifies the schedule for starting instances.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700160 &quot;schedule&quot;: &quot;A String&quot;, # Specifies the frequency for the operation, using the unix-cron format.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700161 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700162 &quot;vmStopSchedule&quot;: { # Schedule for an instance operation. # Specifies the schedule for stopping instances.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700163 &quot;schedule&quot;: &quot;A String&quot;, # Specifies the frequency for the operation, using the unix-cron format.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700164 },
165 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700166 &quot;kind&quot;: &quot;compute#resourcePolicy&quot;, # [Output Only] Type of the resource. Always compute#resource_policies for resource policies.
167 &quot;name&quot;: &quot;A String&quot;, # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
168 &quot;region&quot;: &quot;A String&quot;,
169 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
170 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
171 &quot;snapshotSchedulePolicy&quot;: { # A snapshot schedule policy specifies when and how frequently snapshots are to be created for the target disk. Also specifies how many and how long these scheduled snapshots should be retained. # Resource policy for persistent disks for creating snapshots.
172 &quot;retentionPolicy&quot;: { # Policy for retention of scheduled snapshots. # Retention policy applied to snapshots created by this resource policy.
173 &quot;maxRetentionDays&quot;: 42, # Maximum age of the snapshot that is allowed to be kept.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700174 &quot;onPolicySwitch&quot;: &quot;A String&quot;, # TODO(b/165626794): Remove this field Specifies the behavior to apply to existing, scheduled snapshots snapshots if the policy is changed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700175 &quot;onSourceDiskDelete&quot;: &quot;A String&quot;, # Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
176 },
177 &quot;schedule&quot;: { # A schedule for disks where the schedueled operations are performed. # A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy.
178 &quot;dailySchedule&quot;: { # Time window specified for daily operations.
179 &quot;daysInCycle&quot;: 42, # Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle.
180 &quot;duration&quot;: &quot;A String&quot;, # [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.
181 &quot;startTime&quot;: &quot;A String&quot;, # Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.
182 },
183 &quot;hourlySchedule&quot;: { # Time window specified for hourly operations.
184 &quot;duration&quot;: &quot;A String&quot;, # [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
185 &quot;hoursInCycle&quot;: 42, # Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.
186 &quot;startTime&quot;: &quot;A String&quot;, # Time within the window to start the operations. It must be in format &quot;HH:MM&quot;, where HH : [00-23] and MM : [00-00] GMT.
187 },
188 &quot;weeklySchedule&quot;: { # Time window specified for weekly operations.
189 &quot;dayOfWeeks&quot;: [ # Up to 7 intervals/windows, one for each day of the week.
190 {
191 &quot;day&quot;: &quot;A String&quot;, # Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY.
192 &quot;duration&quot;: &quot;A String&quot;, # [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
193 &quot;startTime&quot;: &quot;A String&quot;, # Time within the window to start the operations. It must be in format &quot;HH:MM&quot;, where HH : [00-23] and MM : [00-00] GMT.
194 },
195 ],
196 },
197 },
198 &quot;snapshotProperties&quot;: { # Specified snapshot properties for scheduled snapshots created by this policy. # Properties with which snapshots are created such as labels, encryption keys.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700199 &quot;chainName&quot;: &quot;A String&quot;, # Chain name that the snapshot is created in.
Bu Sun Kim65020912020-05-20 12:08:20 -0700200 &quot;guestFlush&quot;: True or False, # Indication to perform a &#x27;guest aware&#x27; snapshot.
201 &quot;labels&quot;: { # Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty.
202 &quot;a_key&quot;: &quot;A String&quot;,
203 },
204 &quot;storageLocations&quot;: [ # Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional).
205 &quot;A String&quot;,
206 ],
207 },
208 },
209 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of resource policy creation.
210 &quot;vmMaintenancePolicy&quot;: { # Resource policy applicable to VMs for infrastructure maintenance.
211 &quot;concurrencyControlGroup&quot;: { # A concurrency control configuration. Defines a group config that, when attached to an instance, recognizes that instance as part of a group of instances where only up the concurrency_limit of instances in that group can undergo simultaneous maintenance. For more information: go/concurrency-control-design-doc
212 &quot;concurrencyLimit&quot;: 42,
213 },
214 &quot;maintenanceWindow&quot;: { # A maintenance window for VMs. When set, we restrict our maintenance operations to this window. # Maintenance windows that are applied to VMs covered by this policy.
215 &quot;dailyMaintenanceWindow&quot;: { # Time window specified for daily operations.
216 &quot;daysInCycle&quot;: 42, # Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle.
217 &quot;duration&quot;: &quot;A String&quot;, # [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.
218 &quot;startTime&quot;: &quot;A String&quot;, # Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.
219 },
220 },
221 },
222 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700223 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700224 &quot;warning&quot;: { # Informational warning which replaces the list of resourcePolicies when the list is empty.
225 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
226 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
227 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700228 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700229 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
230 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700231 },
232 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700233 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700234 },
235 },
236 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700237 &quot;kind&quot;: &quot;compute#resourcePolicyAggregatedList&quot;, # Type of resource.
238 &quot;nextPageToken&quot;: &quot;A String&quot;, # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
239 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
240 &quot;unreachables&quot;: [ # [Output Only] Unreachable resources.
241 &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700242 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700243 &quot;warning&quot;: { # [Output Only] Informational warning message.
244 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
245 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
246 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700247 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700248 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
249 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700250 },
251 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700252 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700253 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700254 }</pre>
255</div>
256
257<div class="method">
258 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
259 <pre>Retrieves the next page of results.
260
261Args:
262 previous_request: The request for the previous page. (required)
263 previous_response: The response from the request for the previous page. (required)
264
265Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700266 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700267 page. Returns None if there are no more items in the collection.
268 </pre>
269</div>
270
271<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700272 <code class="details" id="close">close()</code>
273 <pre>Close httplib2 connections.</pre>
274</div>
275
276<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700277 <code class="details" id="delete">delete(project, region, resourcePolicy, requestId=None)</code>
278 <pre>Deletes the specified resource policy.
279
280Args:
281 project: string, Project ID for this request. (required)
282 region: string, Name of the region for this request. (required)
283 resourcePolicy: string, Name of the resource policy to delete. (required)
284 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
285
286For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
287
288The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
289
290Returns:
291 An object of the form:
292
293 { # Represents an Operation resource.
294 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700295 # Google Compute Engine has three Operation resources:
296 #
297 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
298 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700299 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
300 #
301 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700302 # - For global operations, use the `globalOperations` resource.
303 # - For regional operations, use the `regionOperations` resource.
304 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700305 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700306 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700307 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
308 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
309 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
310 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
311 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
312 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700313 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700314 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
315 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
316 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700317 },
318 ],
319 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700320 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
321 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
322 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
323 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
324 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
325 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
326 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
327 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
328 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
329 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
330 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
331 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
332 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
333 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
334 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
335 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
336 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
337 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
338 {
339 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
340 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
341 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
342 {
343 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
344 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
345 },
346 ],
347 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
348 },
349 ],
350 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700351 }</pre>
352</div>
353
354<div class="method">
355 <code class="details" id="get">get(project, region, resourcePolicy)</code>
356 <pre>Retrieves all information of the specified resource policy.
357
358Args:
359 project: string, Project ID for this request. (required)
360 region: string, Name of the region for this request. (required)
361 resourcePolicy: string, Name of the resource policy to retrieve. (required)
362
363Returns:
364 An object of the form:
365
Dan O'Mearadd494642020-05-01 07:42:23 -0700366 { # Represents a Resource Policy resource. You can use resource policies to schedule actions for some Compute Engine resources. For example, you can use them to schedule persistent disk snapshots.
Bu Sun Kim65020912020-05-20 12:08:20 -0700367 #
368 # (== resource_for {$api_version}.resourcePolicies ==)
369 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
370 &quot;description&quot;: &quot;A String&quot;,
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700371 &quot;groupPlacementPolicy&quot;: { # A GroupPlacementPolicy specifies resource placement configuration. It specifies the failure bucket separation as well as network locality # Resource policy for instances for placement configuration.
Bu Sun Kim65020912020-05-20 12:08:20 -0700372 &quot;availabilityDomainCount&quot;: 42, # The number of availability domains instances will be spread across. If two instances are in different availability domain, they will not be put in the same low latency network
373 &quot;collocation&quot;: &quot;A String&quot;, # Specifies network collocation
374 &quot;locality&quot;: &quot;A String&quot;, # Specifies network locality
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700375 &quot;scope&quot;: &quot;A String&quot;, # Scope specifies the availability domain to which the VMs should be spread.
Bu Sun Kim65020912020-05-20 12:08:20 -0700376 &quot;style&quot;: &quot;A String&quot;, # Specifies instances to hosts placement relationship
377 &quot;vmCount&quot;: 42, # Number of vms in this placement group
378 },
379 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700380 &quot;instanceSchedulePolicy&quot;: { # An InstanceSchedulePolicy specifies when and how frequent certain operations are performed on the instance. # Resource policy for scheduling instance operations.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700381 &quot;timeZone&quot;: &quot;A String&quot;, # Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database.
382 &quot;vmStartSchedule&quot;: { # Schedule for an instance operation. # Specifies the schedule for starting instances.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700383 &quot;schedule&quot;: &quot;A String&quot;, # Specifies the frequency for the operation, using the unix-cron format.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700384 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700385 &quot;vmStopSchedule&quot;: { # Schedule for an instance operation. # Specifies the schedule for stopping instances.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700386 &quot;schedule&quot;: &quot;A String&quot;, # Specifies the frequency for the operation, using the unix-cron format.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700387 },
388 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700389 &quot;kind&quot;: &quot;compute#resourcePolicy&quot;, # [Output Only] Type of the resource. Always compute#resource_policies for resource policies.
390 &quot;name&quot;: &quot;A String&quot;, # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
391 &quot;region&quot;: &quot;A String&quot;,
392 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
393 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
394 &quot;snapshotSchedulePolicy&quot;: { # A snapshot schedule policy specifies when and how frequently snapshots are to be created for the target disk. Also specifies how many and how long these scheduled snapshots should be retained. # Resource policy for persistent disks for creating snapshots.
395 &quot;retentionPolicy&quot;: { # Policy for retention of scheduled snapshots. # Retention policy applied to snapshots created by this resource policy.
396 &quot;maxRetentionDays&quot;: 42, # Maximum age of the snapshot that is allowed to be kept.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700397 &quot;onPolicySwitch&quot;: &quot;A String&quot;, # TODO(b/165626794): Remove this field Specifies the behavior to apply to existing, scheduled snapshots snapshots if the policy is changed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700398 &quot;onSourceDiskDelete&quot;: &quot;A String&quot;, # Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700399 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700400 &quot;schedule&quot;: { # A schedule for disks where the schedueled operations are performed. # A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy.
401 &quot;dailySchedule&quot;: { # Time window specified for daily operations.
402 &quot;daysInCycle&quot;: 42, # Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle.
403 &quot;duration&quot;: &quot;A String&quot;, # [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.
404 &quot;startTime&quot;: &quot;A String&quot;, # Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700405 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700406 &quot;hourlySchedule&quot;: { # Time window specified for hourly operations.
407 &quot;duration&quot;: &quot;A String&quot;, # [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
408 &quot;hoursInCycle&quot;: 42, # Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.
409 &quot;startTime&quot;: &quot;A String&quot;, # Time within the window to start the operations. It must be in format &quot;HH:MM&quot;, where HH : [00-23] and MM : [00-00] GMT.
Dan O'Mearadd494642020-05-01 07:42:23 -0700410 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700411 &quot;weeklySchedule&quot;: { # Time window specified for weekly operations.
412 &quot;dayOfWeeks&quot;: [ # Up to 7 intervals/windows, one for each day of the week.
413 {
414 &quot;day&quot;: &quot;A String&quot;, # Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY.
415 &quot;duration&quot;: &quot;A String&quot;, # [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
416 &quot;startTime&quot;: &quot;A String&quot;, # Time within the window to start the operations. It must be in format &quot;HH:MM&quot;, where HH : [00-23] and MM : [00-00] GMT.
417 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700418 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700419 },
420 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700421 &quot;snapshotProperties&quot;: { # Specified snapshot properties for scheduled snapshots created by this policy. # Properties with which snapshots are created such as labels, encryption keys.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700422 &quot;chainName&quot;: &quot;A String&quot;, # Chain name that the snapshot is created in.
Bu Sun Kim65020912020-05-20 12:08:20 -0700423 &quot;guestFlush&quot;: True or False, # Indication to perform a &#x27;guest aware&#x27; snapshot.
424 &quot;labels&quot;: { # Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty.
425 &quot;a_key&quot;: &quot;A String&quot;,
426 },
427 &quot;storageLocations&quot;: [ # Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional).
428 &quot;A String&quot;,
429 ],
430 },
431 },
432 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of resource policy creation.
433 &quot;vmMaintenancePolicy&quot;: { # Resource policy applicable to VMs for infrastructure maintenance.
434 &quot;concurrencyControlGroup&quot;: { # A concurrency control configuration. Defines a group config that, when attached to an instance, recognizes that instance as part of a group of instances where only up the concurrency_limit of instances in that group can undergo simultaneous maintenance. For more information: go/concurrency-control-design-doc
435 &quot;concurrencyLimit&quot;: 42,
436 },
437 &quot;maintenanceWindow&quot;: { # A maintenance window for VMs. When set, we restrict our maintenance operations to this window. # Maintenance windows that are applied to VMs covered by this policy.
438 &quot;dailyMaintenanceWindow&quot;: { # Time window specified for daily operations.
439 &quot;daysInCycle&quot;: 42, # Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle.
440 &quot;duration&quot;: &quot;A String&quot;, # [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.
441 &quot;startTime&quot;: &quot;A String&quot;, # Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.
442 },
443 },
444 },
445 }</pre>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700446</div>
447
448<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700449 <code class="details" id="getIamPolicy">getIamPolicy(project, region, resource, optionsRequestedPolicyVersion=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700450 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
451
452Args:
453 project: string, Project ID for this request. (required)
454 region: string, The name of the region for this request. (required)
455 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700456 optionsRequestedPolicyVersion: integer, Requested IAM Policy version.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700457
458Returns:
459 An object of the form:
460
Dan O'Mearadd494642020-05-01 07:42:23 -0700461 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700462 #
463 #
464 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700465 # 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 -0700466 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700467 # 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 -0700468 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700469 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700470 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700471 # { &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 -0700472 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700473 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700474 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700475 # 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 -0700476 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700477 # 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 -0700478 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700479 { # 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.
480 #
481 # 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.
482 #
483 # Example Policy with multiple AuditConfigs:
484 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700485 # { &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 -0700486 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700487 # 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 -0700488 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700489 { # Provides the configuration for logging a type of permissions. Example:
490 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700491 # { &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 -0700492 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700493 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
494 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
495 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700496 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700497 &quot;ignoreChildExemptions&quot;: True or False,
498 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700499 },
500 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700501 &quot;exemptedMembers&quot;: [
502 &quot;A String&quot;,
503 ],
504 &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 -0700505 },
506 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700507 &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 -0700508 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700509 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -0700510 &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.
511 #
512 # If the condition evaluates to `true`, then this binding applies to the current request.
513 #
514 # 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.
515 #
516 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
517 #
518 # Example (Comparison):
519 #
520 # 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;
521 #
522 # Example (Equality):
523 #
524 # 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;
525 #
526 # Example (Logic):
527 #
528 # 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;
529 #
530 # Example (Data Manipulation):
531 #
532 # 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;
533 #
534 # 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.
535 &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.
536 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
537 &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.
538 &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.
539 },
540 &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 -0700541 #
542 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
543 #
544 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
545 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700546 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700547 #
548 #
549 #
550 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
551 #
552 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
553 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700554 # * `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.
555 #
556 # * `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.
557 #
558 # * `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.
559 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700560 #
561 #
562 # * `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 -0700563 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700564 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700565 &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 -0700566 },
567 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700568 &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.
569 #
570 # **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.
571 &quot;iamOwned&quot;: True or False,
572 &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.
573 { # A rule to be applied in a Policy.
574 &quot;action&quot;: &quot;A String&quot;, # Required
575 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
576 { # A condition to be met.
577 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
578 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
579 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
580 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
581 &quot;values&quot;: [ # The objects of the condition.
582 &quot;A String&quot;,
583 ],
584 },
585 ],
586 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
587 &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.
588 &quot;A String&quot;,
589 ],
590 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
591 { # Specifies what kind of log the caller must write
592 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
593 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
594 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
595 },
596 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
597 },
598 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
599 #
600 # 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.
601 #
602 # Field names correspond to IAM request parameters and field values are their respective values.
603 #
604 # 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.
605 #
606 # 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]}
607 &quot;customFields&quot;: [ # Custom fields.
608 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
609 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
610 &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.
611 },
612 ],
613 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
614 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
615 },
616 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
617 &quot;logMode&quot;: &quot;A String&quot;,
618 },
619 },
620 ],
621 &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.
622 &quot;A String&quot;,
623 ],
624 &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.
625 &quot;A String&quot;,
626 ],
627 },
628 ],
629 &quot;version&quot;: 42, # Specifies the format of the policy.
630 #
631 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
632 #
633 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
634 #
635 # * 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
636 #
637 # **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.
638 #
639 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
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).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700642 }</pre>
643</div>
644
645<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700646 <code class="details" id="insert">insert(project, region, body=None, requestId=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700647 <pre>Creates a new resource policy.
648
649Args:
650 project: string, Project ID for this request. (required)
651 region: string, Name of the region for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700652 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700653 The object takes the form of:
654
Dan O'Mearadd494642020-05-01 07:42:23 -0700655{ # Represents a Resource Policy resource. You can use resource policies to schedule actions for some Compute Engine resources. For example, you can use them to schedule persistent disk snapshots.
Bu Sun Kim65020912020-05-20 12:08:20 -0700656 #
657 # (== resource_for {$api_version}.resourcePolicies ==)
658 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
659 &quot;description&quot;: &quot;A String&quot;,
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700660 &quot;groupPlacementPolicy&quot;: { # A GroupPlacementPolicy specifies resource placement configuration. It specifies the failure bucket separation as well as network locality # Resource policy for instances for placement configuration.
Bu Sun Kim65020912020-05-20 12:08:20 -0700661 &quot;availabilityDomainCount&quot;: 42, # The number of availability domains instances will be spread across. If two instances are in different availability domain, they will not be put in the same low latency network
662 &quot;collocation&quot;: &quot;A String&quot;, # Specifies network collocation
663 &quot;locality&quot;: &quot;A String&quot;, # Specifies network locality
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700664 &quot;scope&quot;: &quot;A String&quot;, # Scope specifies the availability domain to which the VMs should be spread.
Bu Sun Kim65020912020-05-20 12:08:20 -0700665 &quot;style&quot;: &quot;A String&quot;, # Specifies instances to hosts placement relationship
666 &quot;vmCount&quot;: 42, # Number of vms in this placement group
667 },
668 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700669 &quot;instanceSchedulePolicy&quot;: { # An InstanceSchedulePolicy specifies when and how frequent certain operations are performed on the instance. # Resource policy for scheduling instance operations.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700670 &quot;timeZone&quot;: &quot;A String&quot;, # Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database.
671 &quot;vmStartSchedule&quot;: { # Schedule for an instance operation. # Specifies the schedule for starting instances.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700672 &quot;schedule&quot;: &quot;A String&quot;, # Specifies the frequency for the operation, using the unix-cron format.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700673 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700674 &quot;vmStopSchedule&quot;: { # Schedule for an instance operation. # Specifies the schedule for stopping instances.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700675 &quot;schedule&quot;: &quot;A String&quot;, # Specifies the frequency for the operation, using the unix-cron format.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700676 },
677 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700678 &quot;kind&quot;: &quot;compute#resourcePolicy&quot;, # [Output Only] Type of the resource. Always compute#resource_policies for resource policies.
679 &quot;name&quot;: &quot;A String&quot;, # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
680 &quot;region&quot;: &quot;A String&quot;,
681 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
682 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
683 &quot;snapshotSchedulePolicy&quot;: { # A snapshot schedule policy specifies when and how frequently snapshots are to be created for the target disk. Also specifies how many and how long these scheduled snapshots should be retained. # Resource policy for persistent disks for creating snapshots.
684 &quot;retentionPolicy&quot;: { # Policy for retention of scheduled snapshots. # Retention policy applied to snapshots created by this resource policy.
685 &quot;maxRetentionDays&quot;: 42, # Maximum age of the snapshot that is allowed to be kept.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700686 &quot;onPolicySwitch&quot;: &quot;A String&quot;, # TODO(b/165626794): Remove this field Specifies the behavior to apply to existing, scheduled snapshots snapshots if the policy is changed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700687 &quot;onSourceDiskDelete&quot;: &quot;A String&quot;, # Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700688 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700689 &quot;schedule&quot;: { # A schedule for disks where the schedueled operations are performed. # A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy.
690 &quot;dailySchedule&quot;: { # Time window specified for daily operations.
691 &quot;daysInCycle&quot;: 42, # Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle.
692 &quot;duration&quot;: &quot;A String&quot;, # [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.
693 &quot;startTime&quot;: &quot;A String&quot;, # Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700694 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700695 &quot;hourlySchedule&quot;: { # Time window specified for hourly operations.
696 &quot;duration&quot;: &quot;A String&quot;, # [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
697 &quot;hoursInCycle&quot;: 42, # Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.
698 &quot;startTime&quot;: &quot;A String&quot;, # Time within the window to start the operations. It must be in format &quot;HH:MM&quot;, where HH : [00-23] and MM : [00-00] GMT.
Dan O'Mearadd494642020-05-01 07:42:23 -0700699 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700700 &quot;weeklySchedule&quot;: { # Time window specified for weekly operations.
701 &quot;dayOfWeeks&quot;: [ # Up to 7 intervals/windows, one for each day of the week.
702 {
703 &quot;day&quot;: &quot;A String&quot;, # Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY.
704 &quot;duration&quot;: &quot;A String&quot;, # [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
705 &quot;startTime&quot;: &quot;A String&quot;, # Time within the window to start the operations. It must be in format &quot;HH:MM&quot;, where HH : [00-23] and MM : [00-00] GMT.
706 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700707 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700708 },
709 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700710 &quot;snapshotProperties&quot;: { # Specified snapshot properties for scheduled snapshots created by this policy. # Properties with which snapshots are created such as labels, encryption keys.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700711 &quot;chainName&quot;: &quot;A String&quot;, # Chain name that the snapshot is created in.
Bu Sun Kim65020912020-05-20 12:08:20 -0700712 &quot;guestFlush&quot;: True or False, # Indication to perform a &#x27;guest aware&#x27; snapshot.
713 &quot;labels&quot;: { # Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty.
714 &quot;a_key&quot;: &quot;A String&quot;,
715 },
716 &quot;storageLocations&quot;: [ # Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional).
717 &quot;A String&quot;,
718 ],
719 },
720 },
721 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of resource policy creation.
722 &quot;vmMaintenancePolicy&quot;: { # Resource policy applicable to VMs for infrastructure maintenance.
723 &quot;concurrencyControlGroup&quot;: { # A concurrency control configuration. Defines a group config that, when attached to an instance, recognizes that instance as part of a group of instances where only up the concurrency_limit of instances in that group can undergo simultaneous maintenance. For more information: go/concurrency-control-design-doc
724 &quot;concurrencyLimit&quot;: 42,
725 },
726 &quot;maintenanceWindow&quot;: { # A maintenance window for VMs. When set, we restrict our maintenance operations to this window. # Maintenance windows that are applied to VMs covered by this policy.
727 &quot;dailyMaintenanceWindow&quot;: { # Time window specified for daily operations.
728 &quot;daysInCycle&quot;: 42, # Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle.
729 &quot;duration&quot;: &quot;A String&quot;, # [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.
730 &quot;startTime&quot;: &quot;A String&quot;, # Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.
731 },
732 },
733 },
734}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700735
736 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
737
738For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
739
740The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
741
742Returns:
743 An object of the form:
744
745 { # Represents an Operation resource.
746 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700747 # Google Compute Engine has three Operation resources:
748 #
749 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
750 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700751 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
752 #
753 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700754 # - For global operations, use the `globalOperations` resource.
755 # - For regional operations, use the `regionOperations` resource.
756 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700757 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700758 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim65020912020-05-20 12:08:20 -0700759 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
760 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
761 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
762 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
763 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
764 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700765 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700766 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
767 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
768 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700769 },
770 ],
771 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700772 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
773 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
774 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
775 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
776 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
777 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
778 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
779 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
780 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
781 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
782 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
783 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
784 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
785 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
786 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
787 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
788 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
789 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
790 {
791 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
792 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
793 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
794 {
795 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
796 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
797 },
798 ],
799 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
800 },
801 ],
802 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700803 }</pre>
804</div>
805
806<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700807 <code class="details" id="list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700808 <pre>A list all the resource policies that have been configured for the specified project in specified region.
809
810Args:
811 project: string, Project ID for this request. (required)
812 region: string, Name of the region for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700813 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700814
Dan O'Mearadd494642020-05-01 07:42:23 -0700815For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700816
Dan O'Mearadd494642020-05-01 07:42:23 -0700817You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700818
Bu Sun Kim65020912020-05-20 12:08:20 -0700819To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = &quot;Intel Skylake&quot;) ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = &quot;Intel Skylake&quot;) OR (cpuPlatform = &quot;Intel Broadwell&quot;) AND (scheduling.automaticRestart = true) ```
820 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
821 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
822
823You can also sort results in descending order based on the creation timestamp using `orderBy=&quot;creationTimestamp desc&quot;`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
824
825Currently, only sorting by `name` or `creationTimestamp desc` is supported.
826 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
827 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700828
829Returns:
830 An object of the form:
831
832 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700833 &quot;etag&quot;: &quot;A String&quot;,
834 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
835 &quot;items&quot;: [ # [Output Only] A list of ResourcePolicy resources.
Dan O'Mearadd494642020-05-01 07:42:23 -0700836 { # Represents a Resource Policy resource. You can use resource policies to schedule actions for some Compute Engine resources. For example, you can use them to schedule persistent disk snapshots.
Bu Sun Kim65020912020-05-20 12:08:20 -0700837 #
838 # (== resource_for {$api_version}.resourcePolicies ==)
839 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
840 &quot;description&quot;: &quot;A String&quot;,
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700841 &quot;groupPlacementPolicy&quot;: { # A GroupPlacementPolicy specifies resource placement configuration. It specifies the failure bucket separation as well as network locality # Resource policy for instances for placement configuration.
Bu Sun Kim65020912020-05-20 12:08:20 -0700842 &quot;availabilityDomainCount&quot;: 42, # The number of availability domains instances will be spread across. If two instances are in different availability domain, they will not be put in the same low latency network
843 &quot;collocation&quot;: &quot;A String&quot;, # Specifies network collocation
844 &quot;locality&quot;: &quot;A String&quot;, # Specifies network locality
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700845 &quot;scope&quot;: &quot;A String&quot;, # Scope specifies the availability domain to which the VMs should be spread.
Bu Sun Kim65020912020-05-20 12:08:20 -0700846 &quot;style&quot;: &quot;A String&quot;, # Specifies instances to hosts placement relationship
847 &quot;vmCount&quot;: 42, # Number of vms in this placement group
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700848 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700849 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700850 &quot;instanceSchedulePolicy&quot;: { # An InstanceSchedulePolicy specifies when and how frequent certain operations are performed on the instance. # Resource policy for scheduling instance operations.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700851 &quot;timeZone&quot;: &quot;A String&quot;, # Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database.
852 &quot;vmStartSchedule&quot;: { # Schedule for an instance operation. # Specifies the schedule for starting instances.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700853 &quot;schedule&quot;: &quot;A String&quot;, # Specifies the frequency for the operation, using the unix-cron format.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700854 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700855 &quot;vmStopSchedule&quot;: { # Schedule for an instance operation. # Specifies the schedule for stopping instances.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700856 &quot;schedule&quot;: &quot;A String&quot;, # Specifies the frequency for the operation, using the unix-cron format.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700857 },
858 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700859 &quot;kind&quot;: &quot;compute#resourcePolicy&quot;, # [Output Only] Type of the resource. Always compute#resource_policies for resource policies.
860 &quot;name&quot;: &quot;A String&quot;, # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
861 &quot;region&quot;: &quot;A String&quot;,
862 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined fully-qualified URL for this resource.
863 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
864 &quot;snapshotSchedulePolicy&quot;: { # A snapshot schedule policy specifies when and how frequently snapshots are to be created for the target disk. Also specifies how many and how long these scheduled snapshots should be retained. # Resource policy for persistent disks for creating snapshots.
865 &quot;retentionPolicy&quot;: { # Policy for retention of scheduled snapshots. # Retention policy applied to snapshots created by this resource policy.
866 &quot;maxRetentionDays&quot;: 42, # Maximum age of the snapshot that is allowed to be kept.
Bu Sun Kim673ec5c2020-11-16 11:05:03 -0700867 &quot;onPolicySwitch&quot;: &quot;A String&quot;, # TODO(b/165626794): Remove this field Specifies the behavior to apply to existing, scheduled snapshots snapshots if the policy is changed.
Bu Sun Kim65020912020-05-20 12:08:20 -0700868 &quot;onSourceDiskDelete&quot;: &quot;A String&quot;, # Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
869 },
870 &quot;schedule&quot;: { # A schedule for disks where the schedueled operations are performed. # A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy.
871 &quot;dailySchedule&quot;: { # Time window specified for daily operations.
872 &quot;daysInCycle&quot;: 42, # Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle.
873 &quot;duration&quot;: &quot;A String&quot;, # [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.
874 &quot;startTime&quot;: &quot;A String&quot;, # Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.
875 },
876 &quot;hourlySchedule&quot;: { # Time window specified for hourly operations.
877 &quot;duration&quot;: &quot;A String&quot;, # [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
878 &quot;hoursInCycle&quot;: 42, # Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle.
879 &quot;startTime&quot;: &quot;A String&quot;, # Time within the window to start the operations. It must be in format &quot;HH:MM&quot;, where HH : [00-23] and MM : [00-00] GMT.
880 },
881 &quot;weeklySchedule&quot;: { # Time window specified for weekly operations.
882 &quot;dayOfWeeks&quot;: [ # Up to 7 intervals/windows, one for each day of the week.
883 {
884 &quot;day&quot;: &quot;A String&quot;, # Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY.
885 &quot;duration&quot;: &quot;A String&quot;, # [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario.
886 &quot;startTime&quot;: &quot;A String&quot;, # Time within the window to start the operations. It must be in format &quot;HH:MM&quot;, where HH : [00-23] and MM : [00-00] GMT.
887 },
888 ],
889 },
890 },
891 &quot;snapshotProperties&quot;: { # Specified snapshot properties for scheduled snapshots created by this policy. # Properties with which snapshots are created such as labels, encryption keys.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700892 &quot;chainName&quot;: &quot;A String&quot;, # Chain name that the snapshot is created in.
Bu Sun Kim65020912020-05-20 12:08:20 -0700893 &quot;guestFlush&quot;: True or False, # Indication to perform a &#x27;guest aware&#x27; snapshot.
894 &quot;labels&quot;: { # Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty.
895 &quot;a_key&quot;: &quot;A String&quot;,
896 },
897 &quot;storageLocations&quot;: [ # Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional).
898 &quot;A String&quot;,
899 ],
900 },
901 },
902 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of resource policy creation.
903 &quot;vmMaintenancePolicy&quot;: { # Resource policy applicable to VMs for infrastructure maintenance.
904 &quot;concurrencyControlGroup&quot;: { # A concurrency control configuration. Defines a group config that, when attached to an instance, recognizes that instance as part of a group of instances where only up the concurrency_limit of instances in that group can undergo simultaneous maintenance. For more information: go/concurrency-control-design-doc
905 &quot;concurrencyLimit&quot;: 42,
906 },
907 &quot;maintenanceWindow&quot;: { # A maintenance window for VMs. When set, we restrict our maintenance operations to this window. # Maintenance windows that are applied to VMs covered by this policy.
908 &quot;dailyMaintenanceWindow&quot;: { # Time window specified for daily operations.
909 &quot;daysInCycle&quot;: 42, # Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle.
910 &quot;duration&quot;: &quot;A String&quot;, # [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario.
911 &quot;startTime&quot;: &quot;A String&quot;, # Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid.
912 },
913 },
914 },
915 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700916 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700917 &quot;kind&quot;: &quot;compute#resourcePolicyList&quot;, # [Output Only] Type of resource.Always compute#resourcePoliciesList for listsof resourcePolicies
918 &quot;nextPageToken&quot;: &quot;A String&quot;, # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
919 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource.
920 &quot;warning&quot;: { # [Output Only] Informational warning message.
921 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
922 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
923 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700924 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700925 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
926 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700927 },
928 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700929 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700930 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700931 }</pre>
932</div>
933
934<div class="method">
935 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
936 <pre>Retrieves the next page of results.
937
938Args:
939 previous_request: The request for the previous page. (required)
940 previous_response: The response from the request for the previous page. (required)
941
942Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700943 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700944 page. Returns None if there are no more items in the collection.
945 </pre>
946</div>
947
948<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700949 <code class="details" id="setIamPolicy">setIamPolicy(project, region, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700950 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
951
952Args:
953 project: string, Project ID for this request. (required)
954 region: string, The name of the region for this request. (required)
955 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700956 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700957 The object takes the form of:
958
959{
Bu Sun Kim65020912020-05-20 12:08:20 -0700960 &quot;bindings&quot;: [ # Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify bindings.
961 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700962 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -0700963 &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.
964 #
965 # If the condition evaluates to `true`, then this binding applies to the current request.
966 #
967 # 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.
968 #
969 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
970 #
971 # Example (Comparison):
972 #
973 # 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;
974 #
975 # Example (Equality):
976 #
977 # 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;
978 #
979 # Example (Logic):
980 #
981 # 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;
982 #
983 # Example (Data Manipulation):
984 #
985 # 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;
986 #
987 # 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.
988 &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.
989 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
990 &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.
991 &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.
992 },
993 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
994 #
995 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
996 #
997 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
998 #
999 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
1000 #
1001 #
1002 #
1003 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1004 #
1005 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1006 #
1007 # * `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.
1008 #
1009 # * `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.
1010 #
1011 # * `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.
1012 #
1013 #
1014 #
1015 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1016 &quot;A String&quot;,
1017 ],
1018 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1019 },
1020 ],
1021 &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.
1022 &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 -07001023 #
1024 #
1025 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001026 # 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 -07001027 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001028 # 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 -07001029 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001030 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001031 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001032 # { &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 -07001033 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001034 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001035 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001036 # 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 -07001037 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001038 # 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 -07001039 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001040 { # 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.
1041 #
1042 # 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.
1043 #
1044 # Example Policy with multiple AuditConfigs:
1045 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001046 # { &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 -07001047 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001048 # 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 -07001049 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001050 { # Provides the configuration for logging a type of permissions. Example:
1051 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001052 # { &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 -07001053 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001054 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1055 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1056 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001057 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001058 &quot;ignoreChildExemptions&quot;: True or False,
1059 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001060 },
1061 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001062 &quot;exemptedMembers&quot;: [
1063 &quot;A String&quot;,
1064 ],
1065 &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 -07001066 },
1067 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001068 &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 -07001069 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001070 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -07001071 &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.
1072 #
1073 # If the condition evaluates to `true`, then this binding applies to the current request.
1074 #
1075 # 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.
1076 #
1077 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1078 #
1079 # Example (Comparison):
1080 #
1081 # 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;
1082 #
1083 # Example (Equality):
1084 #
1085 # 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;
1086 #
1087 # Example (Logic):
1088 #
1089 # 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;
1090 #
1091 # Example (Data Manipulation):
1092 #
1093 # 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;
1094 #
1095 # 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.
1096 &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.
1097 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1098 &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.
1099 &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.
1100 },
1101 &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 -07001102 #
1103 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1104 #
1105 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1106 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001107 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001108 #
1109 #
1110 #
1111 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1112 #
1113 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1114 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001115 # * `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.
1116 #
1117 # * `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.
1118 #
1119 # * `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.
1120 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001121 #
1122 #
1123 # * `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 -07001124 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001125 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001126 &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 -07001127 },
1128 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001129 &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.
1130 #
1131 # **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.
1132 &quot;iamOwned&quot;: True or False,
1133 &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.
1134 { # A rule to be applied in a Policy.
1135 &quot;action&quot;: &quot;A String&quot;, # Required
1136 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1137 { # A condition to be met.
1138 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1139 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1140 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1141 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1142 &quot;values&quot;: [ # The objects of the condition.
1143 &quot;A String&quot;,
1144 ],
1145 },
1146 ],
1147 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1148 &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.
1149 &quot;A String&quot;,
1150 ],
1151 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1152 { # Specifies what kind of log the caller must write
1153 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1154 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1155 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1156 },
1157 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1158 },
1159 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1160 #
1161 # 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.
1162 #
1163 # Field names correspond to IAM request parameters and field values are their respective values.
1164 #
1165 # 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.
1166 #
1167 # 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]}
1168 &quot;customFields&quot;: [ # Custom fields.
1169 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1170 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1171 &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.
1172 },
1173 ],
1174 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1175 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1176 },
1177 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1178 &quot;logMode&quot;: &quot;A String&quot;,
1179 },
1180 },
1181 ],
1182 &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.
1183 &quot;A String&quot;,
1184 ],
1185 &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.
1186 &quot;A String&quot;,
1187 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001188 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001189 ],
1190 &quot;version&quot;: 42, # Specifies the format of the policy.
1191 #
1192 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1193 #
1194 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1195 #
1196 # * 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
1197 #
1198 # **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.
1199 #
1200 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
1201 #
1202 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1203 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001204 }
1205
1206
1207Returns:
1208 An object of the form:
1209
Dan O'Mearadd494642020-05-01 07:42:23 -07001210 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001211 #
1212 #
1213 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001214 # 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 -07001215 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001216 # 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 -07001217 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001218 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001219 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001220 # { &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 -07001221 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001222 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001223 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001224 # 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 -07001225 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001226 # 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 -07001227 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001228 { # 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.
1229 #
1230 # 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.
1231 #
1232 # Example Policy with multiple AuditConfigs:
1233 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001234 # { &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 -07001235 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001236 # 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 -07001237 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001238 { # Provides the configuration for logging a type of permissions. Example:
1239 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001240 # { &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 -07001241 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001242 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1243 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1244 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001245 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001246 &quot;ignoreChildExemptions&quot;: True or False,
1247 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001248 },
1249 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001250 &quot;exemptedMembers&quot;: [
1251 &quot;A String&quot;,
1252 ],
1253 &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 -07001254 },
1255 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001256 &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 -07001257 { # Associates `members` with a `role`.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -07001258 &quot;bindingId&quot;: &quot;A String&quot;, # A client-specified ID for this binding. Expected to be globally unique to support the internal bindings-by-ID API.
Bu Sun Kim65020912020-05-20 12:08:20 -07001259 &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.
1260 #
1261 # If the condition evaluates to `true`, then this binding applies to the current request.
1262 #
1263 # 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.
1264 #
1265 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1266 #
1267 # Example (Comparison):
1268 #
1269 # 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;
1270 #
1271 # Example (Equality):
1272 #
1273 # 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;
1274 #
1275 # Example (Logic):
1276 #
1277 # 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;
1278 #
1279 # Example (Data Manipulation):
1280 #
1281 # 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;
1282 #
1283 # 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.
1284 &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.
1285 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1286 &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.
1287 &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.
1288 },
1289 &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 -07001290 #
1291 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1292 #
1293 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1294 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001295 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001296 #
1297 #
1298 #
1299 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1300 #
1301 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1302 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001303 # * `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.
1304 #
1305 # * `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.
1306 #
1307 # * `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.
1308 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001309 #
1310 #
1311 # * `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 -07001312 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001313 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001314 &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 -07001315 },
1316 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001317 &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.
1318 #
1319 # **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.
1320 &quot;iamOwned&quot;: True or False,
1321 &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.
1322 { # A rule to be applied in a Policy.
1323 &quot;action&quot;: &quot;A String&quot;, # Required
1324 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1325 { # A condition to be met.
1326 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1327 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1328 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1329 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1330 &quot;values&quot;: [ # The objects of the condition.
1331 &quot;A String&quot;,
1332 ],
1333 },
1334 ],
1335 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1336 &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.
1337 &quot;A String&quot;,
1338 ],
1339 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1340 { # Specifies what kind of log the caller must write
1341 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1342 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1343 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1344 },
1345 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1346 },
1347 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1348 #
1349 # 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.
1350 #
1351 # Field names correspond to IAM request parameters and field values are their respective values.
1352 #
1353 # 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.
1354 #
1355 # 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]}
1356 &quot;customFields&quot;: [ # Custom fields.
1357 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1358 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1359 &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.
1360 },
1361 ],
1362 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1363 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1364 },
1365 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1366 &quot;logMode&quot;: &quot;A String&quot;,
1367 },
1368 },
1369 ],
1370 &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.
1371 &quot;A String&quot;,
1372 ],
1373 &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.
1374 &quot;A String&quot;,
1375 ],
1376 },
1377 ],
1378 &quot;version&quot;: 42, # Specifies the format of the policy.
1379 #
1380 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1381 #
1382 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1383 #
1384 # * 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
1385 #
1386 # **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.
1387 #
1388 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
1389 #
1390 # 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 -07001391 }</pre>
1392</div>
1393
1394<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001395 <code class="details" id="testIamPermissions">testIamPermissions(project, region, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001396 <pre>Returns permissions that a caller has on the specified resource.
1397
1398Args:
1399 project: string, Project ID for this request. (required)
1400 region: string, The name of the region for this request. (required)
1401 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001402 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001403 The object takes the form of:
1404
1405{
Bu Sun Kim65020912020-05-20 12:08:20 -07001406 &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.
1407 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001408 ],
1409 }
1410
1411
1412Returns:
1413 An object of the form:
1414
1415 {
Bu Sun Kim65020912020-05-20 12:08:20 -07001416 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
1417 &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001418 ],
1419 }</pre>
1420</div>
1421
1422</body></html>