blob: aa0ad115d09df3396acc483f8d8486bf3e4019d4 [file] [log] [blame]
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001<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_beta.html">Compute Engine API</a> . <a href="compute_beta.firewallPolicies.html">firewallPolicies</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#addAssociation">addAssociation(firewallPolicy, body=None, replaceExistingAssociation=None, requestId=None)</a></code></p>
79<p class="firstline">Inserts an association for the specified firewall policy.</p>
80<p class="toc_element">
81 <code><a href="#addRule">addRule(firewallPolicy, body=None, requestId=None)</a></code></p>
82<p class="firstline">Inserts a rule into a firewall policy.</p>
83<p class="toc_element">
84 <code><a href="#cloneRules">cloneRules(firewallPolicy, requestId=None, sourceFirewallPolicy=None)</a></code></p>
85<p class="firstline">Copies rules to the specified firewall policy.</p>
86<p class="toc_element">
87 <code><a href="#close">close()</a></code></p>
88<p class="firstline">Close httplib2 connections.</p>
89<p class="toc_element">
90 <code><a href="#delete">delete(firewallPolicy, requestId=None)</a></code></p>
91<p class="firstline">Deletes the specified policy.</p>
92<p class="toc_element">
93 <code><a href="#get">get(firewallPolicy)</a></code></p>
94<p class="firstline">Returns the specified firewall policy.</p>
95<p class="toc_element">
96 <code><a href="#getAssociation">getAssociation(firewallPolicy, name=None)</a></code></p>
97<p class="firstline">Gets an association with the specified name.</p>
98<p class="toc_element">
99 <code><a href="#getIamPolicy">getIamPolicy(resource, optionsRequestedPolicyVersion=None)</a></code></p>
100<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p>
101<p class="toc_element">
102 <code><a href="#getRule">getRule(firewallPolicy, priority=None)</a></code></p>
103<p class="firstline">Gets a rule of the specified priority.</p>
104<p class="toc_element">
105 <code><a href="#insert">insert(body=None, parentId=None, requestId=None)</a></code></p>
106<p class="firstline">Creates a new policy in the specified project using the data included in the request.</p>
107<p class="toc_element">
108 <code><a href="#list">list(filter=None, maxResults=None, orderBy=None, pageToken=None, parentId=None, returnPartialSuccess=None)</a></code></p>
109<p class="firstline">Lists all the policies that have been configured for the specified project.</p>
110<p class="toc_element">
111 <code><a href="#listAssociations">listAssociations(targetResource=None)</a></code></p>
112<p class="firstline">Lists associations of a specified target, i.e., organization or folder.</p>
113<p class="toc_element">
114 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
115<p class="firstline">Retrieves the next page of results.</p>
116<p class="toc_element">
117 <code><a href="#move">move(firewallPolicy, parentId=None, requestId=None)</a></code></p>
118<p class="firstline">Moves the specified firewall policy.</p>
119<p class="toc_element">
120 <code><a href="#patch">patch(firewallPolicy, body=None, requestId=None)</a></code></p>
121<p class="firstline">Patches the specified policy with the data included in the request.</p>
122<p class="toc_element">
123 <code><a href="#patchRule">patchRule(firewallPolicy, body=None, priority=None, requestId=None)</a></code></p>
124<p class="firstline">Patches a rule of the specified priority.</p>
125<p class="toc_element">
126 <code><a href="#removeAssociation">removeAssociation(firewallPolicy, name=None, requestId=None)</a></code></p>
127<p class="firstline">Removes an association for the specified firewall policy.</p>
128<p class="toc_element">
129 <code><a href="#removeRule">removeRule(firewallPolicy, priority=None, requestId=None)</a></code></p>
130<p class="firstline">Deletes a rule of the specified priority.</p>
131<p class="toc_element">
132 <code><a href="#setIamPolicy">setIamPolicy(resource, body=None)</a></code></p>
133<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p>
134<p class="toc_element">
135 <code><a href="#testIamPermissions">testIamPermissions(resource, body=None)</a></code></p>
136<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
137<h3>Method Details</h3>
138<div class="method">
139 <code class="details" id="addAssociation">addAssociation(firewallPolicy, body=None, replaceExistingAssociation=None, requestId=None)</code>
140 <pre>Inserts an association for the specified firewall policy.
141
142Args:
143 firewallPolicy: string, Name of the firewall policy to update. (required)
144 body: object, The request body.
145 The object takes the form of:
146
147{
148 &quot;attachmentTarget&quot;: &quot;A String&quot;, # The target that the firewall policy is attached to.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700149 &quot;displayName&quot;: &quot;A String&quot;, # [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800150 &quot;firewallPolicyId&quot;: &quot;A String&quot;, # [Output Only] The firewall policy ID of the association.
151 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700152 &quot;shortName&quot;: &quot;A String&quot;, # [Output Only] The short name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800153}
154
155 replaceExistingAssociation: boolean, Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists.
156 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.
157
158For 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.
159
160The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
161
162Returns:
163 An object of the form:
164
165 { # Represents an Operation resource.
166 #
167 # Google Compute Engine has three Operation resources:
168 #
169 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
170 #
171 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
172 #
173 # Operations can be global, regional or zonal.
174 # - For global operations, use the `globalOperations` resource.
175 # - For regional operations, use the `regionOperations` resource.
176 # - For zonal operations, use the `zonalOperations` resource.
177 #
178 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
179 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
180 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
181 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
182 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
183 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
184 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
185 {
186 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
187 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
188 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
189 },
190 ],
191 },
192 &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`.
193 &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.
194 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
195 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
196 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
197 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
198 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
199 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
200 &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.
201 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
202 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
203 &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.
204 &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`.
205 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
206 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
207 &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.
208 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
209 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
210 {
211 &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.
212 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
213 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
214 {
215 &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).
216 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
217 },
218 ],
219 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
220 },
221 ],
222 &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.
223}</pre>
224</div>
225
226<div class="method">
227 <code class="details" id="addRule">addRule(firewallPolicy, body=None, requestId=None)</code>
228 <pre>Inserts a rule into a firewall policy.
229
230Args:
231 firewallPolicy: string, Name of the firewall policy to update. (required)
232 body: object, The request body.
233 The object takes the form of:
234
235{ # Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).
236 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the client connection triggers the rule. Can currently be either &quot;allow&quot; or &quot;deny()&quot; where valid values for status are 403, 404, and 502.
237 &quot;description&quot;: &quot;A String&quot;, # An optional description for this resource.
238 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies.
239 &quot;disabled&quot;: True or False, # Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
240 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on &quot;goto_next&quot; rules.
241 &quot;kind&quot;: &quot;compute#firewallPolicyRule&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules
242 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. # A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
243 &quot;destIpRanges&quot;: [ # CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 256.
244 &quot;A String&quot;,
245 ],
246 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
247 {
248 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
249 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port.
250 #
251 # Example inputs include: [&quot;22&quot;], [&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
252 &quot;A String&quot;,
253 ],
254 },
255 ],
256 &quot;srcIpRanges&quot;: [ # CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 256.
257 &quot;A String&quot;,
258 ],
259 &quot;srcSecureLabels&quot;: [ # List of firewall label values, which should be matched at the source of the traffic. Maximum number of source label values allowed is 256.
260 &quot;A String&quot;,
261 ],
262 },
263 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
264 &quot;ruleTupleCount&quot;: 42, # [Output Only] Calculation of the complexity of a single firewall policy rule.
265 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field allows you to control which network&#x27;s VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
266 &quot;A String&quot;,
267 ],
268 &quot;targetSecureLabels&quot;: [ # A list of secure labels that controls which instances the firewall rule applies to. If targetSecureLabel are specified, then the firewall rule applies only to instances in the VPC network that have one of those secure labels. targetSecureLabel may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureLabel are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label values allowed is 256.
269 &quot;A String&quot;,
270 ],
271 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are applied with this rule.
272 &quot;A String&quot;,
273 ],
274}
275
276 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.
277
278For 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.
279
280The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
281
282Returns:
283 An object of the form:
284
285 { # Represents an Operation resource.
286 #
287 # Google Compute Engine has three Operation resources:
288 #
289 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
290 #
291 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
292 #
293 # Operations can be global, regional or zonal.
294 # - For global operations, use the `globalOperations` resource.
295 # - For regional operations, use the `regionOperations` resource.
296 # - For zonal operations, use the `zonalOperations` resource.
297 #
298 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
299 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
300 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
301 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
302 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
303 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
304 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
305 {
306 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
307 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
308 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
309 },
310 ],
311 },
312 &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`.
313 &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.
314 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
315 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
316 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
317 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
318 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
319 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
320 &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.
321 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
322 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
323 &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.
324 &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`.
325 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
326 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
327 &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.
328 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
329 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
330 {
331 &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.
332 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
333 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
334 {
335 &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).
336 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
337 },
338 ],
339 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
340 },
341 ],
342 &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.
343}</pre>
344</div>
345
346<div class="method">
347 <code class="details" id="cloneRules">cloneRules(firewallPolicy, requestId=None, sourceFirewallPolicy=None)</code>
348 <pre>Copies rules to the specified firewall policy.
349
350Args:
351 firewallPolicy: string, Name of the firewall policy to update. (required)
352 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.
353
354For 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.
355
356The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
357 sourceFirewallPolicy: string, The firewall policy from which to copy rules.
358
359Returns:
360 An object of the form:
361
362 { # Represents an Operation resource.
363 #
364 # Google Compute Engine has three Operation resources:
365 #
366 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
367 #
368 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
369 #
370 # Operations can be global, regional or zonal.
371 # - For global operations, use the `globalOperations` resource.
372 # - For regional operations, use the `regionOperations` resource.
373 # - For zonal operations, use the `zonalOperations` resource.
374 #
375 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
376 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
377 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
378 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
379 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
380 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
381 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
382 {
383 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
384 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
385 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
386 },
387 ],
388 },
389 &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`.
390 &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.
391 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
392 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
393 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
394 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
395 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
396 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
397 &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.
398 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
399 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
400 &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.
401 &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`.
402 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
403 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
404 &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.
405 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
406 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
407 {
408 &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.
409 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
410 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
411 {
412 &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).
413 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
414 },
415 ],
416 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
417 },
418 ],
419 &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.
420}</pre>
421</div>
422
423<div class="method">
424 <code class="details" id="close">close()</code>
425 <pre>Close httplib2 connections.</pre>
426</div>
427
428<div class="method">
429 <code class="details" id="delete">delete(firewallPolicy, requestId=None)</code>
430 <pre>Deletes the specified policy.
431
432Args:
433 firewallPolicy: string, Name of the firewall policy to delete. (required)
434 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.
435
436For 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.
437
438The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
439
440Returns:
441 An object of the form:
442
443 { # Represents an Operation resource.
444 #
445 # Google Compute Engine has three Operation resources:
446 #
447 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
448 #
449 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
450 #
451 # Operations can be global, regional or zonal.
452 # - For global operations, use the `globalOperations` resource.
453 # - For regional operations, use the `regionOperations` resource.
454 # - For zonal operations, use the `zonalOperations` resource.
455 #
456 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
457 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
458 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
459 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
460 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
461 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
462 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
463 {
464 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
465 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
466 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
467 },
468 ],
469 },
470 &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`.
471 &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.
472 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
473 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
474 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
475 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
476 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
477 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
478 &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.
479 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
480 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
481 &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.
482 &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`.
483 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
484 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
485 &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.
486 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
487 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
488 {
489 &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.
490 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
491 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
492 {
493 &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).
494 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
495 },
496 ],
497 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
498 },
499 ],
500 &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.
501}</pre>
502</div>
503
504<div class="method">
505 <code class="details" id="get">get(firewallPolicy)</code>
506 <pre>Returns the specified firewall policy.
507
508Args:
509 firewallPolicy: string, Name of the firewall policy to get. (required)
510
511Returns:
512 An object of the form:
513
514 { # Represents a Firewall Policy resource. (== resource_for {$api_version}.firewallPolicies ==)
515 &quot;associations&quot;: [ # A list of associations that belong to this firewall policy.
516 {
517 &quot;attachmentTarget&quot;: &quot;A String&quot;, # The target that the firewall policy is attached to.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700518 &quot;displayName&quot;: &quot;A String&quot;, # [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800519 &quot;firewallPolicyId&quot;: &quot;A String&quot;, # [Output Only] The firewall policy ID of the association.
520 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700521 &quot;shortName&quot;: &quot;A String&quot;, # [Output Only] The short name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800522 },
523 ],
524 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
525 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700526 &quot;displayName&quot;: &quot;A String&quot;, # Depreacted, please use short name instead. User-provided name of the Organization firewall plicy. The name should be unique in the organization in which the firewall policy is created. The 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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800527 &quot;fingerprint&quot;: &quot;A String&quot;, # Specifies a fingerprint for this resource, which is essentially a hash of the metadata&#x27;s contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet.
528 #
529 # To see the latest fingerprint, make get() request to the firewall policy.
530 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
531 &quot;kind&quot;: &quot;compute#firewallPolicy&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyfor firewall policies
532 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the resource. It is a numeric ID allocated by GCP which uniquely identifies the Firewall Policy.
533 &quot;parent&quot;: &quot;A String&quot;, # [Output Only] The parent of the firewall policy.
534 &quot;ruleTupleCount&quot;: 42, # [Output Only] Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
535 &quot;rules&quot;: [ # A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match &quot;*&quot;). If no rules are provided when creating a firewall policy, a default rule with action &quot;allow&quot; will be added.
536 { # Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).
537 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the client connection triggers the rule. Can currently be either &quot;allow&quot; or &quot;deny()&quot; where valid values for status are 403, 404, and 502.
538 &quot;description&quot;: &quot;A String&quot;, # An optional description for this resource.
539 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies.
540 &quot;disabled&quot;: True or False, # Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
541 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on &quot;goto_next&quot; rules.
542 &quot;kind&quot;: &quot;compute#firewallPolicyRule&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules
543 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. # A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
544 &quot;destIpRanges&quot;: [ # CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 256.
545 &quot;A String&quot;,
546 ],
547 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
548 {
549 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
550 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port.
551 #
552 # Example inputs include: [&quot;22&quot;], [&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
553 &quot;A String&quot;,
554 ],
555 },
556 ],
557 &quot;srcIpRanges&quot;: [ # CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 256.
558 &quot;A String&quot;,
559 ],
560 &quot;srcSecureLabels&quot;: [ # List of firewall label values, which should be matched at the source of the traffic. Maximum number of source label values allowed is 256.
561 &quot;A String&quot;,
562 ],
563 },
564 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
565 &quot;ruleTupleCount&quot;: 42, # [Output Only] Calculation of the complexity of a single firewall policy rule.
566 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field allows you to control which network&#x27;s VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
567 &quot;A String&quot;,
568 ],
569 &quot;targetSecureLabels&quot;: [ # A list of secure labels that controls which instances the firewall rule applies to. If targetSecureLabel are specified, then the firewall rule applies only to instances in the VPC network that have one of those secure labels. targetSecureLabel may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureLabel are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label values allowed is 256.
570 &quot;A String&quot;,
571 ],
572 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are applied with this rule.
573 &quot;A String&quot;,
574 ],
575 },
576 ],
577 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
578 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700579 &quot;shortName&quot;: &quot;A String&quot;, # User-provided name of the Organization firewall plicy. The name should be unique in the organization in which the firewall policy is created. The 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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800580}</pre>
581</div>
582
583<div class="method">
584 <code class="details" id="getAssociation">getAssociation(firewallPolicy, name=None)</code>
585 <pre>Gets an association with the specified name.
586
587Args:
588 firewallPolicy: string, Name of the firewall policy to which the queried rule belongs. (required)
589 name: string, The name of the association to get from the firewall policy.
590
591Returns:
592 An object of the form:
593
594 {
595 &quot;attachmentTarget&quot;: &quot;A String&quot;, # The target that the firewall policy is attached to.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700596 &quot;displayName&quot;: &quot;A String&quot;, # [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800597 &quot;firewallPolicyId&quot;: &quot;A String&quot;, # [Output Only] The firewall policy ID of the association.
598 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700599 &quot;shortName&quot;: &quot;A String&quot;, # [Output Only] The short name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800600}</pre>
601</div>
602
603<div class="method">
604 <code class="details" id="getIamPolicy">getIamPolicy(resource, optionsRequestedPolicyVersion=None)</code>
605 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
606
607Args:
608 resource: string, Name or id of the resource for this request. (required)
609 optionsRequestedPolicyVersion: integer, Requested IAM Policy version.
610
611Returns:
612 An object of the form:
613
614 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
615 #
616 #
617 #
618 # 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.
619 #
620 # 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).
621 #
622 # **JSON example:**
623 #
624 # { &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 }
625 #
626 # **YAML example:**
627 #
628 # 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
629 #
630 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
631 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
632 { # 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.
633 #
634 # 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.
635 #
636 # Example Policy with multiple AuditConfigs:
637 #
638 # { &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; ] } ] } ] }
639 #
640 # 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.
641 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
642 { # Provides the configuration for logging a type of permissions. Example:
643 #
644 # { &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; } ] }
645 #
646 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
647 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
648 &quot;A String&quot;,
649 ],
650 &quot;ignoreChildExemptions&quot;: True or False,
651 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
652 },
653 ],
654 &quot;exemptedMembers&quot;: [
655 &quot;A String&quot;,
656 ],
657 &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.
658 },
659 ],
660 &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.
661 { # Associates `members` with a `role`.
662 &quot;bindingId&quot;: &quot;A String&quot;,
663 &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.
664 #
665 # If the condition evaluates to `true`, then this binding applies to the current request.
666 #
667 # 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.
668 #
669 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
670 #
671 # Example (Comparison):
672 #
673 # 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;
674 #
675 # Example (Equality):
676 #
677 # 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;
678 #
679 # Example (Logic):
680 #
681 # 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;
682 #
683 # Example (Data Manipulation):
684 #
685 # 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;
686 #
687 # 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.
688 &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.
689 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
690 &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.
691 &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.
692 },
693 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
694 #
695 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
696 #
697 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
698 #
699 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
700 #
701 #
702 #
703 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
704 #
705 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
706 #
707 # * `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.
708 #
709 # * `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.
710 #
711 # * `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.
712 #
713 #
714 #
715 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
716 &quot;A String&quot;,
717 ],
718 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
719 },
720 ],
721 &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.
722 #
723 # **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.
724 &quot;iamOwned&quot;: True or False,
725 &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.
726 { # A rule to be applied in a Policy.
727 &quot;action&quot;: &quot;A String&quot;, # Required
728 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
729 { # A condition to be met.
730 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
731 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
732 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
733 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
734 &quot;values&quot;: [ # The objects of the condition.
735 &quot;A String&quot;,
736 ],
737 },
738 ],
739 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
740 &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.
741 &quot;A String&quot;,
742 ],
743 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
744 { # Specifies what kind of log the caller must write
745 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
746 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
747 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
748 },
749 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
750 },
751 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
752 #
753 # 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.
754 #
755 # Field names correspond to IAM request parameters and field values are their respective values.
756 #
757 # 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.
758 #
759 # 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]}
760 &quot;customFields&quot;: [ # Custom fields.
761 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
762 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
763 &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.
764 },
765 ],
766 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
767 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
768 },
769 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
770 &quot;logMode&quot;: &quot;A String&quot;,
771 },
772 },
773 ],
774 &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.
775 &quot;A String&quot;,
776 ],
777 &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.
778 &quot;A String&quot;,
779 ],
780 },
781 ],
782 &quot;version&quot;: 42, # Specifies the format of the policy.
783 #
784 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
785 #
786 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
787 #
788 # * 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
789 #
790 # **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.
791 #
792 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
793 #
794 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
795}</pre>
796</div>
797
798<div class="method">
799 <code class="details" id="getRule">getRule(firewallPolicy, priority=None)</code>
800 <pre>Gets a rule of the specified priority.
801
802Args:
803 firewallPolicy: string, Name of the firewall policy to which the queried rule belongs. (required)
804 priority: integer, The priority of the rule to get from the firewall policy.
805
806Returns:
807 An object of the form:
808
809 { # Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).
810 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the client connection triggers the rule. Can currently be either &quot;allow&quot; or &quot;deny()&quot; where valid values for status are 403, 404, and 502.
811 &quot;description&quot;: &quot;A String&quot;, # An optional description for this resource.
812 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies.
813 &quot;disabled&quot;: True or False, # Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
814 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on &quot;goto_next&quot; rules.
815 &quot;kind&quot;: &quot;compute#firewallPolicyRule&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules
816 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. # A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
817 &quot;destIpRanges&quot;: [ # CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 256.
818 &quot;A String&quot;,
819 ],
820 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
821 {
822 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
823 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port.
824 #
825 # Example inputs include: [&quot;22&quot;], [&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
826 &quot;A String&quot;,
827 ],
828 },
829 ],
830 &quot;srcIpRanges&quot;: [ # CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 256.
831 &quot;A String&quot;,
832 ],
833 &quot;srcSecureLabels&quot;: [ # List of firewall label values, which should be matched at the source of the traffic. Maximum number of source label values allowed is 256.
834 &quot;A String&quot;,
835 ],
836 },
837 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
838 &quot;ruleTupleCount&quot;: 42, # [Output Only] Calculation of the complexity of a single firewall policy rule.
839 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field allows you to control which network&#x27;s VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
840 &quot;A String&quot;,
841 ],
842 &quot;targetSecureLabels&quot;: [ # A list of secure labels that controls which instances the firewall rule applies to. If targetSecureLabel are specified, then the firewall rule applies only to instances in the VPC network that have one of those secure labels. targetSecureLabel may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureLabel are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label values allowed is 256.
843 &quot;A String&quot;,
844 ],
845 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are applied with this rule.
846 &quot;A String&quot;,
847 ],
848}</pre>
849</div>
850
851<div class="method">
852 <code class="details" id="insert">insert(body=None, parentId=None, requestId=None)</code>
853 <pre>Creates a new policy in the specified project using the data included in the request.
854
855Args:
856 body: object, The request body.
857 The object takes the form of:
858
859{ # Represents a Firewall Policy resource. (== resource_for {$api_version}.firewallPolicies ==)
860 &quot;associations&quot;: [ # A list of associations that belong to this firewall policy.
861 {
862 &quot;attachmentTarget&quot;: &quot;A String&quot;, # The target that the firewall policy is attached to.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700863 &quot;displayName&quot;: &quot;A String&quot;, # [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800864 &quot;firewallPolicyId&quot;: &quot;A String&quot;, # [Output Only] The firewall policy ID of the association.
865 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700866 &quot;shortName&quot;: &quot;A String&quot;, # [Output Only] The short name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800867 },
868 ],
869 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
870 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700871 &quot;displayName&quot;: &quot;A String&quot;, # Depreacted, please use short name instead. User-provided name of the Organization firewall plicy. The name should be unique in the organization in which the firewall policy is created. The 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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800872 &quot;fingerprint&quot;: &quot;A String&quot;, # Specifies a fingerprint for this resource, which is essentially a hash of the metadata&#x27;s contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet.
873 #
874 # To see the latest fingerprint, make get() request to the firewall policy.
875 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
876 &quot;kind&quot;: &quot;compute#firewallPolicy&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyfor firewall policies
877 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the resource. It is a numeric ID allocated by GCP which uniquely identifies the Firewall Policy.
878 &quot;parent&quot;: &quot;A String&quot;, # [Output Only] The parent of the firewall policy.
879 &quot;ruleTupleCount&quot;: 42, # [Output Only] Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
880 &quot;rules&quot;: [ # A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match &quot;*&quot;). If no rules are provided when creating a firewall policy, a default rule with action &quot;allow&quot; will be added.
881 { # Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).
882 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the client connection triggers the rule. Can currently be either &quot;allow&quot; or &quot;deny()&quot; where valid values for status are 403, 404, and 502.
883 &quot;description&quot;: &quot;A String&quot;, # An optional description for this resource.
884 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies.
885 &quot;disabled&quot;: True or False, # Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
886 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on &quot;goto_next&quot; rules.
887 &quot;kind&quot;: &quot;compute#firewallPolicyRule&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules
888 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. # A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
889 &quot;destIpRanges&quot;: [ # CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 256.
890 &quot;A String&quot;,
891 ],
892 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
893 {
894 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
895 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port.
896 #
897 # Example inputs include: [&quot;22&quot;], [&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
898 &quot;A String&quot;,
899 ],
900 },
901 ],
902 &quot;srcIpRanges&quot;: [ # CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 256.
903 &quot;A String&quot;,
904 ],
905 &quot;srcSecureLabels&quot;: [ # List of firewall label values, which should be matched at the source of the traffic. Maximum number of source label values allowed is 256.
906 &quot;A String&quot;,
907 ],
908 },
909 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
910 &quot;ruleTupleCount&quot;: 42, # [Output Only] Calculation of the complexity of a single firewall policy rule.
911 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field allows you to control which network&#x27;s VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
912 &quot;A String&quot;,
913 ],
914 &quot;targetSecureLabels&quot;: [ # A list of secure labels that controls which instances the firewall rule applies to. If targetSecureLabel are specified, then the firewall rule applies only to instances in the VPC network that have one of those secure labels. targetSecureLabel may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureLabel are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label values allowed is 256.
915 &quot;A String&quot;,
916 ],
917 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are applied with this rule.
918 &quot;A String&quot;,
919 ],
920 },
921 ],
922 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
923 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
yoshi-code-bota8b35b92021-03-31 13:33:30 -0700924 &quot;shortName&quot;: &quot;A String&quot;, # User-provided name of the Organization firewall plicy. The name should be unique in the organization in which the firewall policy is created. The 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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -0800925}
926
927 parentId: string, Parent ID for this request. The ID can be either be &quot;folders/[FOLDER_ID]&quot; if the parent is a folder or &quot;organizations/[ORGANIZATION_ID]&quot; if the parent is an organization.
928 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.
929
930For 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.
931
932The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
933
934Returns:
935 An object of the form:
936
937 { # Represents an Operation resource.
938 #
939 # Google Compute Engine has three Operation resources:
940 #
941 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
942 #
943 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
944 #
945 # Operations can be global, regional or zonal.
946 # - For global operations, use the `globalOperations` resource.
947 # - For regional operations, use the `regionOperations` resource.
948 # - For zonal operations, use the `zonalOperations` resource.
949 #
950 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
951 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
952 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
953 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
954 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
955 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
956 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
957 {
958 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
959 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
960 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
961 },
962 ],
963 },
964 &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`.
965 &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.
966 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
967 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
968 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
969 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
970 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
971 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
972 &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.
973 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
974 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
975 &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.
976 &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`.
977 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
978 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
979 &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.
980 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
981 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
982 {
983 &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.
984 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
985 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
986 {
987 &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).
988 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
989 },
990 ],
991 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
992 },
993 ],
994 &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.
995}</pre>
996</div>
997
998<div class="method">
999 <code class="details" id="list">list(filter=None, maxResults=None, orderBy=None, pageToken=None, parentId=None, returnPartialSuccess=None)</code>
1000 <pre>Lists all the policies that have been configured for the specified project.
1001
1002Args:
1003 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;`.
1004
1005For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
1006
1007You 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.
1008
1009To 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) ```
1010 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`)
1011 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
1012
1013You 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.
1014
1015Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1016 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.
1017 parentId: string, Parent ID for this request.
1018 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
1019
1020Returns:
1021 An object of the form:
1022
1023 {
1024 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
1025 &quot;items&quot;: [ # A list of FirewallPolicy resources.
1026 { # Represents a Firewall Policy resource. (== resource_for {$api_version}.firewallPolicies ==)
1027 &quot;associations&quot;: [ # A list of associations that belong to this firewall policy.
1028 {
1029 &quot;attachmentTarget&quot;: &quot;A String&quot;, # The target that the firewall policy is attached to.
yoshi-code-bota8b35b92021-03-31 13:33:30 -07001030 &quot;displayName&quot;: &quot;A String&quot;, # [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001031 &quot;firewallPolicyId&quot;: &quot;A String&quot;, # [Output Only] The firewall policy ID of the association.
1032 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
yoshi-code-bota8b35b92021-03-31 13:33:30 -07001033 &quot;shortName&quot;: &quot;A String&quot;, # [Output Only] The short name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001034 },
1035 ],
1036 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
1037 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
yoshi-code-bota8b35b92021-03-31 13:33:30 -07001038 &quot;displayName&quot;: &quot;A String&quot;, # Depreacted, please use short name instead. User-provided name of the Organization firewall plicy. The name should be unique in the organization in which the firewall policy is created. The 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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001039 &quot;fingerprint&quot;: &quot;A String&quot;, # Specifies a fingerprint for this resource, which is essentially a hash of the metadata&#x27;s contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet.
1040 #
1041 # To see the latest fingerprint, make get() request to the firewall policy.
1042 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1043 &quot;kind&quot;: &quot;compute#firewallPolicy&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyfor firewall policies
1044 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the resource. It is a numeric ID allocated by GCP which uniquely identifies the Firewall Policy.
1045 &quot;parent&quot;: &quot;A String&quot;, # [Output Only] The parent of the firewall policy.
1046 &quot;ruleTupleCount&quot;: 42, # [Output Only] Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
1047 &quot;rules&quot;: [ # A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match &quot;*&quot;). If no rules are provided when creating a firewall policy, a default rule with action &quot;allow&quot; will be added.
1048 { # Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).
1049 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the client connection triggers the rule. Can currently be either &quot;allow&quot; or &quot;deny()&quot; where valid values for status are 403, 404, and 502.
1050 &quot;description&quot;: &quot;A String&quot;, # An optional description for this resource.
1051 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies.
1052 &quot;disabled&quot;: True or False, # Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
1053 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on &quot;goto_next&quot; rules.
1054 &quot;kind&quot;: &quot;compute#firewallPolicyRule&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules
1055 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. # A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
1056 &quot;destIpRanges&quot;: [ # CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 256.
1057 &quot;A String&quot;,
1058 ],
1059 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
1060 {
1061 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
1062 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port.
1063 #
1064 # Example inputs include: [&quot;22&quot;], [&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
1065 &quot;A String&quot;,
1066 ],
1067 },
1068 ],
1069 &quot;srcIpRanges&quot;: [ # CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 256.
1070 &quot;A String&quot;,
1071 ],
1072 &quot;srcSecureLabels&quot;: [ # List of firewall label values, which should be matched at the source of the traffic. Maximum number of source label values allowed is 256.
1073 &quot;A String&quot;,
1074 ],
1075 },
1076 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
1077 &quot;ruleTupleCount&quot;: 42, # [Output Only] Calculation of the complexity of a single firewall policy rule.
1078 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field allows you to control which network&#x27;s VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
1079 &quot;A String&quot;,
1080 ],
1081 &quot;targetSecureLabels&quot;: [ # A list of secure labels that controls which instances the firewall rule applies to. If targetSecureLabel are specified, then the firewall rule applies only to instances in the VPC network that have one of those secure labels. targetSecureLabel may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureLabel are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label values allowed is 256.
1082 &quot;A String&quot;,
1083 ],
1084 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are applied with this rule.
1085 &quot;A String&quot;,
1086 ],
1087 },
1088 ],
1089 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1090 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
yoshi-code-bota8b35b92021-03-31 13:33:30 -07001091 &quot;shortName&quot;: &quot;A String&quot;, # User-provided name of the Organization firewall plicy. The name should be unique in the organization in which the firewall policy is created. The 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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001092 },
1093 ],
1094 &quot;kind&quot;: &quot;compute#firewallPolicyList&quot;, # [Output Only] Type of resource. Always compute#firewallPolicyList for listsof FirewallPolicies
1095 &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.
1096 &quot;warning&quot;: { # [Output Only] Informational warning message.
1097 &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.
1098 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1099 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1100 {
1101 &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).
1102 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1103 },
1104 ],
1105 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1106 },
1107}</pre>
1108</div>
1109
1110<div class="method">
1111 <code class="details" id="listAssociations">listAssociations(targetResource=None)</code>
1112 <pre>Lists associations of a specified target, i.e., organization or folder.
1113
1114Args:
1115 targetResource: string, The target resource to list associations. It is an organization, or a folder.
1116
1117Returns:
1118 An object of the form:
1119
1120 {
1121 &quot;associations&quot;: [ # A list of associations.
1122 {
1123 &quot;attachmentTarget&quot;: &quot;A String&quot;, # The target that the firewall policy is attached to.
yoshi-code-bota8b35b92021-03-31 13:33:30 -07001124 &quot;displayName&quot;: &quot;A String&quot;, # [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001125 &quot;firewallPolicyId&quot;: &quot;A String&quot;, # [Output Only] The firewall policy ID of the association.
1126 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
yoshi-code-bota8b35b92021-03-31 13:33:30 -07001127 &quot;shortName&quot;: &quot;A String&quot;, # [Output Only] The short name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001128 },
1129 ],
1130 &quot;kind&quot;: &quot;compute#firewallPoliciesListAssociationsResponse&quot;, # [Output Only] Type of firewallPolicy associations. Always compute#FirewallPoliciesListAssociations for lists of firewallPolicy associations.
1131}</pre>
1132</div>
1133
1134<div class="method">
1135 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
1136 <pre>Retrieves the next page of results.
1137
1138Args:
1139 previous_request: The request for the previous page. (required)
1140 previous_response: The response from the request for the previous page. (required)
1141
1142Returns:
1143 A request object that you can call &#x27;execute()&#x27; on to request the next
1144 page. Returns None if there are no more items in the collection.
1145 </pre>
1146</div>
1147
1148<div class="method">
1149 <code class="details" id="move">move(firewallPolicy, parentId=None, requestId=None)</code>
1150 <pre>Moves the specified firewall policy.
1151
1152Args:
1153 firewallPolicy: string, Name of the firewall policy to update. (required)
1154 parentId: string, The new parent of the firewall policy.
1155 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.
1156
1157For 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.
1158
1159The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1160
1161Returns:
1162 An object of the form:
1163
1164 { # Represents an Operation resource.
1165 #
1166 # Google Compute Engine has three Operation resources:
1167 #
1168 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1169 #
1170 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1171 #
1172 # Operations can be global, regional or zonal.
1173 # - For global operations, use the `globalOperations` resource.
1174 # - For regional operations, use the `regionOperations` resource.
1175 # - For zonal operations, use the `zonalOperations` resource.
1176 #
1177 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1178 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1179 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1180 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1181 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1182 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1183 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
1184 {
1185 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1186 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1187 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
1188 },
1189 ],
1190 },
1191 &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`.
1192 &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.
1193 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1194 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1195 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1196 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1197 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
1198 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1199 &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.
1200 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1201 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1202 &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.
1203 &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`.
1204 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1205 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1206 &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.
1207 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1208 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1209 {
1210 &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.
1211 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1212 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1213 {
1214 &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).
1215 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1216 },
1217 ],
1218 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1219 },
1220 ],
1221 &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.
1222}</pre>
1223</div>
1224
1225<div class="method">
1226 <code class="details" id="patch">patch(firewallPolicy, body=None, requestId=None)</code>
1227 <pre>Patches the specified policy with the data included in the request.
1228
1229Args:
1230 firewallPolicy: string, Name of the firewall policy to update. (required)
1231 body: object, The request body.
1232 The object takes the form of:
1233
1234{ # Represents a Firewall Policy resource. (== resource_for {$api_version}.firewallPolicies ==)
1235 &quot;associations&quot;: [ # A list of associations that belong to this firewall policy.
1236 {
1237 &quot;attachmentTarget&quot;: &quot;A String&quot;, # The target that the firewall policy is attached to.
yoshi-code-bota8b35b92021-03-31 13:33:30 -07001238 &quot;displayName&quot;: &quot;A String&quot;, # [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001239 &quot;firewallPolicyId&quot;: &quot;A String&quot;, # [Output Only] The firewall policy ID of the association.
1240 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
yoshi-code-bota8b35b92021-03-31 13:33:30 -07001241 &quot;shortName&quot;: &quot;A String&quot;, # [Output Only] The short name of the firewall policy of the association.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001242 },
1243 ],
1244 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Output Only] Creation timestamp in RFC3339 text format.
1245 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you create the resource.
yoshi-code-bota8b35b92021-03-31 13:33:30 -07001246 &quot;displayName&quot;: &quot;A String&quot;, # Depreacted, please use short name instead. User-provided name of the Organization firewall plicy. The name should be unique in the organization in which the firewall policy is created. The 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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001247 &quot;fingerprint&quot;: &quot;A String&quot;, # Specifies a fingerprint for this resource, which is essentially a hash of the metadata&#x27;s contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet.
1248 #
1249 # To see the latest fingerprint, make get() request to the firewall policy.
1250 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
1251 &quot;kind&quot;: &quot;compute#firewallPolicy&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyfor firewall policies
1252 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the resource. It is a numeric ID allocated by GCP which uniquely identifies the Firewall Policy.
1253 &quot;parent&quot;: &quot;A String&quot;, # [Output Only] The parent of the firewall policy.
1254 &quot;ruleTupleCount&quot;: 42, # [Output Only] Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
1255 &quot;rules&quot;: [ # A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match &quot;*&quot;). If no rules are provided when creating a firewall policy, a default rule with action &quot;allow&quot; will be added.
1256 { # Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).
1257 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the client connection triggers the rule. Can currently be either &quot;allow&quot; or &quot;deny()&quot; where valid values for status are 403, 404, and 502.
1258 &quot;description&quot;: &quot;A String&quot;, # An optional description for this resource.
1259 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies.
1260 &quot;disabled&quot;: True or False, # Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
1261 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on &quot;goto_next&quot; rules.
1262 &quot;kind&quot;: &quot;compute#firewallPolicyRule&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules
1263 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. # A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
1264 &quot;destIpRanges&quot;: [ # CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 256.
1265 &quot;A String&quot;,
1266 ],
1267 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
1268 {
1269 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
1270 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port.
1271 #
1272 # Example inputs include: [&quot;22&quot;], [&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
1273 &quot;A String&quot;,
1274 ],
1275 },
1276 ],
1277 &quot;srcIpRanges&quot;: [ # CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 256.
1278 &quot;A String&quot;,
1279 ],
1280 &quot;srcSecureLabels&quot;: [ # List of firewall label values, which should be matched at the source of the traffic. Maximum number of source label values allowed is 256.
1281 &quot;A String&quot;,
1282 ],
1283 },
1284 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
1285 &quot;ruleTupleCount&quot;: 42, # [Output Only] Calculation of the complexity of a single firewall policy rule.
1286 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field allows you to control which network&#x27;s VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
1287 &quot;A String&quot;,
1288 ],
1289 &quot;targetSecureLabels&quot;: [ # A list of secure labels that controls which instances the firewall rule applies to. If targetSecureLabel are specified, then the firewall rule applies only to instances in the VPC network that have one of those secure labels. targetSecureLabel may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureLabel are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label values allowed is 256.
1290 &quot;A String&quot;,
1291 ],
1292 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are applied with this rule.
1293 &quot;A String&quot;,
1294 ],
1295 },
1296 ],
1297 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1298 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for this resource with the resource id.
yoshi-code-bota8b35b92021-03-31 13:33:30 -07001299 &quot;shortName&quot;: &quot;A String&quot;, # User-provided name of the Organization firewall plicy. The name should be unique in the organization in which the firewall policy is created. The 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.
yoshi-code-botb6dc1b92021-03-02 11:49:08 -08001300}
1301
1302 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.
1303
1304For 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.
1305
1306The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1307
1308Returns:
1309 An object of the form:
1310
1311 { # Represents an Operation resource.
1312 #
1313 # Google Compute Engine has three Operation resources:
1314 #
1315 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1316 #
1317 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1318 #
1319 # Operations can be global, regional or zonal.
1320 # - For global operations, use the `globalOperations` resource.
1321 # - For regional operations, use the `regionOperations` resource.
1322 # - For zonal operations, use the `zonalOperations` resource.
1323 #
1324 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1325 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1326 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1327 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1328 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1329 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1330 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
1331 {
1332 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1333 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1334 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
1335 },
1336 ],
1337 },
1338 &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`.
1339 &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.
1340 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1341 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1342 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1343 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1344 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
1345 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1346 &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.
1347 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1348 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1349 &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.
1350 &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`.
1351 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1352 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1353 &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.
1354 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1355 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1356 {
1357 &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.
1358 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1359 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1360 {
1361 &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).
1362 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1363 },
1364 ],
1365 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1366 },
1367 ],
1368 &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.
1369}</pre>
1370</div>
1371
1372<div class="method">
1373 <code class="details" id="patchRule">patchRule(firewallPolicy, body=None, priority=None, requestId=None)</code>
1374 <pre>Patches a rule of the specified priority.
1375
1376Args:
1377 firewallPolicy: string, Name of the firewall policy to update. (required)
1378 body: object, The request body.
1379 The object takes the form of:
1380
1381{ # Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).
1382 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the client connection triggers the rule. Can currently be either &quot;allow&quot; or &quot;deny()&quot; where valid values for status are 403, 404, and 502.
1383 &quot;description&quot;: &quot;A String&quot;, # An optional description for this resource.
1384 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies.
1385 &quot;disabled&quot;: True or False, # Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled.
1386 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on &quot;goto_next&quot; rules.
1387 &quot;kind&quot;: &quot;compute#firewallPolicyRule&quot;, # [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules
1388 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. # A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
1389 &quot;destIpRanges&quot;: [ # CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 256.
1390 &quot;A String&quot;,
1391 ],
1392 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
1393 {
1394 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number.
1395 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port.
1396 #
1397 # Example inputs include: [&quot;22&quot;], [&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
1398 &quot;A String&quot;,
1399 ],
1400 },
1401 ],
1402 &quot;srcIpRanges&quot;: [ # CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 256.
1403 &quot;A String&quot;,
1404 ],
1405 &quot;srcSecureLabels&quot;: [ # List of firewall label values, which should be matched at the source of the traffic. Maximum number of source label values allowed is 256.
1406 &quot;A String&quot;,
1407 ],
1408 },
1409 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority.
1410 &quot;ruleTupleCount&quot;: 42, # [Output Only] Calculation of the complexity of a single firewall policy rule.
1411 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field allows you to control which network&#x27;s VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule.
1412 &quot;A String&quot;,
1413 ],
1414 &quot;targetSecureLabels&quot;: [ # A list of secure labels that controls which instances the firewall rule applies to. If targetSecureLabel are specified, then the firewall rule applies only to instances in the VPC network that have one of those secure labels. targetSecureLabel may not be set at the same time as targetServiceAccounts. If neither targetServiceAccounts nor targetSecureLabel are specified, the firewall rule applies to all instances on the specified network. Maximum number of target label values allowed is 256.
1415 &quot;A String&quot;,
1416 ],
1417 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are applied with this rule.
1418 &quot;A String&quot;,
1419 ],
1420}
1421
1422 priority: integer, The priority of the rule to patch.
1423 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.
1424
1425For 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.
1426
1427The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1428
1429Returns:
1430 An object of the form:
1431
1432 { # Represents an Operation resource.
1433 #
1434 # Google Compute Engine has three Operation resources:
1435 #
1436 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1437 #
1438 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1439 #
1440 # Operations can be global, regional or zonal.
1441 # - For global operations, use the `globalOperations` resource.
1442 # - For regional operations, use the `regionOperations` resource.
1443 # - For zonal operations, use the `zonalOperations` resource.
1444 #
1445 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1446 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1447 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1448 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1449 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1450 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1451 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
1452 {
1453 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1454 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1455 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
1456 },
1457 ],
1458 },
1459 &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`.
1460 &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.
1461 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1462 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1463 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1464 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1465 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
1466 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1467 &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.
1468 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1469 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1470 &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.
1471 &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`.
1472 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1473 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1474 &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.
1475 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1476 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1477 {
1478 &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.
1479 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1480 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1481 {
1482 &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).
1483 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1484 },
1485 ],
1486 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1487 },
1488 ],
1489 &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.
1490}</pre>
1491</div>
1492
1493<div class="method">
1494 <code class="details" id="removeAssociation">removeAssociation(firewallPolicy, name=None, requestId=None)</code>
1495 <pre>Removes an association for the specified firewall policy.
1496
1497Args:
1498 firewallPolicy: string, Name of the firewall policy to update. (required)
1499 name: string, Name for the attachment that will be removed.
1500 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.
1501
1502For 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.
1503
1504The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1505
1506Returns:
1507 An object of the form:
1508
1509 { # Represents an Operation resource.
1510 #
1511 # Google Compute Engine has three Operation resources:
1512 #
1513 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1514 #
1515 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1516 #
1517 # Operations can be global, regional or zonal.
1518 # - For global operations, use the `globalOperations` resource.
1519 # - For regional operations, use the `regionOperations` resource.
1520 # - For zonal operations, use the `zonalOperations` resource.
1521 #
1522 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1523 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1524 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1525 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1526 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1527 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1528 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
1529 {
1530 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1531 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1532 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
1533 },
1534 ],
1535 },
1536 &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`.
1537 &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.
1538 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1539 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1540 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1541 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1542 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
1543 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1544 &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.
1545 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1546 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1547 &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.
1548 &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`.
1549 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1550 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1551 &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.
1552 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1553 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1554 {
1555 &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.
1556 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1557 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1558 {
1559 &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).
1560 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1561 },
1562 ],
1563 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1564 },
1565 ],
1566 &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.
1567}</pre>
1568</div>
1569
1570<div class="method">
1571 <code class="details" id="removeRule">removeRule(firewallPolicy, priority=None, requestId=None)</code>
1572 <pre>Deletes a rule of the specified priority.
1573
1574Args:
1575 firewallPolicy: string, Name of the firewall policy to update. (required)
1576 priority: integer, The priority of the rule to remove from the firewall policy.
1577 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.
1578
1579For 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.
1580
1581The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
1582
1583Returns:
1584 An object of the form:
1585
1586 { # Represents an Operation resource.
1587 #
1588 # Google Compute Engine has three Operation resources:
1589 #
1590 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
1591 #
1592 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
1593 #
1594 # Operations can be global, regional or zonal.
1595 # - For global operations, use the `globalOperations` resource.
1596 # - For regional operations, use the `regionOperations` resource.
1597 # - For zonal operations, use the `zonalOperations` resource.
1598 #
1599 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
1600 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
1601 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
1602 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is set when the operation is created.
1603 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
1604 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
1605 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this operation.
1606 {
1607 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
1608 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error. This property is optional.
1609 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
1610 },
1611 ],
1612 },
1613 &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`.
1614 &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.
1615 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
1616 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
1617 &quot;kind&quot;: &quot;compute#operation&quot;, # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
1618 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1619 &quot;operationGroupId&quot;: &quot;A String&quot;, # [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request.
1620 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
1621 &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.
1622 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
1623 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1624 &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.
1625 &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`.
1626 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the operation.
1627 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
1628 &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.
1629 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example: `user@example.com`.
1630 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
1631 {
1632 &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.
1633 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key: value format. For example:
1634 # &quot;data&quot;: [ { &quot;key&quot;: &quot;scope&quot;, &quot;value&quot;: &quot;zones/us-east1-d&quot; }
1635 {
1636 &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).
1637 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1638 },
1639 ],
1640 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1641 },
1642 ],
1643 &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.
1644}</pre>
1645</div>
1646
1647<div class="method">
1648 <code class="details" id="setIamPolicy">setIamPolicy(resource, body=None)</code>
1649 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
1650
1651Args:
1652 resource: string, Name or id of the resource for this request. (required)
1653 body: object, The request body.
1654 The object takes the form of:
1655
1656{
1657 &quot;bindings&quot;: [ # Flatten Policy to create a backward compatible wire-format. Deprecated. Use &#x27;policy&#x27; to specify bindings.
1658 { # Associates `members` with a `role`.
1659 &quot;bindingId&quot;: &quot;A String&quot;,
1660 &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.
1661 #
1662 # If the condition evaluates to `true`, then this binding applies to the current request.
1663 #
1664 # 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.
1665 #
1666 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1667 #
1668 # Example (Comparison):
1669 #
1670 # 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;
1671 #
1672 # Example (Equality):
1673 #
1674 # 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;
1675 #
1676 # Example (Logic):
1677 #
1678 # 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;
1679 #
1680 # Example (Data Manipulation):
1681 #
1682 # 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;
1683 #
1684 # 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.
1685 &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.
1686 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1687 &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.
1688 &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.
1689 },
1690 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1691 #
1692 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1693 #
1694 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1695 #
1696 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
1697 #
1698 #
1699 #
1700 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1701 #
1702 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1703 #
1704 # * `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.
1705 #
1706 # * `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.
1707 #
1708 # * `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.
1709 #
1710 #
1711 #
1712 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1713 &quot;A String&quot;,
1714 ],
1715 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1716 },
1717 ],
1718 &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.
1719 &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.
1720 #
1721 #
1722 #
1723 # 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.
1724 #
1725 # 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).
1726 #
1727 # **JSON example:**
1728 #
1729 # { &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 }
1730 #
1731 # **YAML example:**
1732 #
1733 # 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
1734 #
1735 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
1736 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
1737 { # 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.
1738 #
1739 # 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.
1740 #
1741 # Example Policy with multiple AuditConfigs:
1742 #
1743 # { &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; ] } ] } ] }
1744 #
1745 # 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.
1746 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
1747 { # Provides the configuration for logging a type of permissions. Example:
1748 #
1749 # { &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; } ] }
1750 #
1751 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1752 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1753 &quot;A String&quot;,
1754 ],
1755 &quot;ignoreChildExemptions&quot;: True or False,
1756 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
1757 },
1758 ],
1759 &quot;exemptedMembers&quot;: [
1760 &quot;A String&quot;,
1761 ],
1762 &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.
1763 },
1764 ],
1765 &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.
1766 { # Associates `members` with a `role`.
1767 &quot;bindingId&quot;: &quot;A String&quot;,
1768 &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.
1769 #
1770 # If the condition evaluates to `true`, then this binding applies to the current request.
1771 #
1772 # 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.
1773 #
1774 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1775 #
1776 # Example (Comparison):
1777 #
1778 # 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;
1779 #
1780 # Example (Equality):
1781 #
1782 # 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;
1783 #
1784 # Example (Logic):
1785 #
1786 # 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;
1787 #
1788 # Example (Data Manipulation):
1789 #
1790 # 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;
1791 #
1792 # 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.
1793 &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.
1794 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1795 &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.
1796 &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.
1797 },
1798 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1799 #
1800 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1801 #
1802 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1803 #
1804 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
1805 #
1806 #
1807 #
1808 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1809 #
1810 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1811 #
1812 # * `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.
1813 #
1814 # * `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.
1815 #
1816 # * `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.
1817 #
1818 #
1819 #
1820 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1821 &quot;A String&quot;,
1822 ],
1823 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1824 },
1825 ],
1826 &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.
1827 #
1828 # **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.
1829 &quot;iamOwned&quot;: True or False,
1830 &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.
1831 { # A rule to be applied in a Policy.
1832 &quot;action&quot;: &quot;A String&quot;, # Required
1833 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1834 { # A condition to be met.
1835 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
1836 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
1837 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
1838 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1839 &quot;values&quot;: [ # The objects of the condition.
1840 &quot;A String&quot;,
1841 ],
1842 },
1843 ],
1844 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
1845 &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.
1846 &quot;A String&quot;,
1847 ],
1848 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1849 { # Specifies what kind of log the caller must write
1850 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
1851 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1852 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
1853 },
1854 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
1855 },
1856 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
1857 #
1858 # 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.
1859 #
1860 # Field names correspond to IAM request parameters and field values are their respective values.
1861 #
1862 # 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.
1863 #
1864 # 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]}
1865 &quot;customFields&quot;: [ # Custom fields.
1866 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1867 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
1868 &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.
1869 },
1870 ],
1871 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
1872 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
1873 },
1874 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
1875 &quot;logMode&quot;: &quot;A String&quot;,
1876 },
1877 },
1878 ],
1879 &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.
1880 &quot;A String&quot;,
1881 ],
1882 &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.
1883 &quot;A String&quot;,
1884 ],
1885 },
1886 ],
1887 &quot;version&quot;: 42, # Specifies the format of the policy.
1888 #
1889 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1890 #
1891 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1892 #
1893 # * 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
1894 #
1895 # **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.
1896 #
1897 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
1898 #
1899 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1900 },
1901}
1902
1903
1904Returns:
1905 An object of the form:
1906
1907 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
1908 #
1909 #
1910 #
1911 # 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.
1912 #
1913 # 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).
1914 #
1915 # **JSON example:**
1916 #
1917 # { &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 }
1918 #
1919 # **YAML example:**
1920 #
1921 # 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
1922 #
1923 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
1924 &quot;auditConfigs&quot;: [ # Specifies cloud audit logging configuration for this policy.
1925 { # 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.
1926 #
1927 # 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.
1928 #
1929 # Example Policy with multiple AuditConfigs:
1930 #
1931 # { &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; ] } ] } ] }
1932 #
1933 # 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.
1934 &quot;auditLogConfigs&quot;: [ # The configuration for logging of each type of permission.
1935 { # Provides the configuration for logging a type of permissions. Example:
1936 #
1937 # { &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; } ] }
1938 #
1939 # This enables &#x27;DATA_READ&#x27; and &#x27;DATA_WRITE&#x27; logging, while exempting jose@example.com from DATA_READ logging.
1940 &quot;exemptedMembers&quot;: [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1941 &quot;A String&quot;,
1942 ],
1943 &quot;ignoreChildExemptions&quot;: True or False,
1944 &quot;logType&quot;: &quot;A String&quot;, # The log type that this config enables.
1945 },
1946 ],
1947 &quot;exemptedMembers&quot;: [
1948 &quot;A String&quot;,
1949 ],
1950 &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.
1951 },
1952 ],
1953 &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.
1954 { # Associates `members` with a `role`.
1955 &quot;bindingId&quot;: &quot;A String&quot;,
1956 &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.
1957 #
1958 # If the condition evaluates to `true`, then this binding applies to the current request.
1959 #
1960 # 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.
1961 #
1962 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
1963 #
1964 # Example (Comparison):
1965 #
1966 # 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;
1967 #
1968 # Example (Equality):
1969 #
1970 # 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;
1971 #
1972 # Example (Logic):
1973 #
1974 # 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;
1975 #
1976 # Example (Data Manipulation):
1977 #
1978 # 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;
1979 #
1980 # 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.
1981 &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.
1982 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language syntax.
1983 &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.
1984 &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.
1985 },
1986 &quot;members&quot;: [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1987 #
1988 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1989 #
1990 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1991 #
1992 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
1993 #
1994 #
1995 #
1996 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1997 #
1998 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1999 #
2000 # * `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.
2001 #
2002 # * `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.
2003 #
2004 # * `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.
2005 #
2006 #
2007 #
2008 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
2009 &quot;A String&quot;,
2010 ],
2011 &quot;role&quot;: &quot;A String&quot;, # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
2012 },
2013 ],
2014 &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.
2015 #
2016 # **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.
2017 &quot;iamOwned&quot;: True or False,
2018 &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.
2019 { # A rule to be applied in a Policy.
2020 &quot;action&quot;: &quot;A String&quot;, # Required
2021 &quot;conditions&quot;: [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
2022 { # A condition to be met.
2023 &quot;iam&quot;: &quot;A String&quot;, # Trusted attributes supplied by the IAM system.
2024 &quot;op&quot;: &quot;A String&quot;, # An operator to apply the subject with.
2025 &quot;svc&quot;: &quot;A String&quot;, # Trusted attributes discharged by the service.
2026 &quot;sys&quot;: &quot;A String&quot;, # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
2027 &quot;values&quot;: [ # The objects of the condition.
2028 &quot;A String&quot;,
2029 ],
2030 },
2031 ],
2032 &quot;description&quot;: &quot;A String&quot;, # Human-readable description of the rule.
2033 &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.
2034 &quot;A String&quot;,
2035 ],
2036 &quot;logConfigs&quot;: [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
2037 { # Specifies what kind of log the caller must write
2038 &quot;cloudAudit&quot;: { # Write a Cloud Audit log # Cloud audit options.
2039 &quot;authorizationLoggingOptions&quot;: { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
2040 &quot;permissionType&quot;: &quot;A String&quot;, # The type of the permission that was checked.
2041 },
2042 &quot;logName&quot;: &quot;A String&quot;, # The log_name to populate in the Cloud Audit Record.
2043 },
2044 &quot;counter&quot;: { # Increment a streamz counter with the specified metric and field names. # Counter options.
2045 #
2046 # 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.
2047 #
2048 # Field names correspond to IAM request parameters and field values are their respective values.
2049 #
2050 # 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.
2051 #
2052 # 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]}
2053 &quot;customFields&quot;: [ # Custom fields.
2054 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
2055 &quot;name&quot;: &quot;A String&quot;, # Name is the field name.
2056 &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.
2057 },
2058 ],
2059 &quot;field&quot;: &quot;A String&quot;, # The field value to attribute.
2060 &quot;metric&quot;: &quot;A String&quot;, # The metric to update.
2061 },
2062 &quot;dataAccess&quot;: { # Write a Data Access (Gin) log # Data access options.
2063 &quot;logMode&quot;: &quot;A String&quot;,
2064 },
2065 },
2066 ],
2067 &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.
2068 &quot;A String&quot;,
2069 ],
2070 &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.
2071 &quot;A String&quot;,
2072 ],
2073 },
2074 ],
2075 &quot;version&quot;: 42, # Specifies the format of the policy.
2076 #
2077 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
2078 #
2079 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
2080 #
2081 # * 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
2082 #
2083 # **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.
2084 #
2085 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
2086 #
2087 # To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
2088}</pre>
2089</div>
2090
2091<div class="method">
2092 <code class="details" id="testIamPermissions">testIamPermissions(resource, body=None)</code>
2093 <pre>Returns permissions that a caller has on the specified resource.
2094
2095Args:
2096 resource: string, Name or id of the resource for this request. (required)
2097 body: object, The request body.
2098 The object takes the form of:
2099
2100{
2101 &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.
2102 &quot;A String&quot;,
2103 ],
2104}
2105
2106
2107Returns:
2108 An object of the form:
2109
2110 {
2111 &quot;permissions&quot;: [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
2112 &quot;A String&quot;,
2113 ],
2114}</pre>
2115</div>
2116
2117</body></html>