Debian Codegraph @

docs/dyn/compute_beta.regionSecurityPolicies.html

raw
1 <html><body>
2 <style>
3
4 body, 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
15 body {
16 font-size: 13px;
17 padding: 1em;
18 }
19
20 h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23 }
24
25 h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28 }
29
30 h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34 }
35
36 pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39 }
40
41 pre {
42 margin-top: 0.5em;
43 }
44
45 h1, h2, h3, p {
46 font-family: Arial, sans serif;
47 }
48
49 h1, 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.regionSecurityPolicies.html">regionSecurityPolicies</a></h1>
76 <h2>Instance Methods</h2>
77 <p class="toc_element">
78 <code><a href="#addRule">addRule(project, region, securityPolicy, body=None, validateOnly=None, x__xgafv=None)</a></code></p>
79 <p class="firstline">Inserts a rule into a security policy.</p>
80 <p class="toc_element">
81 <code><a href="#close">close()</a></code></p>
82 <p class="firstline">Close httplib2 connections.</p>
83 <p class="toc_element">
84 <code><a href="#delete">delete(project, region, securityPolicy, requestId=None, x__xgafv=None)</a></code></p>
85 <p class="firstline">Deletes the specified policy.</p>
86 <p class="toc_element">
87 <code><a href="#get">get(project, region, securityPolicy, x__xgafv=None)</a></code></p>
88 <p class="firstline">List all of the ordered rules present in a single specified policy.</p>
89 <p class="toc_element">
90 <code><a href="#getRule">getRule(project, region, securityPolicy, priority=None, x__xgafv=None)</a></code></p>
91 <p class="firstline">Gets a rule at the specified priority.</p>
92 <p class="toc_element">
93 <code><a href="#insert">insert(project, region, body=None, requestId=None, validateOnly=None, x__xgafv=None)</a></code></p>
94 <p class="firstline">Creates a new policy in the specified project using the data included in</p>
95 <p class="toc_element">
96 <code><a href="#list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None, x__xgafv=None)</a></code></p>
97 <p class="firstline">List all the policies that have been configured for the specified project</p>
98 <p class="toc_element">
99 <code><a href="#list_next">list_next()</a></code></p>
100 <p class="firstline">Retrieves the next page of results.</p>
101 <p class="toc_element">
102 <code><a href="#patch">patch(project, region, securityPolicy, body=None, requestId=None, updateMask=None, x__xgafv=None)</a></code></p>
103 <p class="firstline">Patches the specified policy with the data included in the request. To</p>
104 <p class="toc_element">
105 <code><a href="#patchRule">patchRule(project, region, securityPolicy, body=None, priority=None, updateMask=None, validateOnly=None, x__xgafv=None)</a></code></p>
106 <p class="firstline">Patches a rule at the specified priority. To clear fields in the rule,</p>
107 <p class="toc_element">
108 <code><a href="#removeRule">removeRule(project, region, securityPolicy, priority=None, x__xgafv=None)</a></code></p>
109 <p class="firstline">Deletes a rule at the specified priority.</p>
110 <p class="toc_element">
111 <code><a href="#setLabels">setLabels(project, region, resource, body=None, requestId=None, x__xgafv=None)</a></code></p>
112 <p class="firstline">Sets the labels on a security policy. To learn more about labels,</p>
113 <h3>Method Details</h3>
114 <div class="method">
115 <code class="details" id="addRule">addRule(project, region, securityPolicy, body=None, validateOnly=None, x__xgafv=None)</code>
116 <pre>Inserts a rule into a security policy.
117
118 Args:
119 project: string, Project ID for this request. (required)
120 region: string, Name of the region scoping this request. (required)
121 securityPolicy: string, Name of the security policy to update. (required)
122 body: object, The request body.
123 The object takes the form of:
124
125 { # Represents a rule that describes one or more match conditions along with
126 # the action to be taken when traffic matches this condition (allow or deny).
127 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the rule is matched.
128 # The following are the valid actions:
129 #
130 # - allow: allow access to target.
131 # - deny(STATUS): deny access to target, returns the
132 # HTTP response code specified. Valid values for `STATUS`
133 # are 403, 404, and 502.
134 # - rate_based_ban: limit client traffic to the configured
135 # threshold and ban the client if the traffic exceeds the threshold.
136 # Configure parameters for this action in RateLimitOptions. Requires
137 # rate_limit_options to be set.
138 # - redirect: redirect to a different target. This can
139 # either be an internal reCAPTCHA redirect, or an external URL-based
140 # redirect via a 302 response. Parameters for this action can be configured
141 # via redirectOptions. This action is only supported in Global Security
142 # Policies of type CLOUD_ARMOR.
143 # - throttle: limit
144 # client traffic to the configured threshold. Configure parameters for this
145 # action in rateLimitOptions. Requires rate_limit_options to be set for
146 # this.
147 # - fairshare (preview only): when traffic reaches the
148 # threshold limit, requests from the clients matching this rule begin to be
149 # rate-limited using the Fair Share algorithm. This action is only allowed
150 # in security policies of type `CLOUD_ARMOR_INTERNAL_SERVICE`.
151 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
152 # create the resource.
153 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies. This field may only be
154 # specified when versioned_expr is set to FIREWALL.
155 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is
156 # enabled, logs will be exported to the configured export destination in
157 # Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you
158 # cannot enable logging on &quot;goto_next&quot; rules.
159 #
160 # This field may only be specified when the versioned_expr is set to
161 # FIREWALL.
162 &quot;headerAction&quot;: { # Optional, additional actions that are performed on headers.
163 # This field is only supported in Global Security Policies of type
164 # CLOUD_ARMOR.
165 &quot;requestHeadersToAdds&quot;: [ # The list of request headers to add or overwrite if they&#x27;re already
166 # present.
167 {
168 &quot;headerName&quot;: &quot;A String&quot;, # The name of the header to set.
169 &quot;headerValue&quot;: &quot;A String&quot;, # The value to set the named header to.
170 },
171 ],
172 },
173 &quot;kind&quot;: &quot;compute#securityPolicyRule&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyRule for security policy rules
174 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. # A match condition that incoming traffic is evaluated against.
175 # If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
176 # Exactly one field must be specified.
177 &quot;config&quot;: { # The configuration options available when specifying versioned_expr.
178 # This field must be specified if versioned_expr is specified and cannot
179 # be specified if versioned_expr is not specified.
180 &quot;destIpRanges&quot;: [ # CIDR IP address range.
181 #
182 # This field may only be specified when versioned_expr is set to
183 # FIREWALL.
184 &quot;A String&quot;,
185 ],
186 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
187 #
188 # This field may only be specified when versioned_expr is set to
189 # FIREWALL.
190 {
191 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is
192 # required when creating a firewall rule. This value can either be
193 # one of the following well known protocol strings (tcp,udp, icmp, esp,ah, ipip, sctp), or the IP
194 # protocol number.
195 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is
196 # only applicable for UDP or TCP protocol. Each entry must be either
197 # an integer or a range. If not specified, this rule applies to
198 # connections through any port.
199 #
200 # Example inputs include: [&quot;22&quot;],[&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
201 #
202 # This field may only be specified when versioned_expr is set to
203 # FIREWALL.
204 &quot;A String&quot;,
205 ],
206 },
207 ],
208 &quot;srcIpRanges&quot;: [ # CIDR IP address range.
209 # Maximum number of src_ip_ranges allowed is 10.
210 &quot;A String&quot;,
211 ],
212 },
213 &quot;expr&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # User defined CEVAL expression.
214 # A CEVAL expression is used to specify match criteria such as origin.ip,
215 # source.region_code and contents in the request header.
216 # Expressions containing `evaluateThreatIntelligence` require a Cloud
217 # Armor Enterprise subscription and are not supported in Edge Policies
218 # nor in Regional Policies. Expressions containing
219 # `evaluatePreconfiguredExpr(&#x27;sourceiplist-*&#x27;)` require a Cloud Armor
220 # Enterprise subscription and are only supported in Global Security
221 # Policies.
222 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
223 # are documented at https://github.com/google/cel-spec.
224 #
225 # Example (Comparison):
226 #
227 # title: &quot;Summary size limit&quot;
228 # description: &quot;Determines if a summary is less than 100 chars&quot;
229 # expression: &quot;document.summary.size() &lt; 100&quot;
230 #
231 # Example (Equality):
232 #
233 # title: &quot;Requestor is owner&quot;
234 # description: &quot;Determines if requestor is the document owner&quot;
235 # expression: &quot;document.owner == request.auth.claims.email&quot;
236 #
237 # Example (Logic):
238 #
239 # title: &quot;Public documents&quot;
240 # description: &quot;Determine whether the document should be publicly visible&quot;
241 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
242 #
243 # Example (Data Manipulation):
244 #
245 # title: &quot;Notification string&quot;
246 # description: &quot;Create a notification string with a timestamp.&quot;
247 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
248 #
249 # The exact variables and functions that may be referenced within an expression
250 # are determined by the service that evaluates it. See the service
251 # documentation for additional information.
252 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
253 # describes the expression, e.g. when hovered over it in a UI.
254 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
255 # syntax.
256 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
257 # reporting, e.g. a file name and a position in the file.
258 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
259 # its purpose. This can be used e.g. in UIs which allow to enter the
260 # expression.
261 },
262 &quot;exprOptions&quot;: { # The configuration options available when specifying a user defined
263 # CEVAL expression (i.e., &#x27;expr&#x27;).
264 &quot;recaptchaOptions&quot;: { # reCAPTCHA configuration options to be applied for the rule. If the
265 # rule does not evaluate reCAPTCHA tokens, this field has no effect.
266 &quot;actionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
267 # action-tokens. The provided site keys need to be created from
268 # reCAPTCHA API under the same project where the security policy is
269 # created.
270 &quot;A String&quot;,
271 ],
272 &quot;sessionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
273 # session-tokens. The provided site keys need to be created from
274 # reCAPTCHA API under the same project where the security policy is
275 # created.
276 &quot;A String&quot;,
277 ],
278 },
279 },
280 &quot;versionedExpr&quot;: &quot;A String&quot;, # Preconfigured versioned expression.
281 # If this field is specified, config must also be specified.
282 # Available preconfigured expressions along with their requirements are:
283 # SRC_IPS_V1 - must specify the corresponding src_ip_range field in
284 # config.
285 },
286 &quot;networkMatch&quot;: { # Represents a match condition that incoming network traffic is evaluated # A match condition that incoming packets are evaluated against for
287 # CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding
288 # &#x27;action&#x27; is enforced.
289 #
290 # The match criteria for a rule consists of built-in match fields (like
291 # &#x27;srcIpRanges&#x27;) and potentially multiple user-defined match fields
292 # (&#x27;userDefinedFields&#x27;).
293 #
294 # Field values may be extracted directly from the packet or derived from it
295 # (e.g. &#x27;srcRegionCodes&#x27;). Some fields may not be present in every packet
296 # (e.g. &#x27;srcPorts&#x27;). A user-defined field is only present if the base
297 # header is found in the packet and the entire field is in bounds.
298 #
299 # Each match field may specify which values can match it, listing one or
300 # more ranges, prefixes, or exact values that are considered a match for
301 # the field. A field value must be present in order to match a specified
302 # match field. If no match values are specified for a match field, then any
303 # field value is considered to match it, and it&#x27;s not required to be
304 # present. For strings specifying &#x27;*&#x27; is also equivalent to match all.
305 #
306 # For a packet to match a rule, all specified match fields must match the
307 # corresponding field values derived from the packet.
308 #
309 # Example:
310 #
311 # networkMatch:
312 # srcIpRanges:
313 # - &quot;192.0.2.0/24&quot;
314 # - &quot;198.51.100.0/24&quot;
315 # userDefinedFields:
316 # - name: &quot;ipv4_fragment_offset&quot;
317 # values:
318 # - &quot;1-0x1fff&quot;
319 #
320 # The above match condition matches packets with a source IP in
321 # 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named
322 # &quot;ipv4_fragment_offset&quot; with a value between 1 and 0x1fff inclusive.
323 # against.
324 &quot;destIpRanges&quot;: [ # Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text
325 # format.
326 &quot;A String&quot;,
327 ],
328 &quot;destPorts&quot;: [ # Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
329 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
330 &quot;A String&quot;,
331 ],
332 &quot;ipProtocols&quot;: [ # IPv4 protocol / IPv6 next header (after extension headers). Each
333 # element can be an 8-bit unsigned decimal number (e.g. &quot;6&quot;), range (e.g.
334 # &quot;253-254&quot;), or one of the following protocol names: &quot;tcp&quot;, &quot;udp&quot;,
335 # &quot;icmp&quot;, &quot;esp&quot;, &quot;ah&quot;, &quot;ipip&quot;, or &quot;sctp&quot;.
336 &quot;A String&quot;,
337 ],
338 &quot;srcAsns&quot;: [ # BGP Autonomous System Number associated with the source IP address.
339 42,
340 ],
341 &quot;srcIpRanges&quot;: [ # Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
342 &quot;A String&quot;,
343 ],
344 &quot;srcPorts&quot;: [ # Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
345 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
346 &quot;A String&quot;,
347 ],
348 &quot;srcRegionCodes&quot;: [ # Two-letter ISO 3166-1 alpha-2 country code associated with the source
349 # IP address.
350 &quot;A String&quot;,
351 ],
352 &quot;userDefinedFields&quot;: [ # User-defined fields. Each element names a defined field and lists the
353 # matching values for that field.
354 {
355 &quot;name&quot;: &quot;A String&quot;, # Name of the user-defined field, as given in the definition.
356 &quot;values&quot;: [ # Matching values of the field. Each element can be a 32-bit unsigned
357 # decimal or hexadecimal (starting with &quot;0x&quot;) number (e.g. &quot;64&quot;) or
358 # range (e.g. &quot;0x400-0x7ff&quot;).
359 &quot;A String&quot;,
360 ],
361 },
362 ],
363 },
364 &quot;preconfiguredWafConfig&quot;: { # Preconfigured WAF configuration to be applied for the rule. If the rule
365 # does not evaluate preconfigured WAF rules, i.e., if
366 # evaluatePreconfiguredWaf() is not used, this field will have no effect.
367 &quot;exclusions&quot;: [ # A list of exclusions to apply during preconfigured WAF evaluation.
368 {
369 &quot;requestBodiesToExclude&quot;: [ # A list of request body fields to be excluded from inspection during
370 # preconfigured WAF evaluation.
371 {
372 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
373 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
374 },
375 ],
376 &quot;requestCookiesToExclude&quot;: [ # A list of request cookie names whose value will be excluded from
377 # inspection during preconfigured WAF evaluation.
378 {
379 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
380 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
381 },
382 ],
383 &quot;requestHeadersToExclude&quot;: [ # A list of request header names whose value will be excluded from
384 # inspection during preconfigured WAF evaluation.
385 {
386 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
387 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
388 },
389 ],
390 &quot;requestQueryParamsToExclude&quot;: [ # A list of request query parameter names whose value will be excluded
391 # from inspection during preconfigured WAF evaluation. Note that the
392 # parameter can be in the query string or in the POST body.
393 {
394 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
395 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
396 },
397 ],
398 &quot;requestUrisToExclude&quot;: [ # A list of request URIs from the request line to be excluded from
399 # inspection during preconfigured WAF evaluation. When specifying this
400 # field, the query or fragment part should be excluded.
401 {
402 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
403 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
404 },
405 ],
406 &quot;targetRuleIds&quot;: [ # A list of target rule IDs under the WAF rule set to apply the
407 # preconfigured WAF exclusion. If omitted, it refers to all the rule
408 # IDs under the WAF rule set.
409 &quot;A String&quot;,
410 ],
411 &quot;targetRuleSet&quot;: &quot;A String&quot;, # Target WAF rule set to apply the preconfigured WAF exclusion.
412 },
413 ],
414 },
415 &quot;preview&quot;: True or False, # If set to true, the specified action is not enforced.
416 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority
417 # must be a positive value between 0 and 2147483647.
418 # Rules are evaluated from highest to lowest priority where 0 is the
419 # highest priority and 2147483647 is the lowest priority.
420 &quot;rateLimitOptions&quot;: { # Must be specified if the action is &quot;rate_based_ban&quot; or &quot;throttle&quot; or
421 # &quot;fairshare&quot;. Cannot be specified for any other actions.
422 &quot;banDurationSec&quot;: 42, # Can only be specified if the action for the rule is
423 # &quot;rate_based_ban&quot;. If specified, determines the time (in seconds)
424 # the traffic will continue to be banned by the rate limit after the
425 # rate falls below the threshold.
426 &quot;banThreshold&quot;: { # Can only be specified if the action for the rule is
427 # &quot;rate_based_ban&quot;. If specified, the key will be banned for the
428 # configured &#x27;ban_duration_sec&#x27; when the number of requests that exceed
429 # the &#x27;rate_limit_threshold&#x27; also exceed this &#x27;ban_threshold&#x27;.
430 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
431 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
432 },
433 &quot;conformAction&quot;: &quot;A String&quot;, # Action to take for requests that are under the configured rate limit
434 # threshold. Valid option is &quot;allow&quot; only.
435 &quot;enforceOnKey&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
436 # values are:
437 #
438 # - ALL: A single rate limit threshold is applied to all
439 # the requests matching this rule. This is the default value if
440 # &quot;enforceOnKey&quot; is not configured.
441 # - IP: The source IP address of
442 # the request is the key. Each IP has this limit enforced
443 # separately.
444 # - HTTP_HEADER: The value of the HTTP
445 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
446 # value is truncated to the first 128 bytes of the header value. If no
447 # such header is present in the request, the key type defaults toALL.
448 # - XFF_IP: The first IP address (i.e. the
449 # originating client IP address) specified in the list of IPs under
450 # X-Forwarded-For HTTP header. If no such header is present or the value
451 # is not a valid IP, the key defaults to the source IP address of
452 # the request i.e. key type IP.
453 # - HTTP_COOKIE: The value of the HTTP
454 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
455 # value is truncated to the first 128 bytes of the cookie value. If no
456 # such cookie is present in the request, the key type defaults toALL.
457 # - HTTP_PATH: The URL path of the HTTP request. The key
458 # value is truncated to the first 128 bytes.
459 # - SNI: Server name indication in the TLS session of the
460 # HTTPS request. The key value is truncated to the first 128 bytes. The
461 # key type defaults to ALL on a HTTP session.
462 # - REGION_CODE: The country/region from which the request
463 # originates.
464 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
465 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
466 # key type defaults to ALL.
467 # - USER_IP: The IP address of the originating client,
468 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
469 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration or
470 # an IP address cannot be resolved from it, the key type defaults toIP.
471 #
472 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
473 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
474 # key type defaults to ALL.
475 # For &quot;fairshare&quot; action, this value is limited to ALL i.e. a single rate
476 # limit threshold is enforced for all the requests matching the rule.
477 &quot;enforceOnKeyConfigs&quot;: [ # If specified, any combination of values of
478 # enforce_on_key_type/enforce_on_key_name is treated as the key on which
479 # ratelimit threshold/action is enforced. You can specify up to 3
480 # enforce_on_key_configs. If enforce_on_key_configs is specified,
481 # enforce_on_key must not be specified.
482 {
483 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
484 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the
485 # key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is
486 # taken as the key value.
487 &quot;enforceOnKeyType&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
488 # values are:
489 #
490 # - ALL: A single rate limit threshold is applied to all
491 # the requests matching this rule. This is the default value if
492 # &quot;enforceOnKeyConfigs&quot; is not configured.
493 # - IP: The source IP address of
494 # the request is the key. Each IP has this limit enforced
495 # separately.
496 # - HTTP_HEADER: The value of the HTTP
497 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
498 # value is truncated to the first 128 bytes of the header value. If no
499 # such header is present in the request, the key type defaults toALL.
500 # - XFF_IP: The first IP address (i.e. the
501 # originating client IP address) specified in the list of IPs under
502 # X-Forwarded-For HTTP header. If no such header is present or the
503 # value is not a valid IP, the key defaults to the source IP address of
504 # the request i.e. key type IP.
505 # - HTTP_COOKIE: The value of the HTTP
506 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
507 # value is truncated to the first 128 bytes of the cookie value. If no
508 # such cookie is present in the request, the key type defaults toALL.
509 # - HTTP_PATH: The URL path of the HTTP request. The key
510 # value is truncated to the first 128 bytes.
511 # - SNI: Server name indication in the TLS session of
512 # the HTTPS request. The key value is truncated to the first 128 bytes.
513 # The key type defaults to ALL on a HTTP session.
514 # - REGION_CODE: The country/region from which the
515 # request originates.
516 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
517 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
518 # key type defaults to ALL.
519 # - USER_IP: The IP address of the originating client,
520 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
521 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration
522 # or an IP address cannot be resolved from it, the key type defaults toIP.
523 #
524 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
525 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
526 # key type defaults to ALL.
527 },
528 ],
529 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
530 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the key
531 # value.
532 # HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key
533 # value.
534 &quot;exceedAction&quot;: &quot;A String&quot;, # Action to take for requests that are above the configured rate limit
535 # threshold, to either deny with a specified HTTP response code, or
536 # redirect to a different endpoint.
537 # Valid options are `deny(STATUS)`, where valid values for
538 # `STATUS` are 403, 404, 429, and 502, and
539 # `redirect`, where the redirect parameters come from
540 # `exceedRedirectOptions` below.
541 # The `redirect` action is only supported in Global Security Policies of
542 # type CLOUD_ARMOR.
543 &quot;exceedRedirectOptions&quot;: { # Parameters defining the redirect action that is used as the exceed
544 # action. Cannot be specified if the exceed action is not redirect.
545 # This field is only supported in Global Security Policies of type
546 # CLOUD_ARMOR.
547 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
548 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
549 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
550 #
551 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
552 # challenge assessment.
553 # - EXTERNAL_302: redirect to a different URL via a 302
554 # response.
555 },
556 &quot;rateLimitThreshold&quot;: { # Threshold at which to begin ratelimiting.
557 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
558 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
559 },
560 },
561 &quot;redirectOptions&quot;: { # Parameters defining the redirect action. Cannot be specified for any
562 # other actions.
563 # This field is only supported in Global Security Policies of type
564 # CLOUD_ARMOR.
565 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
566 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
567 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
568 #
569 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
570 # challenge assessment.
571 # - EXTERNAL_302: redirect to a different URL via a 302
572 # response.
573 },
574 &quot;ruleNumber&quot;: &quot;A String&quot;, # Identifier for the rule. This is only unique within the given security
575 # policy. This can only be set during rule creation, if rule number is not
576 # specified it will be generated by the server.
577 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Calculation of the complexity of a single firewall security
578 # policy rule.
579 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field
580 # allows you to control which network&#x27;s VMs get this rule. If this field
581 # is left blank, all VMs within the organization will receive the rule.
582 #
583 # This field may only be specified when versioned_expr is set to FIREWALL.
584 &quot;A String&quot;,
585 ],
586 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are
587 # applied with this rule.
588 &quot;A String&quot;,
589 ],
590 }
591
592 validateOnly: boolean, If true, the request will not be committed.
593 x__xgafv: string, V1 error format.
594 Allowed values
595 1 - v1 error format
596 2 - v2 error format
597
598 Returns:
599 An object of the form:
600
601 { # Represents an Operation resource.
602 #
603 # Google Compute Engine has three Operation resources:
604 #
605 # * [Global](/compute/docs/reference/rest/beta/globalOperations)
606 # * [Regional](/compute/docs/reference/rest/beta/regionOperations)
607 # * [Zonal](/compute/docs/reference/rest/beta/zoneOperations)
608 #
609 # You can use an operation resource to manage asynchronous API requests.
610 # For more information, readHandling
611 # API responses.
612 #
613 # Operations can be global, regional or zonal.
614 #
615 # - For global operations, use the `globalOperations`
616 # resource.
617 # - For regional operations, use the
618 # `regionOperations` resource.
619 # - For zonal operations, use
620 # the `zoneOperations` resource.
621 #
622 #
623 #
624 # For more information, read
625 # Global, Regional, and Zonal Resources.
626 #
627 # Note that completed Operation resources have a limited
628 # retention period.
629 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request.
630 # Not present otherwise.
631 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
632 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is
633 # set when the operation is created.
634 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is inRFC3339
635 # text format.
636 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation,
637 # this field will be populated.
638 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this
639 # operation.
640 {
641 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
642 &quot;errorDetails&quot;: [ # [Output Only] An optional list of messages that contain the error
643 # details. There is a set of defined message types to use for providing
644 # details.The syntax depends on the error code. For example,
645 # QuotaExceededInfo will have details when the error code is
646 # QUOTA_EXCEEDED.
647 {
648 &quot;errorInfo&quot;: { # Describes the cause of the error with structured details.
649 #
650 # Example of an error when contacting the &quot;pubsub.googleapis.com&quot; API when it
651 # is not enabled:
652 #
653 # { &quot;reason&quot;: &quot;API_DISABLED&quot;
654 # &quot;domain&quot;: &quot;googleapis.com&quot;
655 # &quot;metadata&quot;: {
656 # &quot;resource&quot;: &quot;projects/123&quot;,
657 # &quot;service&quot;: &quot;pubsub.googleapis.com&quot;
658 # }
659 # }
660 #
661 # This response indicates that the pubsub.googleapis.com API is not enabled.
662 #
663 # Example of an error that is returned when attempting to create a Spanner
664 # instance in a region that is out of stock:
665 #
666 # { &quot;reason&quot;: &quot;STOCKOUT&quot;
667 # &quot;domain&quot;: &quot;spanner.googleapis.com&quot;,
668 # &quot;metadata&quot;: {
669 # &quot;availableRegions&quot;: &quot;us-central1,us-east2&quot;
670 # }
671 # }
672 &quot;domain&quot;: &quot;A String&quot;, # The logical grouping to which the &quot;reason&quot; belongs. The error domain
673 # is typically the registered service name of the tool or product that
674 # generates the error. Example: &quot;pubsub.googleapis.com&quot;. If the error is
675 # generated by some common infrastructure, the error domain must be a
676 # globally unique value that identifies the infrastructure. For Google API
677 # infrastructure, the error domain is &quot;googleapis.com&quot;.
678 &quot;metadatas&quot;: { # Additional structured details about this error.
679 #
680 # Keys must match a regular expression of `a-z+` but should
681 # ideally be lowerCamelCase. Also, they must be limited to 64 characters in
682 # length. When identifying the current value of an exceeded limit, the units
683 # should be contained in the key, not the value. For example, rather than
684 # `{&quot;instanceLimit&quot;: &quot;100/request&quot;}`, should be returned as,
685 # `{&quot;instanceLimitPerRequest&quot;: &quot;100&quot;}`, if the client exceeds the number of
686 # instances that can be created in a single (batch) request.
687 &quot;a_key&quot;: &quot;A String&quot;,
688 },
689 &quot;reason&quot;: &quot;A String&quot;, # The reason of the error. This is a constant value that identifies the
690 # proximate cause of the error. Error reasons are unique within a particular
691 # domain of errors. This should be at most 63 characters and match a
692 # regular expression of `A-Z+[A-Z0-9]`, which represents
693 # UPPER_SNAKE_CASE.
694 },
695 &quot;help&quot;: { # Provides links to documentation or for performing an out of band action.
696 #
697 # For example, if a quota check failed with an error indicating the calling
698 # project hasn&#x27;t enabled the accessed service, this can contain a URL pointing
699 # directly to the right place in the developer console to flip the bit.
700 &quot;links&quot;: [ # URL(s) pointing to additional information on handling the current error.
701 { # Describes a URL link.
702 &quot;description&quot;: &quot;A String&quot;, # Describes what the link offers.
703 &quot;url&quot;: &quot;A String&quot;, # The URL of the link.
704 },
705 ],
706 },
707 &quot;localizedMessage&quot;: { # Provides a localized error message that is safe to return to the user
708 # which can be attached to an RPC error.
709 &quot;locale&quot;: &quot;A String&quot;, # The locale used following the specification defined at
710 # https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
711 # Examples are: &quot;en-US&quot;, &quot;fr-CH&quot;, &quot;es-MX&quot;
712 &quot;message&quot;: &quot;A String&quot;, # The localized error message in the above locale.
713 },
714 &quot;quotaInfo&quot;: { # Additional details for quota exceeded error for resource quota.
715 &quot;dimensions&quot;: { # The map holding related quota dimensions.
716 &quot;a_key&quot;: &quot;A String&quot;,
717 },
718 &quot;futureLimit&quot;: 3.14, # Future quota limit being rolled out. The limit&#x27;s unit depends on the quota
719 # type or metric.
720 &quot;limit&quot;: 3.14, # Current effective quota limit. The limit&#x27;s unit depends on the quota type
721 # or metric.
722 &quot;limitName&quot;: &quot;A String&quot;, # The name of the quota limit.
723 &quot;metricName&quot;: &quot;A String&quot;, # The Compute Engine quota metric name.
724 &quot;rolloutStatus&quot;: &quot;A String&quot;, # Rollout status of the future quota limit.
725 },
726 },
727 ],
728 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error.
729 # This property is optional.
730 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
731 },
732 ],
733 },
734 &quot;getVersionOperationMetadata&quot;: {
735 &quot;inlineSbomInfo&quot;: {
736 &quot;currentComponentVersions&quot;: { # A mapping of components to their currently-applied versions or other
737 # appropriate identifiers.
738 &quot;a_key&quot;: &quot;A String&quot;,
739 },
740 &quot;targetComponentVersions&quot;: { # A mapping of components to their target versions or other appropriate
741 # identifiers.
742 &quot;a_key&quot;: &quot;A String&quot;,
743 },
744 },
745 },
746 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error
747 # message that was returned, such as `NOT FOUND`.
748 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error
749 # status code that was returned. For example, a `404` means the
750 # resource was not found.
751 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is
752 # defined by the server.
753 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested.
754 # This value is inRFC3339
755 # text format.
756 &quot;instancesBulkInsertOperationMetadata&quot;: {
757 &quot;perLocationStatus&quot;: { # Status information per location (location name is key).
758 # Example key: zones/us-central1-a
759 &quot;a_key&quot;: {
760 &quot;createdVmCount&quot;: 42, # [Output Only] Count of VMs successfully created so far.
761 &quot;deletedVmCount&quot;: 42, # [Output Only] Count of VMs that got deleted during rollback.
762 &quot;failedToCreateVmCount&quot;: 42, # [Output Only] Count of VMs that started creating but encountered an
763 # error.
764 &quot;status&quot;: &quot;A String&quot;, # [Output Only] Creation status of BulkInsert operation - information
765 # if the flow is rolling forward or rolling back.
766 &quot;targetVmCount&quot;: 42, # [Output Only] Count of VMs originally planned to be created.
767 },
768 },
769 },
770 &quot;kind&quot;: &quot;compute#operation&quot;, # Output only. [Output Only] Type of the resource. Always `compute#operation` for
771 # Operation resources.
772 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
773 &quot;operationGroupId&quot;: &quot;A String&quot;, # Output only. [Output Only] An ID that represents a group of operations, such as when a
774 # group of operations results from a `bulkInsert` API request.
775 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`,
776 # `update`, or `delete`, and so on.
777 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100.
778 # There is no requirement that this be linear or support any granularity of
779 # operations. This should not be used to guess when the operation will be
780 # complete. This number should monotonically increase as the operation
781 # progresses.
782 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only
783 # applicable when performing regional operations.
784 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
785 &quot;setCommonInstanceMetadataOperationMetadata&quot;: { # Output only. [Output Only] If the operation is for projects.setCommonInstanceMetadata,
786 # this field will contain information on all underlying zonal actions and
787 # their state.
788 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The client operation id.
789 &quot;perLocationOperations&quot;: { # [Output Only] Status information per location (location name is key).
790 # Example key: zones/us-central1-a
791 &quot;a_key&quot;: {
792 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is
793 # populated.
794 # different programming environments, including REST APIs and RPC APIs. It is
795 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
796 # three pieces of data: error code, error message, and error details.
797 #
798 # You can find out more about this error model and how to work with it in the
799 # [API Design Guide](https://cloud.google.com/apis/design/errors).
800 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
801 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
802 # message types for APIs to use.
803 {
804 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
805 },
806 ],
807 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
808 # user-facing error message should be localized and sent in the
809 # google.rpc.Status.details field, or localized by the client.
810 },
811 &quot;state&quot;: &quot;A String&quot;, # [Output Only] Status of the action, which can be one of the following:
812 # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`.
813 },
814 },
815 },
816 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server.
817 # This value is inRFC3339
818 # text format.
819 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the
820 # following:
821 # `PENDING`, `RUNNING`, or `DONE`.
822 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the
823 # operation.
824 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation
825 # of the target resource.
826 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For
827 # operations related to creating a snapshot, this points to the disk
828 # that the snapshot was created from.
829 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example:
830 # `[email protected]` or
831 # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`.
832 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the
833 # operation, this field will be populated.
834 {
835 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute
836 # Engine returns NO_RESULTS_ON_PAGE if there
837 # are no results in the response.
838 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key:
839 # value format. For example:
840 #
841 # &quot;data&quot;: [
842 # {
843 # &quot;key&quot;: &quot;scope&quot;,
844 # &quot;value&quot;: &quot;zones/us-east1-d&quot;
845 # }
846 {
847 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being
848 # returned. For example, for warnings where there are no results in a list
849 # request for a particular zone, this key might be scope and
850 # the key value might be the zone name. Other examples might be a key
851 # indicating a deprecated resource and a suggested replacement, or a
852 # warning about invalid network settings (for example, if an instance
853 # attempts to perform IP forwarding but is not enabled for IP forwarding).
854 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
855 },
856 ],
857 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
858 },
859 ],
860 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only
861 # applicable when performing per-zone operations.
862 }</pre>
863 </div>
864
865 <div class="method">
866 <code class="details" id="close">close()</code>
867 <pre>Close httplib2 connections.</pre>
868 </div>
869
870 <div class="method">
871 <code class="details" id="delete">delete(project, region, securityPolicy, requestId=None, x__xgafv=None)</code>
872 <pre>Deletes the specified policy.
873
874 Args:
875 project: string, Project ID for this request. (required)
876 region: string, Name of the region scoping this request. (required)
877 securityPolicy: string, Name of the security policy to delete. (required)
878 requestId: string, An optional request ID to identify requests. Specify a unique request ID so
879 that if you must retry your request, the server will know to ignore the
880 request if it has already been completed.
881
882 For example, consider a situation where you make an initial request and
883 the request times out. If you make the request again with the same
884 request ID, the server can check if original operation with the same
885 request ID was received, and if so, will ignore the second request. This
886 prevents clients from accidentally creating duplicate commitments.
887
888 The request ID must be
889 a valid UUID with the exception that zero UUID is not supported
890 (00000000-0000-0000-0000-000000000000).
891 x__xgafv: string, V1 error format.
892 Allowed values
893 1 - v1 error format
894 2 - v2 error format
895
896 Returns:
897 An object of the form:
898
899 { # Represents an Operation resource.
900 #
901 # Google Compute Engine has three Operation resources:
902 #
903 # * [Global](/compute/docs/reference/rest/beta/globalOperations)
904 # * [Regional](/compute/docs/reference/rest/beta/regionOperations)
905 # * [Zonal](/compute/docs/reference/rest/beta/zoneOperations)
906 #
907 # You can use an operation resource to manage asynchronous API requests.
908 # For more information, readHandling
909 # API responses.
910 #
911 # Operations can be global, regional or zonal.
912 #
913 # - For global operations, use the `globalOperations`
914 # resource.
915 # - For regional operations, use the
916 # `regionOperations` resource.
917 # - For zonal operations, use
918 # the `zoneOperations` resource.
919 #
920 #
921 #
922 # For more information, read
923 # Global, Regional, and Zonal Resources.
924 #
925 # Note that completed Operation resources have a limited
926 # retention period.
927 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request.
928 # Not present otherwise.
929 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
930 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is
931 # set when the operation is created.
932 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is inRFC3339
933 # text format.
934 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation,
935 # this field will be populated.
936 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this
937 # operation.
938 {
939 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
940 &quot;errorDetails&quot;: [ # [Output Only] An optional list of messages that contain the error
941 # details. There is a set of defined message types to use for providing
942 # details.The syntax depends on the error code. For example,
943 # QuotaExceededInfo will have details when the error code is
944 # QUOTA_EXCEEDED.
945 {
946 &quot;errorInfo&quot;: { # Describes the cause of the error with structured details.
947 #
948 # Example of an error when contacting the &quot;pubsub.googleapis.com&quot; API when it
949 # is not enabled:
950 #
951 # { &quot;reason&quot;: &quot;API_DISABLED&quot;
952 # &quot;domain&quot;: &quot;googleapis.com&quot;
953 # &quot;metadata&quot;: {
954 # &quot;resource&quot;: &quot;projects/123&quot;,
955 # &quot;service&quot;: &quot;pubsub.googleapis.com&quot;
956 # }
957 # }
958 #
959 # This response indicates that the pubsub.googleapis.com API is not enabled.
960 #
961 # Example of an error that is returned when attempting to create a Spanner
962 # instance in a region that is out of stock:
963 #
964 # { &quot;reason&quot;: &quot;STOCKOUT&quot;
965 # &quot;domain&quot;: &quot;spanner.googleapis.com&quot;,
966 # &quot;metadata&quot;: {
967 # &quot;availableRegions&quot;: &quot;us-central1,us-east2&quot;
968 # }
969 # }
970 &quot;domain&quot;: &quot;A String&quot;, # The logical grouping to which the &quot;reason&quot; belongs. The error domain
971 # is typically the registered service name of the tool or product that
972 # generates the error. Example: &quot;pubsub.googleapis.com&quot;. If the error is
973 # generated by some common infrastructure, the error domain must be a
974 # globally unique value that identifies the infrastructure. For Google API
975 # infrastructure, the error domain is &quot;googleapis.com&quot;.
976 &quot;metadatas&quot;: { # Additional structured details about this error.
977 #
978 # Keys must match a regular expression of `a-z+` but should
979 # ideally be lowerCamelCase. Also, they must be limited to 64 characters in
980 # length. When identifying the current value of an exceeded limit, the units
981 # should be contained in the key, not the value. For example, rather than
982 # `{&quot;instanceLimit&quot;: &quot;100/request&quot;}`, should be returned as,
983 # `{&quot;instanceLimitPerRequest&quot;: &quot;100&quot;}`, if the client exceeds the number of
984 # instances that can be created in a single (batch) request.
985 &quot;a_key&quot;: &quot;A String&quot;,
986 },
987 &quot;reason&quot;: &quot;A String&quot;, # The reason of the error. This is a constant value that identifies the
988 # proximate cause of the error. Error reasons are unique within a particular
989 # domain of errors. This should be at most 63 characters and match a
990 # regular expression of `A-Z+[A-Z0-9]`, which represents
991 # UPPER_SNAKE_CASE.
992 },
993 &quot;help&quot;: { # Provides links to documentation or for performing an out of band action.
994 #
995 # For example, if a quota check failed with an error indicating the calling
996 # project hasn&#x27;t enabled the accessed service, this can contain a URL pointing
997 # directly to the right place in the developer console to flip the bit.
998 &quot;links&quot;: [ # URL(s) pointing to additional information on handling the current error.
999 { # Describes a URL link.
1000 &quot;description&quot;: &quot;A String&quot;, # Describes what the link offers.
1001 &quot;url&quot;: &quot;A String&quot;, # The URL of the link.
1002 },
1003 ],
1004 },
1005 &quot;localizedMessage&quot;: { # Provides a localized error message that is safe to return to the user
1006 # which can be attached to an RPC error.
1007 &quot;locale&quot;: &quot;A String&quot;, # The locale used following the specification defined at
1008 # https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
1009 # Examples are: &quot;en-US&quot;, &quot;fr-CH&quot;, &quot;es-MX&quot;
1010 &quot;message&quot;: &quot;A String&quot;, # The localized error message in the above locale.
1011 },
1012 &quot;quotaInfo&quot;: { # Additional details for quota exceeded error for resource quota.
1013 &quot;dimensions&quot;: { # The map holding related quota dimensions.
1014 &quot;a_key&quot;: &quot;A String&quot;,
1015 },
1016 &quot;futureLimit&quot;: 3.14, # Future quota limit being rolled out. The limit&#x27;s unit depends on the quota
1017 # type or metric.
1018 &quot;limit&quot;: 3.14, # Current effective quota limit. The limit&#x27;s unit depends on the quota type
1019 # or metric.
1020 &quot;limitName&quot;: &quot;A String&quot;, # The name of the quota limit.
1021 &quot;metricName&quot;: &quot;A String&quot;, # The Compute Engine quota metric name.
1022 &quot;rolloutStatus&quot;: &quot;A String&quot;, # Rollout status of the future quota limit.
1023 },
1024 },
1025 ],
1026 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error.
1027 # This property is optional.
1028 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
1029 },
1030 ],
1031 },
1032 &quot;getVersionOperationMetadata&quot;: {
1033 &quot;inlineSbomInfo&quot;: {
1034 &quot;currentComponentVersions&quot;: { # A mapping of components to their currently-applied versions or other
1035 # appropriate identifiers.
1036 &quot;a_key&quot;: &quot;A String&quot;,
1037 },
1038 &quot;targetComponentVersions&quot;: { # A mapping of components to their target versions or other appropriate
1039 # identifiers.
1040 &quot;a_key&quot;: &quot;A String&quot;,
1041 },
1042 },
1043 },
1044 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error
1045 # message that was returned, such as `NOT FOUND`.
1046 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error
1047 # status code that was returned. For example, a `404` means the
1048 # resource was not found.
1049 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is
1050 # defined by the server.
1051 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested.
1052 # This value is inRFC3339
1053 # text format.
1054 &quot;instancesBulkInsertOperationMetadata&quot;: {
1055 &quot;perLocationStatus&quot;: { # Status information per location (location name is key).
1056 # Example key: zones/us-central1-a
1057 &quot;a_key&quot;: {
1058 &quot;createdVmCount&quot;: 42, # [Output Only] Count of VMs successfully created so far.
1059 &quot;deletedVmCount&quot;: 42, # [Output Only] Count of VMs that got deleted during rollback.
1060 &quot;failedToCreateVmCount&quot;: 42, # [Output Only] Count of VMs that started creating but encountered an
1061 # error.
1062 &quot;status&quot;: &quot;A String&quot;, # [Output Only] Creation status of BulkInsert operation - information
1063 # if the flow is rolling forward or rolling back.
1064 &quot;targetVmCount&quot;: 42, # [Output Only] Count of VMs originally planned to be created.
1065 },
1066 },
1067 },
1068 &quot;kind&quot;: &quot;compute#operation&quot;, # Output only. [Output Only] Type of the resource. Always `compute#operation` for
1069 # Operation resources.
1070 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
1071 &quot;operationGroupId&quot;: &quot;A String&quot;, # Output only. [Output Only] An ID that represents a group of operations, such as when a
1072 # group of operations results from a `bulkInsert` API request.
1073 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`,
1074 # `update`, or `delete`, and so on.
1075 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100.
1076 # There is no requirement that this be linear or support any granularity of
1077 # operations. This should not be used to guess when the operation will be
1078 # complete. This number should monotonically increase as the operation
1079 # progresses.
1080 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only
1081 # applicable when performing regional operations.
1082 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
1083 &quot;setCommonInstanceMetadataOperationMetadata&quot;: { # Output only. [Output Only] If the operation is for projects.setCommonInstanceMetadata,
1084 # this field will contain information on all underlying zonal actions and
1085 # their state.
1086 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The client operation id.
1087 &quot;perLocationOperations&quot;: { # [Output Only] Status information per location (location name is key).
1088 # Example key: zones/us-central1-a
1089 &quot;a_key&quot;: {
1090 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is
1091 # populated.
1092 # different programming environments, including REST APIs and RPC APIs. It is
1093 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1094 # three pieces of data: error code, error message, and error details.
1095 #
1096 # You can find out more about this error model and how to work with it in the
1097 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1098 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1099 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1100 # message types for APIs to use.
1101 {
1102 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1103 },
1104 ],
1105 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1106 # user-facing error message should be localized and sent in the
1107 # google.rpc.Status.details field, or localized by the client.
1108 },
1109 &quot;state&quot;: &quot;A String&quot;, # [Output Only] Status of the action, which can be one of the following:
1110 # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`.
1111 },
1112 },
1113 },
1114 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server.
1115 # This value is inRFC3339
1116 # text format.
1117 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the
1118 # following:
1119 # `PENDING`, `RUNNING`, or `DONE`.
1120 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the
1121 # operation.
1122 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation
1123 # of the target resource.
1124 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For
1125 # operations related to creating a snapshot, this points to the disk
1126 # that the snapshot was created from.
1127 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example:
1128 # `[email protected]` or
1129 # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`.
1130 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the
1131 # operation, this field will be populated.
1132 {
1133 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute
1134 # Engine returns NO_RESULTS_ON_PAGE if there
1135 # are no results in the response.
1136 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key:
1137 # value format. For example:
1138 #
1139 # &quot;data&quot;: [
1140 # {
1141 # &quot;key&quot;: &quot;scope&quot;,
1142 # &quot;value&quot;: &quot;zones/us-east1-d&quot;
1143 # }
1144 {
1145 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being
1146 # returned. For example, for warnings where there are no results in a list
1147 # request for a particular zone, this key might be scope and
1148 # the key value might be the zone name. Other examples might be a key
1149 # indicating a deprecated resource and a suggested replacement, or a
1150 # warning about invalid network settings (for example, if an instance
1151 # attempts to perform IP forwarding but is not enabled for IP forwarding).
1152 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
1153 },
1154 ],
1155 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
1156 },
1157 ],
1158 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only
1159 # applicable when performing per-zone operations.
1160 }</pre>
1161 </div>
1162
1163 <div class="method">
1164 <code class="details" id="get">get(project, region, securityPolicy, x__xgafv=None)</code>
1165 <pre>List all of the ordered rules present in a single specified policy.
1166
1167 Args:
1168 project: string, Project ID for this request. (required)
1169 region: string, Name of the region scoping this request. (required)
1170 securityPolicy: string, Name of the security policy to get. (required)
1171 x__xgafv: string, V1 error format.
1172 Allowed values
1173 1 - v1 error format
1174 2 - v2 error format
1175
1176 Returns:
1177 An object of the form:
1178
1179 { # Represents a Google Cloud Armor security policy resource.
1180 #
1181 # Only external backend services that use load balancers can
1182 # reference a security policy. For more information, see
1183 # Google Cloud Armor security policy overview.
1184 &quot;adaptiveProtectionConfig&quot;: { # Configuration options for Cloud Armor Adaptive Protection (CAAP).
1185 &quot;autoDeployConfig&quot;: { # Configuration options for Adaptive Protection auto-deploy feature.
1186 &quot;confidenceThreshold&quot;: 3.14,
1187 &quot;expirationSec&quot;: 42,
1188 &quot;impactedBaselineThreshold&quot;: 3.14,
1189 &quot;loadThreshold&quot;: 3.14,
1190 },
1191 &quot;layer7DdosDefenseConfig&quot;: { # Configuration options for L7 DDoS detection. # If set to true, enables Cloud Armor Machine Learning.
1192 # This field is only supported in Global Security Policies of type
1193 # CLOUD_ARMOR.
1194 &quot;enable&quot;: True or False, # If set to true, enables CAAP for L7 DDoS detection.
1195 # This field is only supported in Global Security Policies of type
1196 # CLOUD_ARMOR.
1197 &quot;ruleVisibility&quot;: &quot;A String&quot;, # Rule visibility can be one of the following:
1198 # STANDARD - opaque rules. (default)
1199 # PREMIUM - transparent rules.
1200 # This field is only supported in Global Security Policies of type
1201 # CLOUD_ARMOR.
1202 &quot;thresholdConfigs&quot;: [ # Configuration options for layer7 adaptive protection for various
1203 # customizable thresholds.
1204 {
1205 &quot;autoDeployConfidenceThreshold&quot;: 3.14,
1206 &quot;autoDeployExpirationSec&quot;: 42,
1207 &quot;autoDeployImpactedBaselineThreshold&quot;: 3.14,
1208 &quot;autoDeployLoadThreshold&quot;: 3.14,
1209 &quot;detectionAbsoluteQps&quot;: 3.14,
1210 &quot;detectionLoadThreshold&quot;: 3.14,
1211 &quot;detectionRelativeToBaselineQps&quot;: 3.14,
1212 &quot;name&quot;: &quot;A String&quot;, # The name must be 1-63 characters long, and comply withRFC1035.
1213 # The name must be unique within the security policy.
1214 &quot;trafficGranularityConfigs&quot;: [ # Configuration options for enabling Adaptive Protection to operate
1215 # on specified granular traffic units.
1216 { # Configurations to specifc granular traffic units processed by
1217 # Adaptive Protection.
1218 &quot;enableEachUniqueValue&quot;: True or False, # If enabled, traffic matching each unique value for the specified
1219 # type constitutes a separate traffic unit.
1220 # It can only be set to true if `value` is empty.
1221 &quot;type&quot;: &quot;A String&quot;, # Type of this configuration.
1222 &quot;value&quot;: &quot;A String&quot;, # Requests that match this value constitute a granular traffic unit.
1223 },
1224 ],
1225 },
1226 ],
1227 },
1228 },
1229 &quot;advancedOptionsConfig&quot;: {
1230 &quot;jsonCustomConfig&quot;: { # Custom configuration to apply the JSON parsing. Only applicable when
1231 # json_parsing is set to STANDARD.
1232 &quot;contentTypes&quot;: [ # A list of custom Content-Type header values to apply the JSON parsing.
1233 #
1234 # As per RFC 1341, a Content-Type header value has the following format:
1235 #
1236 # Content-Type := type &quot;/&quot; subtype *[&quot;;&quot; parameter]
1237 #
1238 # When configuring a custom Content-Type header value, only the
1239 # type/subtype needs to be specified, and the parameters should be
1240 # excluded.
1241 &quot;A String&quot;,
1242 ],
1243 },
1244 &quot;jsonParsing&quot;: &quot;A String&quot;,
1245 &quot;logLevel&quot;: &quot;A String&quot;,
1246 &quot;requestBodyInspectionSize&quot;: &quot;A String&quot;, # The maximum request size chosen by the customer with Waf enabled.
1247 # Values supported are &quot;8KB&quot;, &quot;16KB, &quot;32KB&quot;, &quot;48KB&quot; and &quot;64KB&quot;.
1248 # Values are case insensitive.
1249 &quot;userIpRequestHeaders&quot;: [ # An optional list of case-insensitive request header names to use for
1250 # resolving the callers client IP address.
1251 &quot;A String&quot;,
1252 ],
1253 },
1254 &quot;associations&quot;: [ # A list of associations that belong to this policy.
1255 {
1256 &quot;attachmentId&quot;: &quot;A String&quot;, # The resource that the security policy is attached to.
1257 &quot;displayName&quot;: &quot;A String&quot;, # Output only. [Output Only] The display name of the security policy of the association.
1258 &quot;excludedFolders&quot;: [ # A list of folders to exclude from the security policy.
1259 &quot;A String&quot;,
1260 ],
1261 &quot;excludedProjects&quot;: [ # A list of projects to exclude from the security policy.
1262 &quot;A String&quot;,
1263 ],
1264 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
1265 &quot;securityPolicyId&quot;: &quot;A String&quot;, # Output only. [Output Only] The security policy ID of the association.
1266 &quot;shortName&quot;: &quot;A String&quot;, # Output only. [Output Only] The short name of the security policy of the association.
1267 },
1268 ],
1269 &quot;creationTimestamp&quot;: &quot;A String&quot;, # Output only. [Output Only] Creation timestamp inRFC3339
1270 # text format.
1271 &quot;ddosProtectionConfig&quot;: {
1272 &quot;ddosAdaptiveProtection&quot;: &quot;A String&quot;,
1273 &quot;ddosImpactedBaselineThreshold&quot;: 3.14, # DDoS Protection for Network Load Balancers (and VMs with public IPs)
1274 # builds DDoS mitigations that minimize collateral damage. It quantifies
1275 # this as the fraction of a non-abuse baseline that&#x27;s inadvertently
1276 # blocked.
1277 #
1278 # Rules whose collateral damage exceeds ddosImpactedBaselineThreshold will
1279 # not be deployed. Using a lower value will prioritize keeping collateral
1280 # damage low, possibly at the cost of its effectiveness in rate limiting
1281 # some or all of the attack. It should typically be unset, so Advanced DDoS
1282 # (and Adaptive Protection) uses the best mitigation it can find. Setting
1283 # the threshold is advised if there are logs for false positive detections
1284 # with high collateral damage, and will cause Advanced DDoS to attempt to
1285 # find a less aggressive rule that satisfies the constraint. If a suitable
1286 # rule cannot be found, the system falls back to either no mitigation for
1287 # smaller attacks or broader network throttles for larger ones.
1288 &quot;ddosProtection&quot;: &quot;A String&quot;,
1289 },
1290 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
1291 # create the resource.
1292 &quot;displayName&quot;: &quot;A String&quot;, # User-provided name of the organization security policy. The name should be
1293 # unique in the organization in which the security policy is created. This
1294 # should only be used when SecurityPolicyType is FIREWALL.
1295 # The name must be 1-63 characters long, and comply with
1296 # https://www.ietf.org/rfc/rfc1035.txt. Specifically, the name must be 1-63
1297 # characters long and match the regular expression
1298 # `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a
1299 # lowercase letter, and all following characters must be a dash, lowercase
1300 # letter, or digit, except the last character, which cannot be a dash.
1301 &quot;fingerprint&quot;: &quot;A String&quot;, # Specifies a fingerprint for this resource, which is essentially a hash of
1302 # the metadata&#x27;s contents and used for optimistic locking. The
1303 # fingerprint is initially generated by Compute Engine and changes after
1304 # every request to modify or update metadata. You must always provide an
1305 # up-to-date fingerprint hash in order to update or change metadata,
1306 # otherwise the request will fail with error412 conditionNotMet.
1307 #
1308 # To see the latest fingerprint, make get() request to the
1309 # security policy.
1310 &quot;id&quot;: &quot;A String&quot;, # Output only. [Output Only] The unique identifier for the resource. This identifier is
1311 # defined by the server.
1312 &quot;kind&quot;: &quot;compute#securityPolicy&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyfor security policies
1313 &quot;labelFingerprint&quot;: &quot;A String&quot;, # A fingerprint for the labels being applied to this security policy, which
1314 # is essentially a hash of the labels set used for optimistic locking. The
1315 # fingerprint is initially generated by Compute Engine and changes after
1316 # every request to modify or update labels. You must always provide an
1317 # up-to-date fingerprint hash in order to update or change labels.
1318 #
1319 # To see the latest fingerprint, make get() request to the
1320 # security policy.
1321 &quot;labels&quot;: { # Labels for this resource. These can only be added or modified by thesetLabels method. Each label key/value pair must comply withRFC1035.
1322 # Label values may be empty.
1323 &quot;a_key&quot;: &quot;A String&quot;,
1324 },
1325 &quot;name&quot;: &quot;A String&quot;, # Name of the resource. Provided by the client when the resource is created.
1326 # The name must be 1-63 characters long, and comply withRFC1035.
1327 # Specifically, the name must be 1-63 characters long and match the regular
1328 # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
1329 # character must be a lowercase letter, and all following characters must
1330 # be a dash, lowercase letter, or digit, except the last character, which
1331 # cannot be a dash.
1332 &quot;parent&quot;: &quot;A String&quot;, # Output only. [Output Only] The parent of the security policy.
1333 &quot;recaptchaOptionsConfig&quot;: {
1334 &quot;redirectSiteKey&quot;: &quot;A String&quot;, # An optional field to supply a reCAPTCHA site key to be used for all the
1335 # rules using the redirect action with the type of GOOGLE_RECAPTCHA under
1336 # the security policy. The specified site key needs to be created from the
1337 # reCAPTCHA API. The user is responsible for the validity of the specified
1338 # site key. If not specified, a Google-managed site key is used.
1339 # This field is only supported in Global Security Policies of type
1340 # CLOUD_ARMOR.
1341 },
1342 &quot;region&quot;: &quot;A String&quot;, # Output only. [Output Only] URL of the region where the regional security policy
1343 # resides. This field is not applicable to global security policies.
1344 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Total count of all security policy rule tuples. A security
1345 # policy can not exceed a set number of tuples.
1346 &quot;rules&quot;: [ # A list of rules that belong to this policy.
1347 # There must always be a default rule which is a rule with priority
1348 # 2147483647 and match all condition (for the match condition this means
1349 # match &quot;*&quot; for srcIpRanges and for the networkMatch condition every field
1350 # must be either match &quot;*&quot; or not set). If no rules are provided when
1351 # creating a security policy, a default rule with action &quot;allow&quot; will be
1352 # added.
1353 { # Represents a rule that describes one or more match conditions along with
1354 # the action to be taken when traffic matches this condition (allow or deny).
1355 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the rule is matched.
1356 # The following are the valid actions:
1357 #
1358 # - allow: allow access to target.
1359 # - deny(STATUS): deny access to target, returns the
1360 # HTTP response code specified. Valid values for `STATUS`
1361 # are 403, 404, and 502.
1362 # - rate_based_ban: limit client traffic to the configured
1363 # threshold and ban the client if the traffic exceeds the threshold.
1364 # Configure parameters for this action in RateLimitOptions. Requires
1365 # rate_limit_options to be set.
1366 # - redirect: redirect to a different target. This can
1367 # either be an internal reCAPTCHA redirect, or an external URL-based
1368 # redirect via a 302 response. Parameters for this action can be configured
1369 # via redirectOptions. This action is only supported in Global Security
1370 # Policies of type CLOUD_ARMOR.
1371 # - throttle: limit
1372 # client traffic to the configured threshold. Configure parameters for this
1373 # action in rateLimitOptions. Requires rate_limit_options to be set for
1374 # this.
1375 # - fairshare (preview only): when traffic reaches the
1376 # threshold limit, requests from the clients matching this rule begin to be
1377 # rate-limited using the Fair Share algorithm. This action is only allowed
1378 # in security policies of type `CLOUD_ARMOR_INTERNAL_SERVICE`.
1379 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
1380 # create the resource.
1381 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies. This field may only be
1382 # specified when versioned_expr is set to FIREWALL.
1383 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is
1384 # enabled, logs will be exported to the configured export destination in
1385 # Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you
1386 # cannot enable logging on &quot;goto_next&quot; rules.
1387 #
1388 # This field may only be specified when the versioned_expr is set to
1389 # FIREWALL.
1390 &quot;headerAction&quot;: { # Optional, additional actions that are performed on headers.
1391 # This field is only supported in Global Security Policies of type
1392 # CLOUD_ARMOR.
1393 &quot;requestHeadersToAdds&quot;: [ # The list of request headers to add or overwrite if they&#x27;re already
1394 # present.
1395 {
1396 &quot;headerName&quot;: &quot;A String&quot;, # The name of the header to set.
1397 &quot;headerValue&quot;: &quot;A String&quot;, # The value to set the named header to.
1398 },
1399 ],
1400 },
1401 &quot;kind&quot;: &quot;compute#securityPolicyRule&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyRule for security policy rules
1402 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. # A match condition that incoming traffic is evaluated against.
1403 # If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
1404 # Exactly one field must be specified.
1405 &quot;config&quot;: { # The configuration options available when specifying versioned_expr.
1406 # This field must be specified if versioned_expr is specified and cannot
1407 # be specified if versioned_expr is not specified.
1408 &quot;destIpRanges&quot;: [ # CIDR IP address range.
1409 #
1410 # This field may only be specified when versioned_expr is set to
1411 # FIREWALL.
1412 &quot;A String&quot;,
1413 ],
1414 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
1415 #
1416 # This field may only be specified when versioned_expr is set to
1417 # FIREWALL.
1418 {
1419 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is
1420 # required when creating a firewall rule. This value can either be
1421 # one of the following well known protocol strings (tcp,udp, icmp, esp,ah, ipip, sctp), or the IP
1422 # protocol number.
1423 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is
1424 # only applicable for UDP or TCP protocol. Each entry must be either
1425 # an integer or a range. If not specified, this rule applies to
1426 # connections through any port.
1427 #
1428 # Example inputs include: [&quot;22&quot;],[&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
1429 #
1430 # This field may only be specified when versioned_expr is set to
1431 # FIREWALL.
1432 &quot;A String&quot;,
1433 ],
1434 },
1435 ],
1436 &quot;srcIpRanges&quot;: [ # CIDR IP address range.
1437 # Maximum number of src_ip_ranges allowed is 10.
1438 &quot;A String&quot;,
1439 ],
1440 },
1441 &quot;expr&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # User defined CEVAL expression.
1442 # A CEVAL expression is used to specify match criteria such as origin.ip,
1443 # source.region_code and contents in the request header.
1444 # Expressions containing `evaluateThreatIntelligence` require a Cloud
1445 # Armor Enterprise subscription and are not supported in Edge Policies
1446 # nor in Regional Policies. Expressions containing
1447 # `evaluatePreconfiguredExpr(&#x27;sourceiplist-*&#x27;)` require a Cloud Armor
1448 # Enterprise subscription and are only supported in Global Security
1449 # Policies.
1450 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
1451 # are documented at https://github.com/google/cel-spec.
1452 #
1453 # Example (Comparison):
1454 #
1455 # title: &quot;Summary size limit&quot;
1456 # description: &quot;Determines if a summary is less than 100 chars&quot;
1457 # expression: &quot;document.summary.size() &lt; 100&quot;
1458 #
1459 # Example (Equality):
1460 #
1461 # title: &quot;Requestor is owner&quot;
1462 # description: &quot;Determines if requestor is the document owner&quot;
1463 # expression: &quot;document.owner == request.auth.claims.email&quot;
1464 #
1465 # Example (Logic):
1466 #
1467 # title: &quot;Public documents&quot;
1468 # description: &quot;Determine whether the document should be publicly visible&quot;
1469 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
1470 #
1471 # Example (Data Manipulation):
1472 #
1473 # title: &quot;Notification string&quot;
1474 # description: &quot;Create a notification string with a timestamp.&quot;
1475 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
1476 #
1477 # The exact variables and functions that may be referenced within an expression
1478 # are determined by the service that evaluates it. See the service
1479 # documentation for additional information.
1480 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
1481 # describes the expression, e.g. when hovered over it in a UI.
1482 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
1483 # syntax.
1484 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
1485 # reporting, e.g. a file name and a position in the file.
1486 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
1487 # its purpose. This can be used e.g. in UIs which allow to enter the
1488 # expression.
1489 },
1490 &quot;exprOptions&quot;: { # The configuration options available when specifying a user defined
1491 # CEVAL expression (i.e., &#x27;expr&#x27;).
1492 &quot;recaptchaOptions&quot;: { # reCAPTCHA configuration options to be applied for the rule. If the
1493 # rule does not evaluate reCAPTCHA tokens, this field has no effect.
1494 &quot;actionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
1495 # action-tokens. The provided site keys need to be created from
1496 # reCAPTCHA API under the same project where the security policy is
1497 # created.
1498 &quot;A String&quot;,
1499 ],
1500 &quot;sessionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
1501 # session-tokens. The provided site keys need to be created from
1502 # reCAPTCHA API under the same project where the security policy is
1503 # created.
1504 &quot;A String&quot;,
1505 ],
1506 },
1507 },
1508 &quot;versionedExpr&quot;: &quot;A String&quot;, # Preconfigured versioned expression.
1509 # If this field is specified, config must also be specified.
1510 # Available preconfigured expressions along with their requirements are:
1511 # SRC_IPS_V1 - must specify the corresponding src_ip_range field in
1512 # config.
1513 },
1514 &quot;networkMatch&quot;: { # Represents a match condition that incoming network traffic is evaluated # A match condition that incoming packets are evaluated against for
1515 # CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding
1516 # &#x27;action&#x27; is enforced.
1517 #
1518 # The match criteria for a rule consists of built-in match fields (like
1519 # &#x27;srcIpRanges&#x27;) and potentially multiple user-defined match fields
1520 # (&#x27;userDefinedFields&#x27;).
1521 #
1522 # Field values may be extracted directly from the packet or derived from it
1523 # (e.g. &#x27;srcRegionCodes&#x27;). Some fields may not be present in every packet
1524 # (e.g. &#x27;srcPorts&#x27;). A user-defined field is only present if the base
1525 # header is found in the packet and the entire field is in bounds.
1526 #
1527 # Each match field may specify which values can match it, listing one or
1528 # more ranges, prefixes, or exact values that are considered a match for
1529 # the field. A field value must be present in order to match a specified
1530 # match field. If no match values are specified for a match field, then any
1531 # field value is considered to match it, and it&#x27;s not required to be
1532 # present. For strings specifying &#x27;*&#x27; is also equivalent to match all.
1533 #
1534 # For a packet to match a rule, all specified match fields must match the
1535 # corresponding field values derived from the packet.
1536 #
1537 # Example:
1538 #
1539 # networkMatch:
1540 # srcIpRanges:
1541 # - &quot;192.0.2.0/24&quot;
1542 # - &quot;198.51.100.0/24&quot;
1543 # userDefinedFields:
1544 # - name: &quot;ipv4_fragment_offset&quot;
1545 # values:
1546 # - &quot;1-0x1fff&quot;
1547 #
1548 # The above match condition matches packets with a source IP in
1549 # 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named
1550 # &quot;ipv4_fragment_offset&quot; with a value between 1 and 0x1fff inclusive.
1551 # against.
1552 &quot;destIpRanges&quot;: [ # Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text
1553 # format.
1554 &quot;A String&quot;,
1555 ],
1556 &quot;destPorts&quot;: [ # Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
1557 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
1558 &quot;A String&quot;,
1559 ],
1560 &quot;ipProtocols&quot;: [ # IPv4 protocol / IPv6 next header (after extension headers). Each
1561 # element can be an 8-bit unsigned decimal number (e.g. &quot;6&quot;), range (e.g.
1562 # &quot;253-254&quot;), or one of the following protocol names: &quot;tcp&quot;, &quot;udp&quot;,
1563 # &quot;icmp&quot;, &quot;esp&quot;, &quot;ah&quot;, &quot;ipip&quot;, or &quot;sctp&quot;.
1564 &quot;A String&quot;,
1565 ],
1566 &quot;srcAsns&quot;: [ # BGP Autonomous System Number associated with the source IP address.
1567 42,
1568 ],
1569 &quot;srcIpRanges&quot;: [ # Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
1570 &quot;A String&quot;,
1571 ],
1572 &quot;srcPorts&quot;: [ # Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
1573 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
1574 &quot;A String&quot;,
1575 ],
1576 &quot;srcRegionCodes&quot;: [ # Two-letter ISO 3166-1 alpha-2 country code associated with the source
1577 # IP address.
1578 &quot;A String&quot;,
1579 ],
1580 &quot;userDefinedFields&quot;: [ # User-defined fields. Each element names a defined field and lists the
1581 # matching values for that field.
1582 {
1583 &quot;name&quot;: &quot;A String&quot;, # Name of the user-defined field, as given in the definition.
1584 &quot;values&quot;: [ # Matching values of the field. Each element can be a 32-bit unsigned
1585 # decimal or hexadecimal (starting with &quot;0x&quot;) number (e.g. &quot;64&quot;) or
1586 # range (e.g. &quot;0x400-0x7ff&quot;).
1587 &quot;A String&quot;,
1588 ],
1589 },
1590 ],
1591 },
1592 &quot;preconfiguredWafConfig&quot;: { # Preconfigured WAF configuration to be applied for the rule. If the rule
1593 # does not evaluate preconfigured WAF rules, i.e., if
1594 # evaluatePreconfiguredWaf() is not used, this field will have no effect.
1595 &quot;exclusions&quot;: [ # A list of exclusions to apply during preconfigured WAF evaluation.
1596 {
1597 &quot;requestBodiesToExclude&quot;: [ # A list of request body fields to be excluded from inspection during
1598 # preconfigured WAF evaluation.
1599 {
1600 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
1601 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
1602 },
1603 ],
1604 &quot;requestCookiesToExclude&quot;: [ # A list of request cookie names whose value will be excluded from
1605 # inspection during preconfigured WAF evaluation.
1606 {
1607 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
1608 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
1609 },
1610 ],
1611 &quot;requestHeadersToExclude&quot;: [ # A list of request header names whose value will be excluded from
1612 # inspection during preconfigured WAF evaluation.
1613 {
1614 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
1615 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
1616 },
1617 ],
1618 &quot;requestQueryParamsToExclude&quot;: [ # A list of request query parameter names whose value will be excluded
1619 # from inspection during preconfigured WAF evaluation. Note that the
1620 # parameter can be in the query string or in the POST body.
1621 {
1622 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
1623 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
1624 },
1625 ],
1626 &quot;requestUrisToExclude&quot;: [ # A list of request URIs from the request line to be excluded from
1627 # inspection during preconfigured WAF evaluation. When specifying this
1628 # field, the query or fragment part should be excluded.
1629 {
1630 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
1631 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
1632 },
1633 ],
1634 &quot;targetRuleIds&quot;: [ # A list of target rule IDs under the WAF rule set to apply the
1635 # preconfigured WAF exclusion. If omitted, it refers to all the rule
1636 # IDs under the WAF rule set.
1637 &quot;A String&quot;,
1638 ],
1639 &quot;targetRuleSet&quot;: &quot;A String&quot;, # Target WAF rule set to apply the preconfigured WAF exclusion.
1640 },
1641 ],
1642 },
1643 &quot;preview&quot;: True or False, # If set to true, the specified action is not enforced.
1644 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority
1645 # must be a positive value between 0 and 2147483647.
1646 # Rules are evaluated from highest to lowest priority where 0 is the
1647 # highest priority and 2147483647 is the lowest priority.
1648 &quot;rateLimitOptions&quot;: { # Must be specified if the action is &quot;rate_based_ban&quot; or &quot;throttle&quot; or
1649 # &quot;fairshare&quot;. Cannot be specified for any other actions.
1650 &quot;banDurationSec&quot;: 42, # Can only be specified if the action for the rule is
1651 # &quot;rate_based_ban&quot;. If specified, determines the time (in seconds)
1652 # the traffic will continue to be banned by the rate limit after the
1653 # rate falls below the threshold.
1654 &quot;banThreshold&quot;: { # Can only be specified if the action for the rule is
1655 # &quot;rate_based_ban&quot;. If specified, the key will be banned for the
1656 # configured &#x27;ban_duration_sec&#x27; when the number of requests that exceed
1657 # the &#x27;rate_limit_threshold&#x27; also exceed this &#x27;ban_threshold&#x27;.
1658 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
1659 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
1660 },
1661 &quot;conformAction&quot;: &quot;A String&quot;, # Action to take for requests that are under the configured rate limit
1662 # threshold. Valid option is &quot;allow&quot; only.
1663 &quot;enforceOnKey&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
1664 # values are:
1665 #
1666 # - ALL: A single rate limit threshold is applied to all
1667 # the requests matching this rule. This is the default value if
1668 # &quot;enforceOnKey&quot; is not configured.
1669 # - IP: The source IP address of
1670 # the request is the key. Each IP has this limit enforced
1671 # separately.
1672 # - HTTP_HEADER: The value of the HTTP
1673 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
1674 # value is truncated to the first 128 bytes of the header value. If no
1675 # such header is present in the request, the key type defaults toALL.
1676 # - XFF_IP: The first IP address (i.e. the
1677 # originating client IP address) specified in the list of IPs under
1678 # X-Forwarded-For HTTP header. If no such header is present or the value
1679 # is not a valid IP, the key defaults to the source IP address of
1680 # the request i.e. key type IP.
1681 # - HTTP_COOKIE: The value of the HTTP
1682 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
1683 # value is truncated to the first 128 bytes of the cookie value. If no
1684 # such cookie is present in the request, the key type defaults toALL.
1685 # - HTTP_PATH: The URL path of the HTTP request. The key
1686 # value is truncated to the first 128 bytes.
1687 # - SNI: Server name indication in the TLS session of the
1688 # HTTPS request. The key value is truncated to the first 128 bytes. The
1689 # key type defaults to ALL on a HTTP session.
1690 # - REGION_CODE: The country/region from which the request
1691 # originates.
1692 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
1693 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
1694 # key type defaults to ALL.
1695 # - USER_IP: The IP address of the originating client,
1696 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
1697 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration or
1698 # an IP address cannot be resolved from it, the key type defaults toIP.
1699 #
1700 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
1701 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
1702 # key type defaults to ALL.
1703 # For &quot;fairshare&quot; action, this value is limited to ALL i.e. a single rate
1704 # limit threshold is enforced for all the requests matching the rule.
1705 &quot;enforceOnKeyConfigs&quot;: [ # If specified, any combination of values of
1706 # enforce_on_key_type/enforce_on_key_name is treated as the key on which
1707 # ratelimit threshold/action is enforced. You can specify up to 3
1708 # enforce_on_key_configs. If enforce_on_key_configs is specified,
1709 # enforce_on_key must not be specified.
1710 {
1711 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
1712 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the
1713 # key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is
1714 # taken as the key value.
1715 &quot;enforceOnKeyType&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
1716 # values are:
1717 #
1718 # - ALL: A single rate limit threshold is applied to all
1719 # the requests matching this rule. This is the default value if
1720 # &quot;enforceOnKeyConfigs&quot; is not configured.
1721 # - IP: The source IP address of
1722 # the request is the key. Each IP has this limit enforced
1723 # separately.
1724 # - HTTP_HEADER: The value of the HTTP
1725 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
1726 # value is truncated to the first 128 bytes of the header value. If no
1727 # such header is present in the request, the key type defaults toALL.
1728 # - XFF_IP: The first IP address (i.e. the
1729 # originating client IP address) specified in the list of IPs under
1730 # X-Forwarded-For HTTP header. If no such header is present or the
1731 # value is not a valid IP, the key defaults to the source IP address of
1732 # the request i.e. key type IP.
1733 # - HTTP_COOKIE: The value of the HTTP
1734 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
1735 # value is truncated to the first 128 bytes of the cookie value. If no
1736 # such cookie is present in the request, the key type defaults toALL.
1737 # - HTTP_PATH: The URL path of the HTTP request. The key
1738 # value is truncated to the first 128 bytes.
1739 # - SNI: Server name indication in the TLS session of
1740 # the HTTPS request. The key value is truncated to the first 128 bytes.
1741 # The key type defaults to ALL on a HTTP session.
1742 # - REGION_CODE: The country/region from which the
1743 # request originates.
1744 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
1745 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
1746 # key type defaults to ALL.
1747 # - USER_IP: The IP address of the originating client,
1748 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
1749 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration
1750 # or an IP address cannot be resolved from it, the key type defaults toIP.
1751 #
1752 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
1753 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
1754 # key type defaults to ALL.
1755 },
1756 ],
1757 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
1758 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the key
1759 # value.
1760 # HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key
1761 # value.
1762 &quot;exceedAction&quot;: &quot;A String&quot;, # Action to take for requests that are above the configured rate limit
1763 # threshold, to either deny with a specified HTTP response code, or
1764 # redirect to a different endpoint.
1765 # Valid options are `deny(STATUS)`, where valid values for
1766 # `STATUS` are 403, 404, 429, and 502, and
1767 # `redirect`, where the redirect parameters come from
1768 # `exceedRedirectOptions` below.
1769 # The `redirect` action is only supported in Global Security Policies of
1770 # type CLOUD_ARMOR.
1771 &quot;exceedRedirectOptions&quot;: { # Parameters defining the redirect action that is used as the exceed
1772 # action. Cannot be specified if the exceed action is not redirect.
1773 # This field is only supported in Global Security Policies of type
1774 # CLOUD_ARMOR.
1775 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
1776 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
1777 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
1778 #
1779 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
1780 # challenge assessment.
1781 # - EXTERNAL_302: redirect to a different URL via a 302
1782 # response.
1783 },
1784 &quot;rateLimitThreshold&quot;: { # Threshold at which to begin ratelimiting.
1785 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
1786 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
1787 },
1788 },
1789 &quot;redirectOptions&quot;: { # Parameters defining the redirect action. Cannot be specified for any
1790 # other actions.
1791 # This field is only supported in Global Security Policies of type
1792 # CLOUD_ARMOR.
1793 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
1794 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
1795 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
1796 #
1797 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
1798 # challenge assessment.
1799 # - EXTERNAL_302: redirect to a different URL via a 302
1800 # response.
1801 },
1802 &quot;ruleNumber&quot;: &quot;A String&quot;, # Identifier for the rule. This is only unique within the given security
1803 # policy. This can only be set during rule creation, if rule number is not
1804 # specified it will be generated by the server.
1805 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Calculation of the complexity of a single firewall security
1806 # policy rule.
1807 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field
1808 # allows you to control which network&#x27;s VMs get this rule. If this field
1809 # is left blank, all VMs within the organization will receive the rule.
1810 #
1811 # This field may only be specified when versioned_expr is set to FIREWALL.
1812 &quot;A String&quot;,
1813 ],
1814 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are
1815 # applied with this rule.
1816 &quot;A String&quot;,
1817 ],
1818 },
1819 ],
1820 &quot;selfLink&quot;: &quot;A String&quot;, # Output only. [Output Only] Server-defined URL for the resource.
1821 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # Output only. [Output Only] Server-defined URL for this resource with the resource id.
1822 &quot;shortName&quot;: &quot;A String&quot;, # User-provided name of the organization security policy. The name should be
1823 # unique in the organization in which the security policy is created. This
1824 # should only be used when SecurityPolicyType is CLOUD_ARMOR.
1825 # The name must be 1-63 characters long, and comply with
1826 # https://www.ietf.org/rfc/rfc1035.txt. Specifically, the name must be 1-63
1827 # characters long and match the regular expression
1828 # `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a
1829 # lowercase letter, and all following characters must be a dash, lowercase
1830 # letter, or digit, except the last character, which cannot be a dash.
1831 &quot;type&quot;: &quot;A String&quot;, # The type indicates the intended use of the security policy.
1832 #
1833 # - CLOUD_ARMOR: Cloud Armor backend security policies can
1834 # be configured to filter incoming HTTP requests targeting backend services.
1835 # They filter requests before they hit the origin servers.
1836 # - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can
1837 # be configured to filter incoming HTTP requests targeting backend services
1838 # (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage).
1839 # They filter requests before the request is served from Google&#x27;s cache.
1840 # - CLOUD_ARMOR_INTERNAL_SERVICE (preview only): Cloud Armor
1841 # internal service policies can be configured to filter HTTP requests
1842 # targeting services managed by Traffic Director in a service mesh. They
1843 # filter requests before the request is served from the application.
1844 #
1845 # - CLOUD_ARMOR_NETWORK: Cloud Armor network policies
1846 # can be configured to filter packets targeting network load balancing
1847 # resources such as backend services, target pools, target instances, and
1848 # instances with external IPs. They filter requests before the request is
1849 # served from the application.
1850 #
1851 #
1852 # This field can be set only at resource creation time.
1853 &quot;userDefinedFields&quot;: [ # Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A
1854 # user-defined field consists of up to 4 bytes extracted from a fixed offset
1855 # in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an
1856 # optional mask to select certain bits. Rules may then specify matching
1857 # values for these fields.
1858 #
1859 # Example:
1860 #
1861 # userDefinedFields:
1862 # - name: &quot;ipv4_fragment_offset&quot;
1863 # base: IPV4
1864 # offset: 6
1865 # size: 2
1866 # mask: &quot;0x1fff&quot;
1867 {
1868 &quot;base&quot;: &quot;A String&quot;, # The base relative to which &#x27;offset&#x27; is measured. Possible values are:
1869 #
1870 # - IPV4: Points to the beginning of the IPv4 header.
1871 # - IPV6: Points to the beginning of the IPv6 header.
1872 # - TCP: Points to the beginning of the TCP header, skipping
1873 # over any IPv4 options or IPv6 extension headers. Not present for
1874 # non-first fragments.
1875 # - UDP: Points to the beginning of the UDP header, skipping
1876 # over any IPv4 options or IPv6 extension headers. Not present for
1877 # non-first fragments.
1878 #
1879 #
1880 # required
1881 &quot;mask&quot;: &quot;A String&quot;, # If specified, apply this mask (bitwise AND) to the field to ignore bits
1882 # before matching. Encoded as a hexadecimal number (starting with &quot;0x&quot;).
1883 # The last byte of the field (in network byte order) corresponds to the
1884 # least significant byte of the mask.
1885 &quot;name&quot;: &quot;A String&quot;, # The name of this field. Must be unique within the policy.
1886 &quot;offset&quot;: 42, # Offset of the first byte of the field (in network byte order) relative to
1887 # &#x27;base&#x27;.
1888 &quot;size&quot;: 42, # Size of the field in bytes. Valid values: 1-4.
1889 },
1890 ],
1891 }</pre>
1892 </div>
1893
1894 <div class="method">
1895 <code class="details" id="getRule">getRule(project, region, securityPolicy, priority=None, x__xgafv=None)</code>
1896 <pre>Gets a rule at the specified priority.
1897
1898 Args:
1899 project: string, Project ID for this request. (required)
1900 region: string, Name of the region scoping this request. (required)
1901 securityPolicy: string, Name of the security policy to which the queried rule belongs. (required)
1902 priority: integer, The priority of the rule to get from the security policy.
1903 x__xgafv: string, V1 error format.
1904 Allowed values
1905 1 - v1 error format
1906 2 - v2 error format
1907
1908 Returns:
1909 An object of the form:
1910
1911 { # Represents a rule that describes one or more match conditions along with
1912 # the action to be taken when traffic matches this condition (allow or deny).
1913 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the rule is matched.
1914 # The following are the valid actions:
1915 #
1916 # - allow: allow access to target.
1917 # - deny(STATUS): deny access to target, returns the
1918 # HTTP response code specified. Valid values for `STATUS`
1919 # are 403, 404, and 502.
1920 # - rate_based_ban: limit client traffic to the configured
1921 # threshold and ban the client if the traffic exceeds the threshold.
1922 # Configure parameters for this action in RateLimitOptions. Requires
1923 # rate_limit_options to be set.
1924 # - redirect: redirect to a different target. This can
1925 # either be an internal reCAPTCHA redirect, or an external URL-based
1926 # redirect via a 302 response. Parameters for this action can be configured
1927 # via redirectOptions. This action is only supported in Global Security
1928 # Policies of type CLOUD_ARMOR.
1929 # - throttle: limit
1930 # client traffic to the configured threshold. Configure parameters for this
1931 # action in rateLimitOptions. Requires rate_limit_options to be set for
1932 # this.
1933 # - fairshare (preview only): when traffic reaches the
1934 # threshold limit, requests from the clients matching this rule begin to be
1935 # rate-limited using the Fair Share algorithm. This action is only allowed
1936 # in security policies of type `CLOUD_ARMOR_INTERNAL_SERVICE`.
1937 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
1938 # create the resource.
1939 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies. This field may only be
1940 # specified when versioned_expr is set to FIREWALL.
1941 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is
1942 # enabled, logs will be exported to the configured export destination in
1943 # Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you
1944 # cannot enable logging on &quot;goto_next&quot; rules.
1945 #
1946 # This field may only be specified when the versioned_expr is set to
1947 # FIREWALL.
1948 &quot;headerAction&quot;: { # Optional, additional actions that are performed on headers.
1949 # This field is only supported in Global Security Policies of type
1950 # CLOUD_ARMOR.
1951 &quot;requestHeadersToAdds&quot;: [ # The list of request headers to add or overwrite if they&#x27;re already
1952 # present.
1953 {
1954 &quot;headerName&quot;: &quot;A String&quot;, # The name of the header to set.
1955 &quot;headerValue&quot;: &quot;A String&quot;, # The value to set the named header to.
1956 },
1957 ],
1958 },
1959 &quot;kind&quot;: &quot;compute#securityPolicyRule&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyRule for security policy rules
1960 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. # A match condition that incoming traffic is evaluated against.
1961 # If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
1962 # Exactly one field must be specified.
1963 &quot;config&quot;: { # The configuration options available when specifying versioned_expr.
1964 # This field must be specified if versioned_expr is specified and cannot
1965 # be specified if versioned_expr is not specified.
1966 &quot;destIpRanges&quot;: [ # CIDR IP address range.
1967 #
1968 # This field may only be specified when versioned_expr is set to
1969 # FIREWALL.
1970 &quot;A String&quot;,
1971 ],
1972 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
1973 #
1974 # This field may only be specified when versioned_expr is set to
1975 # FIREWALL.
1976 {
1977 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is
1978 # required when creating a firewall rule. This value can either be
1979 # one of the following well known protocol strings (tcp,udp, icmp, esp,ah, ipip, sctp), or the IP
1980 # protocol number.
1981 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is
1982 # only applicable for UDP or TCP protocol. Each entry must be either
1983 # an integer or a range. If not specified, this rule applies to
1984 # connections through any port.
1985 #
1986 # Example inputs include: [&quot;22&quot;],[&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
1987 #
1988 # This field may only be specified when versioned_expr is set to
1989 # FIREWALL.
1990 &quot;A String&quot;,
1991 ],
1992 },
1993 ],
1994 &quot;srcIpRanges&quot;: [ # CIDR IP address range.
1995 # Maximum number of src_ip_ranges allowed is 10.
1996 &quot;A String&quot;,
1997 ],
1998 },
1999 &quot;expr&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # User defined CEVAL expression.
2000 # A CEVAL expression is used to specify match criteria such as origin.ip,
2001 # source.region_code and contents in the request header.
2002 # Expressions containing `evaluateThreatIntelligence` require a Cloud
2003 # Armor Enterprise subscription and are not supported in Edge Policies
2004 # nor in Regional Policies. Expressions containing
2005 # `evaluatePreconfiguredExpr(&#x27;sourceiplist-*&#x27;)` require a Cloud Armor
2006 # Enterprise subscription and are only supported in Global Security
2007 # Policies.
2008 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
2009 # are documented at https://github.com/google/cel-spec.
2010 #
2011 # Example (Comparison):
2012 #
2013 # title: &quot;Summary size limit&quot;
2014 # description: &quot;Determines if a summary is less than 100 chars&quot;
2015 # expression: &quot;document.summary.size() &lt; 100&quot;
2016 #
2017 # Example (Equality):
2018 #
2019 # title: &quot;Requestor is owner&quot;
2020 # description: &quot;Determines if requestor is the document owner&quot;
2021 # expression: &quot;document.owner == request.auth.claims.email&quot;
2022 #
2023 # Example (Logic):
2024 #
2025 # title: &quot;Public documents&quot;
2026 # description: &quot;Determine whether the document should be publicly visible&quot;
2027 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
2028 #
2029 # Example (Data Manipulation):
2030 #
2031 # title: &quot;Notification string&quot;
2032 # description: &quot;Create a notification string with a timestamp.&quot;
2033 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
2034 #
2035 # The exact variables and functions that may be referenced within an expression
2036 # are determined by the service that evaluates it. See the service
2037 # documentation for additional information.
2038 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
2039 # describes the expression, e.g. when hovered over it in a UI.
2040 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
2041 # syntax.
2042 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
2043 # reporting, e.g. a file name and a position in the file.
2044 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
2045 # its purpose. This can be used e.g. in UIs which allow to enter the
2046 # expression.
2047 },
2048 &quot;exprOptions&quot;: { # The configuration options available when specifying a user defined
2049 # CEVAL expression (i.e., &#x27;expr&#x27;).
2050 &quot;recaptchaOptions&quot;: { # reCAPTCHA configuration options to be applied for the rule. If the
2051 # rule does not evaluate reCAPTCHA tokens, this field has no effect.
2052 &quot;actionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
2053 # action-tokens. The provided site keys need to be created from
2054 # reCAPTCHA API under the same project where the security policy is
2055 # created.
2056 &quot;A String&quot;,
2057 ],
2058 &quot;sessionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
2059 # session-tokens. The provided site keys need to be created from
2060 # reCAPTCHA API under the same project where the security policy is
2061 # created.
2062 &quot;A String&quot;,
2063 ],
2064 },
2065 },
2066 &quot;versionedExpr&quot;: &quot;A String&quot;, # Preconfigured versioned expression.
2067 # If this field is specified, config must also be specified.
2068 # Available preconfigured expressions along with their requirements are:
2069 # SRC_IPS_V1 - must specify the corresponding src_ip_range field in
2070 # config.
2071 },
2072 &quot;networkMatch&quot;: { # Represents a match condition that incoming network traffic is evaluated # A match condition that incoming packets are evaluated against for
2073 # CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding
2074 # &#x27;action&#x27; is enforced.
2075 #
2076 # The match criteria for a rule consists of built-in match fields (like
2077 # &#x27;srcIpRanges&#x27;) and potentially multiple user-defined match fields
2078 # (&#x27;userDefinedFields&#x27;).
2079 #
2080 # Field values may be extracted directly from the packet or derived from it
2081 # (e.g. &#x27;srcRegionCodes&#x27;). Some fields may not be present in every packet
2082 # (e.g. &#x27;srcPorts&#x27;). A user-defined field is only present if the base
2083 # header is found in the packet and the entire field is in bounds.
2084 #
2085 # Each match field may specify which values can match it, listing one or
2086 # more ranges, prefixes, or exact values that are considered a match for
2087 # the field. A field value must be present in order to match a specified
2088 # match field. If no match values are specified for a match field, then any
2089 # field value is considered to match it, and it&#x27;s not required to be
2090 # present. For strings specifying &#x27;*&#x27; is also equivalent to match all.
2091 #
2092 # For a packet to match a rule, all specified match fields must match the
2093 # corresponding field values derived from the packet.
2094 #
2095 # Example:
2096 #
2097 # networkMatch:
2098 # srcIpRanges:
2099 # - &quot;192.0.2.0/24&quot;
2100 # - &quot;198.51.100.0/24&quot;
2101 # userDefinedFields:
2102 # - name: &quot;ipv4_fragment_offset&quot;
2103 # values:
2104 # - &quot;1-0x1fff&quot;
2105 #
2106 # The above match condition matches packets with a source IP in
2107 # 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named
2108 # &quot;ipv4_fragment_offset&quot; with a value between 1 and 0x1fff inclusive.
2109 # against.
2110 &quot;destIpRanges&quot;: [ # Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text
2111 # format.
2112 &quot;A String&quot;,
2113 ],
2114 &quot;destPorts&quot;: [ # Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
2115 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
2116 &quot;A String&quot;,
2117 ],
2118 &quot;ipProtocols&quot;: [ # IPv4 protocol / IPv6 next header (after extension headers). Each
2119 # element can be an 8-bit unsigned decimal number (e.g. &quot;6&quot;), range (e.g.
2120 # &quot;253-254&quot;), or one of the following protocol names: &quot;tcp&quot;, &quot;udp&quot;,
2121 # &quot;icmp&quot;, &quot;esp&quot;, &quot;ah&quot;, &quot;ipip&quot;, or &quot;sctp&quot;.
2122 &quot;A String&quot;,
2123 ],
2124 &quot;srcAsns&quot;: [ # BGP Autonomous System Number associated with the source IP address.
2125 42,
2126 ],
2127 &quot;srcIpRanges&quot;: [ # Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
2128 &quot;A String&quot;,
2129 ],
2130 &quot;srcPorts&quot;: [ # Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
2131 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
2132 &quot;A String&quot;,
2133 ],
2134 &quot;srcRegionCodes&quot;: [ # Two-letter ISO 3166-1 alpha-2 country code associated with the source
2135 # IP address.
2136 &quot;A String&quot;,
2137 ],
2138 &quot;userDefinedFields&quot;: [ # User-defined fields. Each element names a defined field and lists the
2139 # matching values for that field.
2140 {
2141 &quot;name&quot;: &quot;A String&quot;, # Name of the user-defined field, as given in the definition.
2142 &quot;values&quot;: [ # Matching values of the field. Each element can be a 32-bit unsigned
2143 # decimal or hexadecimal (starting with &quot;0x&quot;) number (e.g. &quot;64&quot;) or
2144 # range (e.g. &quot;0x400-0x7ff&quot;).
2145 &quot;A String&quot;,
2146 ],
2147 },
2148 ],
2149 },
2150 &quot;preconfiguredWafConfig&quot;: { # Preconfigured WAF configuration to be applied for the rule. If the rule
2151 # does not evaluate preconfigured WAF rules, i.e., if
2152 # evaluatePreconfiguredWaf() is not used, this field will have no effect.
2153 &quot;exclusions&quot;: [ # A list of exclusions to apply during preconfigured WAF evaluation.
2154 {
2155 &quot;requestBodiesToExclude&quot;: [ # A list of request body fields to be excluded from inspection during
2156 # preconfigured WAF evaluation.
2157 {
2158 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
2159 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
2160 },
2161 ],
2162 &quot;requestCookiesToExclude&quot;: [ # A list of request cookie names whose value will be excluded from
2163 # inspection during preconfigured WAF evaluation.
2164 {
2165 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
2166 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
2167 },
2168 ],
2169 &quot;requestHeadersToExclude&quot;: [ # A list of request header names whose value will be excluded from
2170 # inspection during preconfigured WAF evaluation.
2171 {
2172 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
2173 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
2174 },
2175 ],
2176 &quot;requestQueryParamsToExclude&quot;: [ # A list of request query parameter names whose value will be excluded
2177 # from inspection during preconfigured WAF evaluation. Note that the
2178 # parameter can be in the query string or in the POST body.
2179 {
2180 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
2181 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
2182 },
2183 ],
2184 &quot;requestUrisToExclude&quot;: [ # A list of request URIs from the request line to be excluded from
2185 # inspection during preconfigured WAF evaluation. When specifying this
2186 # field, the query or fragment part should be excluded.
2187 {
2188 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
2189 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
2190 },
2191 ],
2192 &quot;targetRuleIds&quot;: [ # A list of target rule IDs under the WAF rule set to apply the
2193 # preconfigured WAF exclusion. If omitted, it refers to all the rule
2194 # IDs under the WAF rule set.
2195 &quot;A String&quot;,
2196 ],
2197 &quot;targetRuleSet&quot;: &quot;A String&quot;, # Target WAF rule set to apply the preconfigured WAF exclusion.
2198 },
2199 ],
2200 },
2201 &quot;preview&quot;: True or False, # If set to true, the specified action is not enforced.
2202 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority
2203 # must be a positive value between 0 and 2147483647.
2204 # Rules are evaluated from highest to lowest priority where 0 is the
2205 # highest priority and 2147483647 is the lowest priority.
2206 &quot;rateLimitOptions&quot;: { # Must be specified if the action is &quot;rate_based_ban&quot; or &quot;throttle&quot; or
2207 # &quot;fairshare&quot;. Cannot be specified for any other actions.
2208 &quot;banDurationSec&quot;: 42, # Can only be specified if the action for the rule is
2209 # &quot;rate_based_ban&quot;. If specified, determines the time (in seconds)
2210 # the traffic will continue to be banned by the rate limit after the
2211 # rate falls below the threshold.
2212 &quot;banThreshold&quot;: { # Can only be specified if the action for the rule is
2213 # &quot;rate_based_ban&quot;. If specified, the key will be banned for the
2214 # configured &#x27;ban_duration_sec&#x27; when the number of requests that exceed
2215 # the &#x27;rate_limit_threshold&#x27; also exceed this &#x27;ban_threshold&#x27;.
2216 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
2217 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
2218 },
2219 &quot;conformAction&quot;: &quot;A String&quot;, # Action to take for requests that are under the configured rate limit
2220 # threshold. Valid option is &quot;allow&quot; only.
2221 &quot;enforceOnKey&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
2222 # values are:
2223 #
2224 # - ALL: A single rate limit threshold is applied to all
2225 # the requests matching this rule. This is the default value if
2226 # &quot;enforceOnKey&quot; is not configured.
2227 # - IP: The source IP address of
2228 # the request is the key. Each IP has this limit enforced
2229 # separately.
2230 # - HTTP_HEADER: The value of the HTTP
2231 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
2232 # value is truncated to the first 128 bytes of the header value. If no
2233 # such header is present in the request, the key type defaults toALL.
2234 # - XFF_IP: The first IP address (i.e. the
2235 # originating client IP address) specified in the list of IPs under
2236 # X-Forwarded-For HTTP header. If no such header is present or the value
2237 # is not a valid IP, the key defaults to the source IP address of
2238 # the request i.e. key type IP.
2239 # - HTTP_COOKIE: The value of the HTTP
2240 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
2241 # value is truncated to the first 128 bytes of the cookie value. If no
2242 # such cookie is present in the request, the key type defaults toALL.
2243 # - HTTP_PATH: The URL path of the HTTP request. The key
2244 # value is truncated to the first 128 bytes.
2245 # - SNI: Server name indication in the TLS session of the
2246 # HTTPS request. The key value is truncated to the first 128 bytes. The
2247 # key type defaults to ALL on a HTTP session.
2248 # - REGION_CODE: The country/region from which the request
2249 # originates.
2250 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
2251 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
2252 # key type defaults to ALL.
2253 # - USER_IP: The IP address of the originating client,
2254 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
2255 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration or
2256 # an IP address cannot be resolved from it, the key type defaults toIP.
2257 #
2258 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
2259 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
2260 # key type defaults to ALL.
2261 # For &quot;fairshare&quot; action, this value is limited to ALL i.e. a single rate
2262 # limit threshold is enforced for all the requests matching the rule.
2263 &quot;enforceOnKeyConfigs&quot;: [ # If specified, any combination of values of
2264 # enforce_on_key_type/enforce_on_key_name is treated as the key on which
2265 # ratelimit threshold/action is enforced. You can specify up to 3
2266 # enforce_on_key_configs. If enforce_on_key_configs is specified,
2267 # enforce_on_key must not be specified.
2268 {
2269 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
2270 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the
2271 # key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is
2272 # taken as the key value.
2273 &quot;enforceOnKeyType&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
2274 # values are:
2275 #
2276 # - ALL: A single rate limit threshold is applied to all
2277 # the requests matching this rule. This is the default value if
2278 # &quot;enforceOnKeyConfigs&quot; is not configured.
2279 # - IP: The source IP address of
2280 # the request is the key. Each IP has this limit enforced
2281 # separately.
2282 # - HTTP_HEADER: The value of the HTTP
2283 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
2284 # value is truncated to the first 128 bytes of the header value. If no
2285 # such header is present in the request, the key type defaults toALL.
2286 # - XFF_IP: The first IP address (i.e. the
2287 # originating client IP address) specified in the list of IPs under
2288 # X-Forwarded-For HTTP header. If no such header is present or the
2289 # value is not a valid IP, the key defaults to the source IP address of
2290 # the request i.e. key type IP.
2291 # - HTTP_COOKIE: The value of the HTTP
2292 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
2293 # value is truncated to the first 128 bytes of the cookie value. If no
2294 # such cookie is present in the request, the key type defaults toALL.
2295 # - HTTP_PATH: The URL path of the HTTP request. The key
2296 # value is truncated to the first 128 bytes.
2297 # - SNI: Server name indication in the TLS session of
2298 # the HTTPS request. The key value is truncated to the first 128 bytes.
2299 # The key type defaults to ALL on a HTTP session.
2300 # - REGION_CODE: The country/region from which the
2301 # request originates.
2302 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
2303 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
2304 # key type defaults to ALL.
2305 # - USER_IP: The IP address of the originating client,
2306 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
2307 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration
2308 # or an IP address cannot be resolved from it, the key type defaults toIP.
2309 #
2310 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
2311 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
2312 # key type defaults to ALL.
2313 },
2314 ],
2315 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
2316 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the key
2317 # value.
2318 # HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key
2319 # value.
2320 &quot;exceedAction&quot;: &quot;A String&quot;, # Action to take for requests that are above the configured rate limit
2321 # threshold, to either deny with a specified HTTP response code, or
2322 # redirect to a different endpoint.
2323 # Valid options are `deny(STATUS)`, where valid values for
2324 # `STATUS` are 403, 404, 429, and 502, and
2325 # `redirect`, where the redirect parameters come from
2326 # `exceedRedirectOptions` below.
2327 # The `redirect` action is only supported in Global Security Policies of
2328 # type CLOUD_ARMOR.
2329 &quot;exceedRedirectOptions&quot;: { # Parameters defining the redirect action that is used as the exceed
2330 # action. Cannot be specified if the exceed action is not redirect.
2331 # This field is only supported in Global Security Policies of type
2332 # CLOUD_ARMOR.
2333 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
2334 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
2335 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
2336 #
2337 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
2338 # challenge assessment.
2339 # - EXTERNAL_302: redirect to a different URL via a 302
2340 # response.
2341 },
2342 &quot;rateLimitThreshold&quot;: { # Threshold at which to begin ratelimiting.
2343 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
2344 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
2345 },
2346 },
2347 &quot;redirectOptions&quot;: { # Parameters defining the redirect action. Cannot be specified for any
2348 # other actions.
2349 # This field is only supported in Global Security Policies of type
2350 # CLOUD_ARMOR.
2351 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
2352 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
2353 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
2354 #
2355 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
2356 # challenge assessment.
2357 # - EXTERNAL_302: redirect to a different URL via a 302
2358 # response.
2359 },
2360 &quot;ruleNumber&quot;: &quot;A String&quot;, # Identifier for the rule. This is only unique within the given security
2361 # policy. This can only be set during rule creation, if rule number is not
2362 # specified it will be generated by the server.
2363 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Calculation of the complexity of a single firewall security
2364 # policy rule.
2365 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field
2366 # allows you to control which network&#x27;s VMs get this rule. If this field
2367 # is left blank, all VMs within the organization will receive the rule.
2368 #
2369 # This field may only be specified when versioned_expr is set to FIREWALL.
2370 &quot;A String&quot;,
2371 ],
2372 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are
2373 # applied with this rule.
2374 &quot;A String&quot;,
2375 ],
2376 }</pre>
2377 </div>
2378
2379 <div class="method">
2380 <code class="details" id="insert">insert(project, region, body=None, requestId=None, validateOnly=None, x__xgafv=None)</code>
2381 <pre>Creates a new policy in the specified project using the data included in
2382 the request.
2383
2384 Args:
2385 project: string, Project ID for this request. (required)
2386 region: string, Name of the region scoping this request. (required)
2387 body: object, The request body.
2388 The object takes the form of:
2389
2390 { # Represents a Google Cloud Armor security policy resource.
2391 #
2392 # Only external backend services that use load balancers can
2393 # reference a security policy. For more information, see
2394 # Google Cloud Armor security policy overview.
2395 &quot;adaptiveProtectionConfig&quot;: { # Configuration options for Cloud Armor Adaptive Protection (CAAP).
2396 &quot;autoDeployConfig&quot;: { # Configuration options for Adaptive Protection auto-deploy feature.
2397 &quot;confidenceThreshold&quot;: 3.14,
2398 &quot;expirationSec&quot;: 42,
2399 &quot;impactedBaselineThreshold&quot;: 3.14,
2400 &quot;loadThreshold&quot;: 3.14,
2401 },
2402 &quot;layer7DdosDefenseConfig&quot;: { # Configuration options for L7 DDoS detection. # If set to true, enables Cloud Armor Machine Learning.
2403 # This field is only supported in Global Security Policies of type
2404 # CLOUD_ARMOR.
2405 &quot;enable&quot;: True or False, # If set to true, enables CAAP for L7 DDoS detection.
2406 # This field is only supported in Global Security Policies of type
2407 # CLOUD_ARMOR.
2408 &quot;ruleVisibility&quot;: &quot;A String&quot;, # Rule visibility can be one of the following:
2409 # STANDARD - opaque rules. (default)
2410 # PREMIUM - transparent rules.
2411 # This field is only supported in Global Security Policies of type
2412 # CLOUD_ARMOR.
2413 &quot;thresholdConfigs&quot;: [ # Configuration options for layer7 adaptive protection for various
2414 # customizable thresholds.
2415 {
2416 &quot;autoDeployConfidenceThreshold&quot;: 3.14,
2417 &quot;autoDeployExpirationSec&quot;: 42,
2418 &quot;autoDeployImpactedBaselineThreshold&quot;: 3.14,
2419 &quot;autoDeployLoadThreshold&quot;: 3.14,
2420 &quot;detectionAbsoluteQps&quot;: 3.14,
2421 &quot;detectionLoadThreshold&quot;: 3.14,
2422 &quot;detectionRelativeToBaselineQps&quot;: 3.14,
2423 &quot;name&quot;: &quot;A String&quot;, # The name must be 1-63 characters long, and comply withRFC1035.
2424 # The name must be unique within the security policy.
2425 &quot;trafficGranularityConfigs&quot;: [ # Configuration options for enabling Adaptive Protection to operate
2426 # on specified granular traffic units.
2427 { # Configurations to specifc granular traffic units processed by
2428 # Adaptive Protection.
2429 &quot;enableEachUniqueValue&quot;: True or False, # If enabled, traffic matching each unique value for the specified
2430 # type constitutes a separate traffic unit.
2431 # It can only be set to true if `value` is empty.
2432 &quot;type&quot;: &quot;A String&quot;, # Type of this configuration.
2433 &quot;value&quot;: &quot;A String&quot;, # Requests that match this value constitute a granular traffic unit.
2434 },
2435 ],
2436 },
2437 ],
2438 },
2439 },
2440 &quot;advancedOptionsConfig&quot;: {
2441 &quot;jsonCustomConfig&quot;: { # Custom configuration to apply the JSON parsing. Only applicable when
2442 # json_parsing is set to STANDARD.
2443 &quot;contentTypes&quot;: [ # A list of custom Content-Type header values to apply the JSON parsing.
2444 #
2445 # As per RFC 1341, a Content-Type header value has the following format:
2446 #
2447 # Content-Type := type &quot;/&quot; subtype *[&quot;;&quot; parameter]
2448 #
2449 # When configuring a custom Content-Type header value, only the
2450 # type/subtype needs to be specified, and the parameters should be
2451 # excluded.
2452 &quot;A String&quot;,
2453 ],
2454 },
2455 &quot;jsonParsing&quot;: &quot;A String&quot;,
2456 &quot;logLevel&quot;: &quot;A String&quot;,
2457 &quot;requestBodyInspectionSize&quot;: &quot;A String&quot;, # The maximum request size chosen by the customer with Waf enabled.
2458 # Values supported are &quot;8KB&quot;, &quot;16KB, &quot;32KB&quot;, &quot;48KB&quot; and &quot;64KB&quot;.
2459 # Values are case insensitive.
2460 &quot;userIpRequestHeaders&quot;: [ # An optional list of case-insensitive request header names to use for
2461 # resolving the callers client IP address.
2462 &quot;A String&quot;,
2463 ],
2464 },
2465 &quot;associations&quot;: [ # A list of associations that belong to this policy.
2466 {
2467 &quot;attachmentId&quot;: &quot;A String&quot;, # The resource that the security policy is attached to.
2468 &quot;displayName&quot;: &quot;A String&quot;, # Output only. [Output Only] The display name of the security policy of the association.
2469 &quot;excludedFolders&quot;: [ # A list of folders to exclude from the security policy.
2470 &quot;A String&quot;,
2471 ],
2472 &quot;excludedProjects&quot;: [ # A list of projects to exclude from the security policy.
2473 &quot;A String&quot;,
2474 ],
2475 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
2476 &quot;securityPolicyId&quot;: &quot;A String&quot;, # Output only. [Output Only] The security policy ID of the association.
2477 &quot;shortName&quot;: &quot;A String&quot;, # Output only. [Output Only] The short name of the security policy of the association.
2478 },
2479 ],
2480 &quot;creationTimestamp&quot;: &quot;A String&quot;, # Output only. [Output Only] Creation timestamp inRFC3339
2481 # text format.
2482 &quot;ddosProtectionConfig&quot;: {
2483 &quot;ddosAdaptiveProtection&quot;: &quot;A String&quot;,
2484 &quot;ddosImpactedBaselineThreshold&quot;: 3.14, # DDoS Protection for Network Load Balancers (and VMs with public IPs)
2485 # builds DDoS mitigations that minimize collateral damage. It quantifies
2486 # this as the fraction of a non-abuse baseline that&#x27;s inadvertently
2487 # blocked.
2488 #
2489 # Rules whose collateral damage exceeds ddosImpactedBaselineThreshold will
2490 # not be deployed. Using a lower value will prioritize keeping collateral
2491 # damage low, possibly at the cost of its effectiveness in rate limiting
2492 # some or all of the attack. It should typically be unset, so Advanced DDoS
2493 # (and Adaptive Protection) uses the best mitigation it can find. Setting
2494 # the threshold is advised if there are logs for false positive detections
2495 # with high collateral damage, and will cause Advanced DDoS to attempt to
2496 # find a less aggressive rule that satisfies the constraint. If a suitable
2497 # rule cannot be found, the system falls back to either no mitigation for
2498 # smaller attacks or broader network throttles for larger ones.
2499 &quot;ddosProtection&quot;: &quot;A String&quot;,
2500 },
2501 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
2502 # create the resource.
2503 &quot;displayName&quot;: &quot;A String&quot;, # User-provided name of the organization security policy. The name should be
2504 # unique in the organization in which the security policy is created. This
2505 # should only be used when SecurityPolicyType is FIREWALL.
2506 # The name must be 1-63 characters long, and comply with
2507 # https://www.ietf.org/rfc/rfc1035.txt. Specifically, the name must be 1-63
2508 # characters long and match the regular expression
2509 # `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a
2510 # lowercase letter, and all following characters must be a dash, lowercase
2511 # letter, or digit, except the last character, which cannot be a dash.
2512 &quot;fingerprint&quot;: &quot;A String&quot;, # Specifies a fingerprint for this resource, which is essentially a hash of
2513 # the metadata&#x27;s contents and used for optimistic locking. The
2514 # fingerprint is initially generated by Compute Engine and changes after
2515 # every request to modify or update metadata. You must always provide an
2516 # up-to-date fingerprint hash in order to update or change metadata,
2517 # otherwise the request will fail with error412 conditionNotMet.
2518 #
2519 # To see the latest fingerprint, make get() request to the
2520 # security policy.
2521 &quot;id&quot;: &quot;A String&quot;, # Output only. [Output Only] The unique identifier for the resource. This identifier is
2522 # defined by the server.
2523 &quot;kind&quot;: &quot;compute#securityPolicy&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyfor security policies
2524 &quot;labelFingerprint&quot;: &quot;A String&quot;, # A fingerprint for the labels being applied to this security policy, which
2525 # is essentially a hash of the labels set used for optimistic locking. The
2526 # fingerprint is initially generated by Compute Engine and changes after
2527 # every request to modify or update labels. You must always provide an
2528 # up-to-date fingerprint hash in order to update or change labels.
2529 #
2530 # To see the latest fingerprint, make get() request to the
2531 # security policy.
2532 &quot;labels&quot;: { # Labels for this resource. These can only be added or modified by thesetLabels method. Each label key/value pair must comply withRFC1035.
2533 # Label values may be empty.
2534 &quot;a_key&quot;: &quot;A String&quot;,
2535 },
2536 &quot;name&quot;: &quot;A String&quot;, # Name of the resource. Provided by the client when the resource is created.
2537 # The name must be 1-63 characters long, and comply withRFC1035.
2538 # Specifically, the name must be 1-63 characters long and match the regular
2539 # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
2540 # character must be a lowercase letter, and all following characters must
2541 # be a dash, lowercase letter, or digit, except the last character, which
2542 # cannot be a dash.
2543 &quot;parent&quot;: &quot;A String&quot;, # Output only. [Output Only] The parent of the security policy.
2544 &quot;recaptchaOptionsConfig&quot;: {
2545 &quot;redirectSiteKey&quot;: &quot;A String&quot;, # An optional field to supply a reCAPTCHA site key to be used for all the
2546 # rules using the redirect action with the type of GOOGLE_RECAPTCHA under
2547 # the security policy. The specified site key needs to be created from the
2548 # reCAPTCHA API. The user is responsible for the validity of the specified
2549 # site key. If not specified, a Google-managed site key is used.
2550 # This field is only supported in Global Security Policies of type
2551 # CLOUD_ARMOR.
2552 },
2553 &quot;region&quot;: &quot;A String&quot;, # Output only. [Output Only] URL of the region where the regional security policy
2554 # resides. This field is not applicable to global security policies.
2555 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Total count of all security policy rule tuples. A security
2556 # policy can not exceed a set number of tuples.
2557 &quot;rules&quot;: [ # A list of rules that belong to this policy.
2558 # There must always be a default rule which is a rule with priority
2559 # 2147483647 and match all condition (for the match condition this means
2560 # match &quot;*&quot; for srcIpRanges and for the networkMatch condition every field
2561 # must be either match &quot;*&quot; or not set). If no rules are provided when
2562 # creating a security policy, a default rule with action &quot;allow&quot; will be
2563 # added.
2564 { # Represents a rule that describes one or more match conditions along with
2565 # the action to be taken when traffic matches this condition (allow or deny).
2566 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the rule is matched.
2567 # The following are the valid actions:
2568 #
2569 # - allow: allow access to target.
2570 # - deny(STATUS): deny access to target, returns the
2571 # HTTP response code specified. Valid values for `STATUS`
2572 # are 403, 404, and 502.
2573 # - rate_based_ban: limit client traffic to the configured
2574 # threshold and ban the client if the traffic exceeds the threshold.
2575 # Configure parameters for this action in RateLimitOptions. Requires
2576 # rate_limit_options to be set.
2577 # - redirect: redirect to a different target. This can
2578 # either be an internal reCAPTCHA redirect, or an external URL-based
2579 # redirect via a 302 response. Parameters for this action can be configured
2580 # via redirectOptions. This action is only supported in Global Security
2581 # Policies of type CLOUD_ARMOR.
2582 # - throttle: limit
2583 # client traffic to the configured threshold. Configure parameters for this
2584 # action in rateLimitOptions. Requires rate_limit_options to be set for
2585 # this.
2586 # - fairshare (preview only): when traffic reaches the
2587 # threshold limit, requests from the clients matching this rule begin to be
2588 # rate-limited using the Fair Share algorithm. This action is only allowed
2589 # in security policies of type `CLOUD_ARMOR_INTERNAL_SERVICE`.
2590 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
2591 # create the resource.
2592 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies. This field may only be
2593 # specified when versioned_expr is set to FIREWALL.
2594 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is
2595 # enabled, logs will be exported to the configured export destination in
2596 # Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you
2597 # cannot enable logging on &quot;goto_next&quot; rules.
2598 #
2599 # This field may only be specified when the versioned_expr is set to
2600 # FIREWALL.
2601 &quot;headerAction&quot;: { # Optional, additional actions that are performed on headers.
2602 # This field is only supported in Global Security Policies of type
2603 # CLOUD_ARMOR.
2604 &quot;requestHeadersToAdds&quot;: [ # The list of request headers to add or overwrite if they&#x27;re already
2605 # present.
2606 {
2607 &quot;headerName&quot;: &quot;A String&quot;, # The name of the header to set.
2608 &quot;headerValue&quot;: &quot;A String&quot;, # The value to set the named header to.
2609 },
2610 ],
2611 },
2612 &quot;kind&quot;: &quot;compute#securityPolicyRule&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyRule for security policy rules
2613 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. # A match condition that incoming traffic is evaluated against.
2614 # If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
2615 # Exactly one field must be specified.
2616 &quot;config&quot;: { # The configuration options available when specifying versioned_expr.
2617 # This field must be specified if versioned_expr is specified and cannot
2618 # be specified if versioned_expr is not specified.
2619 &quot;destIpRanges&quot;: [ # CIDR IP address range.
2620 #
2621 # This field may only be specified when versioned_expr is set to
2622 # FIREWALL.
2623 &quot;A String&quot;,
2624 ],
2625 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
2626 #
2627 # This field may only be specified when versioned_expr is set to
2628 # FIREWALL.
2629 {
2630 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is
2631 # required when creating a firewall rule. This value can either be
2632 # one of the following well known protocol strings (tcp,udp, icmp, esp,ah, ipip, sctp), or the IP
2633 # protocol number.
2634 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is
2635 # only applicable for UDP or TCP protocol. Each entry must be either
2636 # an integer or a range. If not specified, this rule applies to
2637 # connections through any port.
2638 #
2639 # Example inputs include: [&quot;22&quot;],[&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
2640 #
2641 # This field may only be specified when versioned_expr is set to
2642 # FIREWALL.
2643 &quot;A String&quot;,
2644 ],
2645 },
2646 ],
2647 &quot;srcIpRanges&quot;: [ # CIDR IP address range.
2648 # Maximum number of src_ip_ranges allowed is 10.
2649 &quot;A String&quot;,
2650 ],
2651 },
2652 &quot;expr&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # User defined CEVAL expression.
2653 # A CEVAL expression is used to specify match criteria such as origin.ip,
2654 # source.region_code and contents in the request header.
2655 # Expressions containing `evaluateThreatIntelligence` require a Cloud
2656 # Armor Enterprise subscription and are not supported in Edge Policies
2657 # nor in Regional Policies. Expressions containing
2658 # `evaluatePreconfiguredExpr(&#x27;sourceiplist-*&#x27;)` require a Cloud Armor
2659 # Enterprise subscription and are only supported in Global Security
2660 # Policies.
2661 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
2662 # are documented at https://github.com/google/cel-spec.
2663 #
2664 # Example (Comparison):
2665 #
2666 # title: &quot;Summary size limit&quot;
2667 # description: &quot;Determines if a summary is less than 100 chars&quot;
2668 # expression: &quot;document.summary.size() &lt; 100&quot;
2669 #
2670 # Example (Equality):
2671 #
2672 # title: &quot;Requestor is owner&quot;
2673 # description: &quot;Determines if requestor is the document owner&quot;
2674 # expression: &quot;document.owner == request.auth.claims.email&quot;
2675 #
2676 # Example (Logic):
2677 #
2678 # title: &quot;Public documents&quot;
2679 # description: &quot;Determine whether the document should be publicly visible&quot;
2680 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
2681 #
2682 # Example (Data Manipulation):
2683 #
2684 # title: &quot;Notification string&quot;
2685 # description: &quot;Create a notification string with a timestamp.&quot;
2686 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
2687 #
2688 # The exact variables and functions that may be referenced within an expression
2689 # are determined by the service that evaluates it. See the service
2690 # documentation for additional information.
2691 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
2692 # describes the expression, e.g. when hovered over it in a UI.
2693 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
2694 # syntax.
2695 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
2696 # reporting, e.g. a file name and a position in the file.
2697 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
2698 # its purpose. This can be used e.g. in UIs which allow to enter the
2699 # expression.
2700 },
2701 &quot;exprOptions&quot;: { # The configuration options available when specifying a user defined
2702 # CEVAL expression (i.e., &#x27;expr&#x27;).
2703 &quot;recaptchaOptions&quot;: { # reCAPTCHA configuration options to be applied for the rule. If the
2704 # rule does not evaluate reCAPTCHA tokens, this field has no effect.
2705 &quot;actionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
2706 # action-tokens. The provided site keys need to be created from
2707 # reCAPTCHA API under the same project where the security policy is
2708 # created.
2709 &quot;A String&quot;,
2710 ],
2711 &quot;sessionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
2712 # session-tokens. The provided site keys need to be created from
2713 # reCAPTCHA API under the same project where the security policy is
2714 # created.
2715 &quot;A String&quot;,
2716 ],
2717 },
2718 },
2719 &quot;versionedExpr&quot;: &quot;A String&quot;, # Preconfigured versioned expression.
2720 # If this field is specified, config must also be specified.
2721 # Available preconfigured expressions along with their requirements are:
2722 # SRC_IPS_V1 - must specify the corresponding src_ip_range field in
2723 # config.
2724 },
2725 &quot;networkMatch&quot;: { # Represents a match condition that incoming network traffic is evaluated # A match condition that incoming packets are evaluated against for
2726 # CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding
2727 # &#x27;action&#x27; is enforced.
2728 #
2729 # The match criteria for a rule consists of built-in match fields (like
2730 # &#x27;srcIpRanges&#x27;) and potentially multiple user-defined match fields
2731 # (&#x27;userDefinedFields&#x27;).
2732 #
2733 # Field values may be extracted directly from the packet or derived from it
2734 # (e.g. &#x27;srcRegionCodes&#x27;). Some fields may not be present in every packet
2735 # (e.g. &#x27;srcPorts&#x27;). A user-defined field is only present if the base
2736 # header is found in the packet and the entire field is in bounds.
2737 #
2738 # Each match field may specify which values can match it, listing one or
2739 # more ranges, prefixes, or exact values that are considered a match for
2740 # the field. A field value must be present in order to match a specified
2741 # match field. If no match values are specified for a match field, then any
2742 # field value is considered to match it, and it&#x27;s not required to be
2743 # present. For strings specifying &#x27;*&#x27; is also equivalent to match all.
2744 #
2745 # For a packet to match a rule, all specified match fields must match the
2746 # corresponding field values derived from the packet.
2747 #
2748 # Example:
2749 #
2750 # networkMatch:
2751 # srcIpRanges:
2752 # - &quot;192.0.2.0/24&quot;
2753 # - &quot;198.51.100.0/24&quot;
2754 # userDefinedFields:
2755 # - name: &quot;ipv4_fragment_offset&quot;
2756 # values:
2757 # - &quot;1-0x1fff&quot;
2758 #
2759 # The above match condition matches packets with a source IP in
2760 # 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named
2761 # &quot;ipv4_fragment_offset&quot; with a value between 1 and 0x1fff inclusive.
2762 # against.
2763 &quot;destIpRanges&quot;: [ # Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text
2764 # format.
2765 &quot;A String&quot;,
2766 ],
2767 &quot;destPorts&quot;: [ # Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
2768 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
2769 &quot;A String&quot;,
2770 ],
2771 &quot;ipProtocols&quot;: [ # IPv4 protocol / IPv6 next header (after extension headers). Each
2772 # element can be an 8-bit unsigned decimal number (e.g. &quot;6&quot;), range (e.g.
2773 # &quot;253-254&quot;), or one of the following protocol names: &quot;tcp&quot;, &quot;udp&quot;,
2774 # &quot;icmp&quot;, &quot;esp&quot;, &quot;ah&quot;, &quot;ipip&quot;, or &quot;sctp&quot;.
2775 &quot;A String&quot;,
2776 ],
2777 &quot;srcAsns&quot;: [ # BGP Autonomous System Number associated with the source IP address.
2778 42,
2779 ],
2780 &quot;srcIpRanges&quot;: [ # Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
2781 &quot;A String&quot;,
2782 ],
2783 &quot;srcPorts&quot;: [ # Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
2784 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
2785 &quot;A String&quot;,
2786 ],
2787 &quot;srcRegionCodes&quot;: [ # Two-letter ISO 3166-1 alpha-2 country code associated with the source
2788 # IP address.
2789 &quot;A String&quot;,
2790 ],
2791 &quot;userDefinedFields&quot;: [ # User-defined fields. Each element names a defined field and lists the
2792 # matching values for that field.
2793 {
2794 &quot;name&quot;: &quot;A String&quot;, # Name of the user-defined field, as given in the definition.
2795 &quot;values&quot;: [ # Matching values of the field. Each element can be a 32-bit unsigned
2796 # decimal or hexadecimal (starting with &quot;0x&quot;) number (e.g. &quot;64&quot;) or
2797 # range (e.g. &quot;0x400-0x7ff&quot;).
2798 &quot;A String&quot;,
2799 ],
2800 },
2801 ],
2802 },
2803 &quot;preconfiguredWafConfig&quot;: { # Preconfigured WAF configuration to be applied for the rule. If the rule
2804 # does not evaluate preconfigured WAF rules, i.e., if
2805 # evaluatePreconfiguredWaf() is not used, this field will have no effect.
2806 &quot;exclusions&quot;: [ # A list of exclusions to apply during preconfigured WAF evaluation.
2807 {
2808 &quot;requestBodiesToExclude&quot;: [ # A list of request body fields to be excluded from inspection during
2809 # preconfigured WAF evaluation.
2810 {
2811 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
2812 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
2813 },
2814 ],
2815 &quot;requestCookiesToExclude&quot;: [ # A list of request cookie names whose value will be excluded from
2816 # inspection during preconfigured WAF evaluation.
2817 {
2818 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
2819 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
2820 },
2821 ],
2822 &quot;requestHeadersToExclude&quot;: [ # A list of request header names whose value will be excluded from
2823 # inspection during preconfigured WAF evaluation.
2824 {
2825 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
2826 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
2827 },
2828 ],
2829 &quot;requestQueryParamsToExclude&quot;: [ # A list of request query parameter names whose value will be excluded
2830 # from inspection during preconfigured WAF evaluation. Note that the
2831 # parameter can be in the query string or in the POST body.
2832 {
2833 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
2834 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
2835 },
2836 ],
2837 &quot;requestUrisToExclude&quot;: [ # A list of request URIs from the request line to be excluded from
2838 # inspection during preconfigured WAF evaluation. When specifying this
2839 # field, the query or fragment part should be excluded.
2840 {
2841 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
2842 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
2843 },
2844 ],
2845 &quot;targetRuleIds&quot;: [ # A list of target rule IDs under the WAF rule set to apply the
2846 # preconfigured WAF exclusion. If omitted, it refers to all the rule
2847 # IDs under the WAF rule set.
2848 &quot;A String&quot;,
2849 ],
2850 &quot;targetRuleSet&quot;: &quot;A String&quot;, # Target WAF rule set to apply the preconfigured WAF exclusion.
2851 },
2852 ],
2853 },
2854 &quot;preview&quot;: True or False, # If set to true, the specified action is not enforced.
2855 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority
2856 # must be a positive value between 0 and 2147483647.
2857 # Rules are evaluated from highest to lowest priority where 0 is the
2858 # highest priority and 2147483647 is the lowest priority.
2859 &quot;rateLimitOptions&quot;: { # Must be specified if the action is &quot;rate_based_ban&quot; or &quot;throttle&quot; or
2860 # &quot;fairshare&quot;. Cannot be specified for any other actions.
2861 &quot;banDurationSec&quot;: 42, # Can only be specified if the action for the rule is
2862 # &quot;rate_based_ban&quot;. If specified, determines the time (in seconds)
2863 # the traffic will continue to be banned by the rate limit after the
2864 # rate falls below the threshold.
2865 &quot;banThreshold&quot;: { # Can only be specified if the action for the rule is
2866 # &quot;rate_based_ban&quot;. If specified, the key will be banned for the
2867 # configured &#x27;ban_duration_sec&#x27; when the number of requests that exceed
2868 # the &#x27;rate_limit_threshold&#x27; also exceed this &#x27;ban_threshold&#x27;.
2869 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
2870 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
2871 },
2872 &quot;conformAction&quot;: &quot;A String&quot;, # Action to take for requests that are under the configured rate limit
2873 # threshold. Valid option is &quot;allow&quot; only.
2874 &quot;enforceOnKey&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
2875 # values are:
2876 #
2877 # - ALL: A single rate limit threshold is applied to all
2878 # the requests matching this rule. This is the default value if
2879 # &quot;enforceOnKey&quot; is not configured.
2880 # - IP: The source IP address of
2881 # the request is the key. Each IP has this limit enforced
2882 # separately.
2883 # - HTTP_HEADER: The value of the HTTP
2884 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
2885 # value is truncated to the first 128 bytes of the header value. If no
2886 # such header is present in the request, the key type defaults toALL.
2887 # - XFF_IP: The first IP address (i.e. the
2888 # originating client IP address) specified in the list of IPs under
2889 # X-Forwarded-For HTTP header. If no such header is present or the value
2890 # is not a valid IP, the key defaults to the source IP address of
2891 # the request i.e. key type IP.
2892 # - HTTP_COOKIE: The value of the HTTP
2893 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
2894 # value is truncated to the first 128 bytes of the cookie value. If no
2895 # such cookie is present in the request, the key type defaults toALL.
2896 # - HTTP_PATH: The URL path of the HTTP request. The key
2897 # value is truncated to the first 128 bytes.
2898 # - SNI: Server name indication in the TLS session of the
2899 # HTTPS request. The key value is truncated to the first 128 bytes. The
2900 # key type defaults to ALL on a HTTP session.
2901 # - REGION_CODE: The country/region from which the request
2902 # originates.
2903 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
2904 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
2905 # key type defaults to ALL.
2906 # - USER_IP: The IP address of the originating client,
2907 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
2908 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration or
2909 # an IP address cannot be resolved from it, the key type defaults toIP.
2910 #
2911 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
2912 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
2913 # key type defaults to ALL.
2914 # For &quot;fairshare&quot; action, this value is limited to ALL i.e. a single rate
2915 # limit threshold is enforced for all the requests matching the rule.
2916 &quot;enforceOnKeyConfigs&quot;: [ # If specified, any combination of values of
2917 # enforce_on_key_type/enforce_on_key_name is treated as the key on which
2918 # ratelimit threshold/action is enforced. You can specify up to 3
2919 # enforce_on_key_configs. If enforce_on_key_configs is specified,
2920 # enforce_on_key must not be specified.
2921 {
2922 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
2923 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the
2924 # key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is
2925 # taken as the key value.
2926 &quot;enforceOnKeyType&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
2927 # values are:
2928 #
2929 # - ALL: A single rate limit threshold is applied to all
2930 # the requests matching this rule. This is the default value if
2931 # &quot;enforceOnKeyConfigs&quot; is not configured.
2932 # - IP: The source IP address of
2933 # the request is the key. Each IP has this limit enforced
2934 # separately.
2935 # - HTTP_HEADER: The value of the HTTP
2936 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
2937 # value is truncated to the first 128 bytes of the header value. If no
2938 # such header is present in the request, the key type defaults toALL.
2939 # - XFF_IP: The first IP address (i.e. the
2940 # originating client IP address) specified in the list of IPs under
2941 # X-Forwarded-For HTTP header. If no such header is present or the
2942 # value is not a valid IP, the key defaults to the source IP address of
2943 # the request i.e. key type IP.
2944 # - HTTP_COOKIE: The value of the HTTP
2945 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
2946 # value is truncated to the first 128 bytes of the cookie value. If no
2947 # such cookie is present in the request, the key type defaults toALL.
2948 # - HTTP_PATH: The URL path of the HTTP request. The key
2949 # value is truncated to the first 128 bytes.
2950 # - SNI: Server name indication in the TLS session of
2951 # the HTTPS request. The key value is truncated to the first 128 bytes.
2952 # The key type defaults to ALL on a HTTP session.
2953 # - REGION_CODE: The country/region from which the
2954 # request originates.
2955 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
2956 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
2957 # key type defaults to ALL.
2958 # - USER_IP: The IP address of the originating client,
2959 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
2960 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration
2961 # or an IP address cannot be resolved from it, the key type defaults toIP.
2962 #
2963 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
2964 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
2965 # key type defaults to ALL.
2966 },
2967 ],
2968 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
2969 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the key
2970 # value.
2971 # HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key
2972 # value.
2973 &quot;exceedAction&quot;: &quot;A String&quot;, # Action to take for requests that are above the configured rate limit
2974 # threshold, to either deny with a specified HTTP response code, or
2975 # redirect to a different endpoint.
2976 # Valid options are `deny(STATUS)`, where valid values for
2977 # `STATUS` are 403, 404, 429, and 502, and
2978 # `redirect`, where the redirect parameters come from
2979 # `exceedRedirectOptions` below.
2980 # The `redirect` action is only supported in Global Security Policies of
2981 # type CLOUD_ARMOR.
2982 &quot;exceedRedirectOptions&quot;: { # Parameters defining the redirect action that is used as the exceed
2983 # action. Cannot be specified if the exceed action is not redirect.
2984 # This field is only supported in Global Security Policies of type
2985 # CLOUD_ARMOR.
2986 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
2987 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
2988 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
2989 #
2990 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
2991 # challenge assessment.
2992 # - EXTERNAL_302: redirect to a different URL via a 302
2993 # response.
2994 },
2995 &quot;rateLimitThreshold&quot;: { # Threshold at which to begin ratelimiting.
2996 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
2997 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
2998 },
2999 },
3000 &quot;redirectOptions&quot;: { # Parameters defining the redirect action. Cannot be specified for any
3001 # other actions.
3002 # This field is only supported in Global Security Policies of type
3003 # CLOUD_ARMOR.
3004 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
3005 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
3006 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
3007 #
3008 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
3009 # challenge assessment.
3010 # - EXTERNAL_302: redirect to a different URL via a 302
3011 # response.
3012 },
3013 &quot;ruleNumber&quot;: &quot;A String&quot;, # Identifier for the rule. This is only unique within the given security
3014 # policy. This can only be set during rule creation, if rule number is not
3015 # specified it will be generated by the server.
3016 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Calculation of the complexity of a single firewall security
3017 # policy rule.
3018 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field
3019 # allows you to control which network&#x27;s VMs get this rule. If this field
3020 # is left blank, all VMs within the organization will receive the rule.
3021 #
3022 # This field may only be specified when versioned_expr is set to FIREWALL.
3023 &quot;A String&quot;,
3024 ],
3025 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are
3026 # applied with this rule.
3027 &quot;A String&quot;,
3028 ],
3029 },
3030 ],
3031 &quot;selfLink&quot;: &quot;A String&quot;, # Output only. [Output Only] Server-defined URL for the resource.
3032 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # Output only. [Output Only] Server-defined URL for this resource with the resource id.
3033 &quot;shortName&quot;: &quot;A String&quot;, # User-provided name of the organization security policy. The name should be
3034 # unique in the organization in which the security policy is created. This
3035 # should only be used when SecurityPolicyType is CLOUD_ARMOR.
3036 # The name must be 1-63 characters long, and comply with
3037 # https://www.ietf.org/rfc/rfc1035.txt. Specifically, the name must be 1-63
3038 # characters long and match the regular expression
3039 # `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a
3040 # lowercase letter, and all following characters must be a dash, lowercase
3041 # letter, or digit, except the last character, which cannot be a dash.
3042 &quot;type&quot;: &quot;A String&quot;, # The type indicates the intended use of the security policy.
3043 #
3044 # - CLOUD_ARMOR: Cloud Armor backend security policies can
3045 # be configured to filter incoming HTTP requests targeting backend services.
3046 # They filter requests before they hit the origin servers.
3047 # - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can
3048 # be configured to filter incoming HTTP requests targeting backend services
3049 # (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage).
3050 # They filter requests before the request is served from Google&#x27;s cache.
3051 # - CLOUD_ARMOR_INTERNAL_SERVICE (preview only): Cloud Armor
3052 # internal service policies can be configured to filter HTTP requests
3053 # targeting services managed by Traffic Director in a service mesh. They
3054 # filter requests before the request is served from the application.
3055 #
3056 # - CLOUD_ARMOR_NETWORK: Cloud Armor network policies
3057 # can be configured to filter packets targeting network load balancing
3058 # resources such as backend services, target pools, target instances, and
3059 # instances with external IPs. They filter requests before the request is
3060 # served from the application.
3061 #
3062 #
3063 # This field can be set only at resource creation time.
3064 &quot;userDefinedFields&quot;: [ # Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A
3065 # user-defined field consists of up to 4 bytes extracted from a fixed offset
3066 # in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an
3067 # optional mask to select certain bits. Rules may then specify matching
3068 # values for these fields.
3069 #
3070 # Example:
3071 #
3072 # userDefinedFields:
3073 # - name: &quot;ipv4_fragment_offset&quot;
3074 # base: IPV4
3075 # offset: 6
3076 # size: 2
3077 # mask: &quot;0x1fff&quot;
3078 {
3079 &quot;base&quot;: &quot;A String&quot;, # The base relative to which &#x27;offset&#x27; is measured. Possible values are:
3080 #
3081 # - IPV4: Points to the beginning of the IPv4 header.
3082 # - IPV6: Points to the beginning of the IPv6 header.
3083 # - TCP: Points to the beginning of the TCP header, skipping
3084 # over any IPv4 options or IPv6 extension headers. Not present for
3085 # non-first fragments.
3086 # - UDP: Points to the beginning of the UDP header, skipping
3087 # over any IPv4 options or IPv6 extension headers. Not present for
3088 # non-first fragments.
3089 #
3090 #
3091 # required
3092 &quot;mask&quot;: &quot;A String&quot;, # If specified, apply this mask (bitwise AND) to the field to ignore bits
3093 # before matching. Encoded as a hexadecimal number (starting with &quot;0x&quot;).
3094 # The last byte of the field (in network byte order) corresponds to the
3095 # least significant byte of the mask.
3096 &quot;name&quot;: &quot;A String&quot;, # The name of this field. Must be unique within the policy.
3097 &quot;offset&quot;: 42, # Offset of the first byte of the field (in network byte order) relative to
3098 # &#x27;base&#x27;.
3099 &quot;size&quot;: 42, # Size of the field in bytes. Valid values: 1-4.
3100 },
3101 ],
3102 }
3103
3104 requestId: string, An optional request ID to identify requests. Specify a unique request ID so
3105 that if you must retry your request, the server will know to ignore the
3106 request if it has already been completed.
3107
3108 For example, consider a situation where you make an initial request and
3109 the request times out. If you make the request again with the same
3110 request ID, the server can check if original operation with the same
3111 request ID was received, and if so, will ignore the second request. This
3112 prevents clients from accidentally creating duplicate commitments.
3113
3114 The request ID must be
3115 a valid UUID with the exception that zero UUID is not supported
3116 (00000000-0000-0000-0000-000000000000).
3117 validateOnly: boolean, If true, the request will not be committed.
3118 x__xgafv: string, V1 error format.
3119 Allowed values
3120 1 - v1 error format
3121 2 - v2 error format
3122
3123 Returns:
3124 An object of the form:
3125
3126 { # Represents an Operation resource.
3127 #
3128 # Google Compute Engine has three Operation resources:
3129 #
3130 # * [Global](/compute/docs/reference/rest/beta/globalOperations)
3131 # * [Regional](/compute/docs/reference/rest/beta/regionOperations)
3132 # * [Zonal](/compute/docs/reference/rest/beta/zoneOperations)
3133 #
3134 # You can use an operation resource to manage asynchronous API requests.
3135 # For more information, readHandling
3136 # API responses.
3137 #
3138 # Operations can be global, regional or zonal.
3139 #
3140 # - For global operations, use the `globalOperations`
3141 # resource.
3142 # - For regional operations, use the
3143 # `regionOperations` resource.
3144 # - For zonal operations, use
3145 # the `zoneOperations` resource.
3146 #
3147 #
3148 #
3149 # For more information, read
3150 # Global, Regional, and Zonal Resources.
3151 #
3152 # Note that completed Operation resources have a limited
3153 # retention period.
3154 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request.
3155 # Not present otherwise.
3156 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
3157 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is
3158 # set when the operation is created.
3159 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is inRFC3339
3160 # text format.
3161 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation,
3162 # this field will be populated.
3163 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this
3164 # operation.
3165 {
3166 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
3167 &quot;errorDetails&quot;: [ # [Output Only] An optional list of messages that contain the error
3168 # details. There is a set of defined message types to use for providing
3169 # details.The syntax depends on the error code. For example,
3170 # QuotaExceededInfo will have details when the error code is
3171 # QUOTA_EXCEEDED.
3172 {
3173 &quot;errorInfo&quot;: { # Describes the cause of the error with structured details.
3174 #
3175 # Example of an error when contacting the &quot;pubsub.googleapis.com&quot; API when it
3176 # is not enabled:
3177 #
3178 # { &quot;reason&quot;: &quot;API_DISABLED&quot;
3179 # &quot;domain&quot;: &quot;googleapis.com&quot;
3180 # &quot;metadata&quot;: {
3181 # &quot;resource&quot;: &quot;projects/123&quot;,
3182 # &quot;service&quot;: &quot;pubsub.googleapis.com&quot;
3183 # }
3184 # }
3185 #
3186 # This response indicates that the pubsub.googleapis.com API is not enabled.
3187 #
3188 # Example of an error that is returned when attempting to create a Spanner
3189 # instance in a region that is out of stock:
3190 #
3191 # { &quot;reason&quot;: &quot;STOCKOUT&quot;
3192 # &quot;domain&quot;: &quot;spanner.googleapis.com&quot;,
3193 # &quot;metadata&quot;: {
3194 # &quot;availableRegions&quot;: &quot;us-central1,us-east2&quot;
3195 # }
3196 # }
3197 &quot;domain&quot;: &quot;A String&quot;, # The logical grouping to which the &quot;reason&quot; belongs. The error domain
3198 # is typically the registered service name of the tool or product that
3199 # generates the error. Example: &quot;pubsub.googleapis.com&quot;. If the error is
3200 # generated by some common infrastructure, the error domain must be a
3201 # globally unique value that identifies the infrastructure. For Google API
3202 # infrastructure, the error domain is &quot;googleapis.com&quot;.
3203 &quot;metadatas&quot;: { # Additional structured details about this error.
3204 #
3205 # Keys must match a regular expression of `a-z+` but should
3206 # ideally be lowerCamelCase. Also, they must be limited to 64 characters in
3207 # length. When identifying the current value of an exceeded limit, the units
3208 # should be contained in the key, not the value. For example, rather than
3209 # `{&quot;instanceLimit&quot;: &quot;100/request&quot;}`, should be returned as,
3210 # `{&quot;instanceLimitPerRequest&quot;: &quot;100&quot;}`, if the client exceeds the number of
3211 # instances that can be created in a single (batch) request.
3212 &quot;a_key&quot;: &quot;A String&quot;,
3213 },
3214 &quot;reason&quot;: &quot;A String&quot;, # The reason of the error. This is a constant value that identifies the
3215 # proximate cause of the error. Error reasons are unique within a particular
3216 # domain of errors. This should be at most 63 characters and match a
3217 # regular expression of `A-Z+[A-Z0-9]`, which represents
3218 # UPPER_SNAKE_CASE.
3219 },
3220 &quot;help&quot;: { # Provides links to documentation or for performing an out of band action.
3221 #
3222 # For example, if a quota check failed with an error indicating the calling
3223 # project hasn&#x27;t enabled the accessed service, this can contain a URL pointing
3224 # directly to the right place in the developer console to flip the bit.
3225 &quot;links&quot;: [ # URL(s) pointing to additional information on handling the current error.
3226 { # Describes a URL link.
3227 &quot;description&quot;: &quot;A String&quot;, # Describes what the link offers.
3228 &quot;url&quot;: &quot;A String&quot;, # The URL of the link.
3229 },
3230 ],
3231 },
3232 &quot;localizedMessage&quot;: { # Provides a localized error message that is safe to return to the user
3233 # which can be attached to an RPC error.
3234 &quot;locale&quot;: &quot;A String&quot;, # The locale used following the specification defined at
3235 # https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
3236 # Examples are: &quot;en-US&quot;, &quot;fr-CH&quot;, &quot;es-MX&quot;
3237 &quot;message&quot;: &quot;A String&quot;, # The localized error message in the above locale.
3238 },
3239 &quot;quotaInfo&quot;: { # Additional details for quota exceeded error for resource quota.
3240 &quot;dimensions&quot;: { # The map holding related quota dimensions.
3241 &quot;a_key&quot;: &quot;A String&quot;,
3242 },
3243 &quot;futureLimit&quot;: 3.14, # Future quota limit being rolled out. The limit&#x27;s unit depends on the quota
3244 # type or metric.
3245 &quot;limit&quot;: 3.14, # Current effective quota limit. The limit&#x27;s unit depends on the quota type
3246 # or metric.
3247 &quot;limitName&quot;: &quot;A String&quot;, # The name of the quota limit.
3248 &quot;metricName&quot;: &quot;A String&quot;, # The Compute Engine quota metric name.
3249 &quot;rolloutStatus&quot;: &quot;A String&quot;, # Rollout status of the future quota limit.
3250 },
3251 },
3252 ],
3253 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error.
3254 # This property is optional.
3255 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
3256 },
3257 ],
3258 },
3259 &quot;getVersionOperationMetadata&quot;: {
3260 &quot;inlineSbomInfo&quot;: {
3261 &quot;currentComponentVersions&quot;: { # A mapping of components to their currently-applied versions or other
3262 # appropriate identifiers.
3263 &quot;a_key&quot;: &quot;A String&quot;,
3264 },
3265 &quot;targetComponentVersions&quot;: { # A mapping of components to their target versions or other appropriate
3266 # identifiers.
3267 &quot;a_key&quot;: &quot;A String&quot;,
3268 },
3269 },
3270 },
3271 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error
3272 # message that was returned, such as `NOT FOUND`.
3273 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error
3274 # status code that was returned. For example, a `404` means the
3275 # resource was not found.
3276 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is
3277 # defined by the server.
3278 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested.
3279 # This value is inRFC3339
3280 # text format.
3281 &quot;instancesBulkInsertOperationMetadata&quot;: {
3282 &quot;perLocationStatus&quot;: { # Status information per location (location name is key).
3283 # Example key: zones/us-central1-a
3284 &quot;a_key&quot;: {
3285 &quot;createdVmCount&quot;: 42, # [Output Only] Count of VMs successfully created so far.
3286 &quot;deletedVmCount&quot;: 42, # [Output Only] Count of VMs that got deleted during rollback.
3287 &quot;failedToCreateVmCount&quot;: 42, # [Output Only] Count of VMs that started creating but encountered an
3288 # error.
3289 &quot;status&quot;: &quot;A String&quot;, # [Output Only] Creation status of BulkInsert operation - information
3290 # if the flow is rolling forward or rolling back.
3291 &quot;targetVmCount&quot;: 42, # [Output Only] Count of VMs originally planned to be created.
3292 },
3293 },
3294 },
3295 &quot;kind&quot;: &quot;compute#operation&quot;, # Output only. [Output Only] Type of the resource. Always `compute#operation` for
3296 # Operation resources.
3297 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
3298 &quot;operationGroupId&quot;: &quot;A String&quot;, # Output only. [Output Only] An ID that represents a group of operations, such as when a
3299 # group of operations results from a `bulkInsert` API request.
3300 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`,
3301 # `update`, or `delete`, and so on.
3302 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100.
3303 # There is no requirement that this be linear or support any granularity of
3304 # operations. This should not be used to guess when the operation will be
3305 # complete. This number should monotonically increase as the operation
3306 # progresses.
3307 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only
3308 # applicable when performing regional operations.
3309 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
3310 &quot;setCommonInstanceMetadataOperationMetadata&quot;: { # Output only. [Output Only] If the operation is for projects.setCommonInstanceMetadata,
3311 # this field will contain information on all underlying zonal actions and
3312 # their state.
3313 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The client operation id.
3314 &quot;perLocationOperations&quot;: { # [Output Only] Status information per location (location name is key).
3315 # Example key: zones/us-central1-a
3316 &quot;a_key&quot;: {
3317 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is
3318 # populated.
3319 # different programming environments, including REST APIs and RPC APIs. It is
3320 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3321 # three pieces of data: error code, error message, and error details.
3322 #
3323 # You can find out more about this error model and how to work with it in the
3324 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3325 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
3326 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
3327 # message types for APIs to use.
3328 {
3329 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
3330 },
3331 ],
3332 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
3333 # user-facing error message should be localized and sent in the
3334 # google.rpc.Status.details field, or localized by the client.
3335 },
3336 &quot;state&quot;: &quot;A String&quot;, # [Output Only] Status of the action, which can be one of the following:
3337 # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`.
3338 },
3339 },
3340 },
3341 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server.
3342 # This value is inRFC3339
3343 # text format.
3344 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the
3345 # following:
3346 # `PENDING`, `RUNNING`, or `DONE`.
3347 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the
3348 # operation.
3349 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation
3350 # of the target resource.
3351 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For
3352 # operations related to creating a snapshot, this points to the disk
3353 # that the snapshot was created from.
3354 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example:
3355 # `[email protected]` or
3356 # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`.
3357 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the
3358 # operation, this field will be populated.
3359 {
3360 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute
3361 # Engine returns NO_RESULTS_ON_PAGE if there
3362 # are no results in the response.
3363 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key:
3364 # value format. For example:
3365 #
3366 # &quot;data&quot;: [
3367 # {
3368 # &quot;key&quot;: &quot;scope&quot;,
3369 # &quot;value&quot;: &quot;zones/us-east1-d&quot;
3370 # }
3371 {
3372 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being
3373 # returned. For example, for warnings where there are no results in a list
3374 # request for a particular zone, this key might be scope and
3375 # the key value might be the zone name. Other examples might be a key
3376 # indicating a deprecated resource and a suggested replacement, or a
3377 # warning about invalid network settings (for example, if an instance
3378 # attempts to perform IP forwarding but is not enabled for IP forwarding).
3379 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
3380 },
3381 ],
3382 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
3383 },
3384 ],
3385 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only
3386 # applicable when performing per-zone operations.
3387 }</pre>
3388 </div>
3389
3390 <div class="method">
3391 <code class="details" id="list">list(project, region, filter=None, maxResults=None, orderBy=None, pageToken=None, returnPartialSuccess=None, x__xgafv=None)</code>
3392 <pre>List all the policies that have been configured for the specified project
3393 and region.
3394
3395 Args:
3396 project: string, Project ID for this request. (required)
3397 region: string, Name of the region scoping this request. (required)
3398 filter: string, A filter expression that filters resources listed in the response. Most
3399 Compute resources support two types of filter expressions:
3400 expressions that support regular expressions and expressions that follow
3401 API improvement proposal AIP-160.
3402 These two types of filter expressions cannot be mixed in one request.
3403
3404 If you want to use AIP-160, your expression must specify the field name, an
3405 operator, and the value that you want to use for filtering. The value
3406 must be a string, a number, or a boolean. The operator
3407 must be either `=`, `!=`, `&gt;`, `&lt;`, `&lt;=`, `&gt;=` or `:`.
3408
3409 For example, if you are filtering Compute Engine instances, you can
3410 exclude instances named `example-instance` by specifying
3411 `name != example-instance`.
3412
3413 The `:*` comparison can be used to test whether a key has been defined.
3414 For example, to find all objects with `owner` label use:
3415 ```
3416 labels.owner:*
3417 ```
3418
3419 You can also filter nested fields. For example, you could specify
3420 `scheduling.automaticRestart = false` to include instances only
3421 if they are not scheduled for automatic restarts. You can use filtering
3422 on nested fields to filter based onresource labels.
3423
3424 To filter on multiple expressions, provide each separate expression within
3425 parentheses. For example:
3426 ```
3427 (scheduling.automaticRestart = true)
3428 (cpuPlatform = &quot;Intel Skylake&quot;)
3429 ```
3430 By default, each expression is an `AND` expression. However, you
3431 can include `AND` and `OR` expressions explicitly.
3432 For example:
3433 ```
3434 (cpuPlatform = &quot;Intel Skylake&quot;) OR
3435 (cpuPlatform = &quot;Intel Broadwell&quot;) AND
3436 (scheduling.automaticRestart = true)
3437 ```
3438
3439 If you want to use a regular expression, use the `eq` (equal) or `ne`
3440 (not equal) operator against a single un-parenthesized expression with or
3441 without quotes or against multiple parenthesized expressions. Examples:
3442
3443 `fieldname eq unquoted literal`
3444 `fieldname eq &#x27;single quoted literal&#x27;`
3445 `fieldname eq &quot;double quoted literal&quot;`
3446 `(fieldname1 eq literal) (fieldname2 ne &quot;literal&quot;)`
3447
3448 The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
3449 The literal value must match the entire field.
3450
3451 For example, to filter for instances that do not end with name &quot;instance&quot;,
3452 you would use `name ne .*instance`.
3453
3454 You cannot combine constraints on multiple fields using regular
3455 expressions.
3456 maxResults: integer, The maximum number of results per page that should be returned.
3457 If the number of available results is larger than `maxResults`,
3458 Compute Engine returns a `nextPageToken` that can be used to get
3459 the next page of results in subsequent list requests. Acceptable values are
3460 `0` to `500`, inclusive. (Default: `500`)
3461 orderBy: string, Sorts list results by a certain order. By default, results
3462 are returned in alphanumerical order based on the resource name.
3463
3464 You can also sort results in descending order based on the creation
3465 timestamp using `orderBy=&quot;creationTimestamp desc&quot;`. This sorts
3466 results based on the `creationTimestamp` field in
3467 reverse chronological order (newest result first). Use this to sort
3468 resources like operations so that the newest operation is returned first.
3469
3470 Currently, only sorting by `name` or
3471 `creationTimestamp desc` is supported.
3472 pageToken: string, Specifies a page token to use. Set `pageToken` to the
3473 `nextPageToken` returned by a previous list request to get
3474 the next page of results.
3475 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case
3476 of failure. The default value is false.
3477
3478 For example, when partial success behavior is enabled, aggregatedList for a
3479 single zone scope either returns all resources in the zone or no resources,
3480 with an error code.
3481 x__xgafv: string, V1 error format.
3482 Allowed values
3483 1 - v1 error format
3484 2 - v2 error format
3485
3486 Returns:
3487 An object of the form:
3488
3489 {
3490 &quot;id&quot;: &quot;A String&quot;, # [Output Only] Unique identifier for the resource; defined by the server.
3491 &quot;items&quot;: [ # A list of SecurityPolicy resources.
3492 { # Represents a Google Cloud Armor security policy resource.
3493 #
3494 # Only external backend services that use load balancers can
3495 # reference a security policy. For more information, see
3496 # Google Cloud Armor security policy overview.
3497 &quot;adaptiveProtectionConfig&quot;: { # Configuration options for Cloud Armor Adaptive Protection (CAAP).
3498 &quot;autoDeployConfig&quot;: { # Configuration options for Adaptive Protection auto-deploy feature.
3499 &quot;confidenceThreshold&quot;: 3.14,
3500 &quot;expirationSec&quot;: 42,
3501 &quot;impactedBaselineThreshold&quot;: 3.14,
3502 &quot;loadThreshold&quot;: 3.14,
3503 },
3504 &quot;layer7DdosDefenseConfig&quot;: { # Configuration options for L7 DDoS detection. # If set to true, enables Cloud Armor Machine Learning.
3505 # This field is only supported in Global Security Policies of type
3506 # CLOUD_ARMOR.
3507 &quot;enable&quot;: True or False, # If set to true, enables CAAP for L7 DDoS detection.
3508 # This field is only supported in Global Security Policies of type
3509 # CLOUD_ARMOR.
3510 &quot;ruleVisibility&quot;: &quot;A String&quot;, # Rule visibility can be one of the following:
3511 # STANDARD - opaque rules. (default)
3512 # PREMIUM - transparent rules.
3513 # This field is only supported in Global Security Policies of type
3514 # CLOUD_ARMOR.
3515 &quot;thresholdConfigs&quot;: [ # Configuration options for layer7 adaptive protection for various
3516 # customizable thresholds.
3517 {
3518 &quot;autoDeployConfidenceThreshold&quot;: 3.14,
3519 &quot;autoDeployExpirationSec&quot;: 42,
3520 &quot;autoDeployImpactedBaselineThreshold&quot;: 3.14,
3521 &quot;autoDeployLoadThreshold&quot;: 3.14,
3522 &quot;detectionAbsoluteQps&quot;: 3.14,
3523 &quot;detectionLoadThreshold&quot;: 3.14,
3524 &quot;detectionRelativeToBaselineQps&quot;: 3.14,
3525 &quot;name&quot;: &quot;A String&quot;, # The name must be 1-63 characters long, and comply withRFC1035.
3526 # The name must be unique within the security policy.
3527 &quot;trafficGranularityConfigs&quot;: [ # Configuration options for enabling Adaptive Protection to operate
3528 # on specified granular traffic units.
3529 { # Configurations to specifc granular traffic units processed by
3530 # Adaptive Protection.
3531 &quot;enableEachUniqueValue&quot;: True or False, # If enabled, traffic matching each unique value for the specified
3532 # type constitutes a separate traffic unit.
3533 # It can only be set to true if `value` is empty.
3534 &quot;type&quot;: &quot;A String&quot;, # Type of this configuration.
3535 &quot;value&quot;: &quot;A String&quot;, # Requests that match this value constitute a granular traffic unit.
3536 },
3537 ],
3538 },
3539 ],
3540 },
3541 },
3542 &quot;advancedOptionsConfig&quot;: {
3543 &quot;jsonCustomConfig&quot;: { # Custom configuration to apply the JSON parsing. Only applicable when
3544 # json_parsing is set to STANDARD.
3545 &quot;contentTypes&quot;: [ # A list of custom Content-Type header values to apply the JSON parsing.
3546 #
3547 # As per RFC 1341, a Content-Type header value has the following format:
3548 #
3549 # Content-Type := type &quot;/&quot; subtype *[&quot;;&quot; parameter]
3550 #
3551 # When configuring a custom Content-Type header value, only the
3552 # type/subtype needs to be specified, and the parameters should be
3553 # excluded.
3554 &quot;A String&quot;,
3555 ],
3556 },
3557 &quot;jsonParsing&quot;: &quot;A String&quot;,
3558 &quot;logLevel&quot;: &quot;A String&quot;,
3559 &quot;requestBodyInspectionSize&quot;: &quot;A String&quot;, # The maximum request size chosen by the customer with Waf enabled.
3560 # Values supported are &quot;8KB&quot;, &quot;16KB, &quot;32KB&quot;, &quot;48KB&quot; and &quot;64KB&quot;.
3561 # Values are case insensitive.
3562 &quot;userIpRequestHeaders&quot;: [ # An optional list of case-insensitive request header names to use for
3563 # resolving the callers client IP address.
3564 &quot;A String&quot;,
3565 ],
3566 },
3567 &quot;associations&quot;: [ # A list of associations that belong to this policy.
3568 {
3569 &quot;attachmentId&quot;: &quot;A String&quot;, # The resource that the security policy is attached to.
3570 &quot;displayName&quot;: &quot;A String&quot;, # Output only. [Output Only] The display name of the security policy of the association.
3571 &quot;excludedFolders&quot;: [ # A list of folders to exclude from the security policy.
3572 &quot;A String&quot;,
3573 ],
3574 &quot;excludedProjects&quot;: [ # A list of projects to exclude from the security policy.
3575 &quot;A String&quot;,
3576 ],
3577 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
3578 &quot;securityPolicyId&quot;: &quot;A String&quot;, # Output only. [Output Only] The security policy ID of the association.
3579 &quot;shortName&quot;: &quot;A String&quot;, # Output only. [Output Only] The short name of the security policy of the association.
3580 },
3581 ],
3582 &quot;creationTimestamp&quot;: &quot;A String&quot;, # Output only. [Output Only] Creation timestamp inRFC3339
3583 # text format.
3584 &quot;ddosProtectionConfig&quot;: {
3585 &quot;ddosAdaptiveProtection&quot;: &quot;A String&quot;,
3586 &quot;ddosImpactedBaselineThreshold&quot;: 3.14, # DDoS Protection for Network Load Balancers (and VMs with public IPs)
3587 # builds DDoS mitigations that minimize collateral damage. It quantifies
3588 # this as the fraction of a non-abuse baseline that&#x27;s inadvertently
3589 # blocked.
3590 #
3591 # Rules whose collateral damage exceeds ddosImpactedBaselineThreshold will
3592 # not be deployed. Using a lower value will prioritize keeping collateral
3593 # damage low, possibly at the cost of its effectiveness in rate limiting
3594 # some or all of the attack. It should typically be unset, so Advanced DDoS
3595 # (and Adaptive Protection) uses the best mitigation it can find. Setting
3596 # the threshold is advised if there are logs for false positive detections
3597 # with high collateral damage, and will cause Advanced DDoS to attempt to
3598 # find a less aggressive rule that satisfies the constraint. If a suitable
3599 # rule cannot be found, the system falls back to either no mitigation for
3600 # smaller attacks or broader network throttles for larger ones.
3601 &quot;ddosProtection&quot;: &quot;A String&quot;,
3602 },
3603 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
3604 # create the resource.
3605 &quot;displayName&quot;: &quot;A String&quot;, # User-provided name of the organization security policy. The name should be
3606 # unique in the organization in which the security policy is created. This
3607 # should only be used when SecurityPolicyType is FIREWALL.
3608 # The name must be 1-63 characters long, and comply with
3609 # https://www.ietf.org/rfc/rfc1035.txt. Specifically, the name must be 1-63
3610 # characters long and match the regular expression
3611 # `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a
3612 # lowercase letter, and all following characters must be a dash, lowercase
3613 # letter, or digit, except the last character, which cannot be a dash.
3614 &quot;fingerprint&quot;: &quot;A String&quot;, # Specifies a fingerprint for this resource, which is essentially a hash of
3615 # the metadata&#x27;s contents and used for optimistic locking. The
3616 # fingerprint is initially generated by Compute Engine and changes after
3617 # every request to modify or update metadata. You must always provide an
3618 # up-to-date fingerprint hash in order to update or change metadata,
3619 # otherwise the request will fail with error412 conditionNotMet.
3620 #
3621 # To see the latest fingerprint, make get() request to the
3622 # security policy.
3623 &quot;id&quot;: &quot;A String&quot;, # Output only. [Output Only] The unique identifier for the resource. This identifier is
3624 # defined by the server.
3625 &quot;kind&quot;: &quot;compute#securityPolicy&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyfor security policies
3626 &quot;labelFingerprint&quot;: &quot;A String&quot;, # A fingerprint for the labels being applied to this security policy, which
3627 # is essentially a hash of the labels set used for optimistic locking. The
3628 # fingerprint is initially generated by Compute Engine and changes after
3629 # every request to modify or update labels. You must always provide an
3630 # up-to-date fingerprint hash in order to update or change labels.
3631 #
3632 # To see the latest fingerprint, make get() request to the
3633 # security policy.
3634 &quot;labels&quot;: { # Labels for this resource. These can only be added or modified by thesetLabels method. Each label key/value pair must comply withRFC1035.
3635 # Label values may be empty.
3636 &quot;a_key&quot;: &quot;A String&quot;,
3637 },
3638 &quot;name&quot;: &quot;A String&quot;, # Name of the resource. Provided by the client when the resource is created.
3639 # The name must be 1-63 characters long, and comply withRFC1035.
3640 # Specifically, the name must be 1-63 characters long and match the regular
3641 # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
3642 # character must be a lowercase letter, and all following characters must
3643 # be a dash, lowercase letter, or digit, except the last character, which
3644 # cannot be a dash.
3645 &quot;parent&quot;: &quot;A String&quot;, # Output only. [Output Only] The parent of the security policy.
3646 &quot;recaptchaOptionsConfig&quot;: {
3647 &quot;redirectSiteKey&quot;: &quot;A String&quot;, # An optional field to supply a reCAPTCHA site key to be used for all the
3648 # rules using the redirect action with the type of GOOGLE_RECAPTCHA under
3649 # the security policy. The specified site key needs to be created from the
3650 # reCAPTCHA API. The user is responsible for the validity of the specified
3651 # site key. If not specified, a Google-managed site key is used.
3652 # This field is only supported in Global Security Policies of type
3653 # CLOUD_ARMOR.
3654 },
3655 &quot;region&quot;: &quot;A String&quot;, # Output only. [Output Only] URL of the region where the regional security policy
3656 # resides. This field is not applicable to global security policies.
3657 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Total count of all security policy rule tuples. A security
3658 # policy can not exceed a set number of tuples.
3659 &quot;rules&quot;: [ # A list of rules that belong to this policy.
3660 # There must always be a default rule which is a rule with priority
3661 # 2147483647 and match all condition (for the match condition this means
3662 # match &quot;*&quot; for srcIpRanges and for the networkMatch condition every field
3663 # must be either match &quot;*&quot; or not set). If no rules are provided when
3664 # creating a security policy, a default rule with action &quot;allow&quot; will be
3665 # added.
3666 { # Represents a rule that describes one or more match conditions along with
3667 # the action to be taken when traffic matches this condition (allow or deny).
3668 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the rule is matched.
3669 # The following are the valid actions:
3670 #
3671 # - allow: allow access to target.
3672 # - deny(STATUS): deny access to target, returns the
3673 # HTTP response code specified. Valid values for `STATUS`
3674 # are 403, 404, and 502.
3675 # - rate_based_ban: limit client traffic to the configured
3676 # threshold and ban the client if the traffic exceeds the threshold.
3677 # Configure parameters for this action in RateLimitOptions. Requires
3678 # rate_limit_options to be set.
3679 # - redirect: redirect to a different target. This can
3680 # either be an internal reCAPTCHA redirect, or an external URL-based
3681 # redirect via a 302 response. Parameters for this action can be configured
3682 # via redirectOptions. This action is only supported in Global Security
3683 # Policies of type CLOUD_ARMOR.
3684 # - throttle: limit
3685 # client traffic to the configured threshold. Configure parameters for this
3686 # action in rateLimitOptions. Requires rate_limit_options to be set for
3687 # this.
3688 # - fairshare (preview only): when traffic reaches the
3689 # threshold limit, requests from the clients matching this rule begin to be
3690 # rate-limited using the Fair Share algorithm. This action is only allowed
3691 # in security policies of type `CLOUD_ARMOR_INTERNAL_SERVICE`.
3692 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
3693 # create the resource.
3694 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies. This field may only be
3695 # specified when versioned_expr is set to FIREWALL.
3696 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is
3697 # enabled, logs will be exported to the configured export destination in
3698 # Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you
3699 # cannot enable logging on &quot;goto_next&quot; rules.
3700 #
3701 # This field may only be specified when the versioned_expr is set to
3702 # FIREWALL.
3703 &quot;headerAction&quot;: { # Optional, additional actions that are performed on headers.
3704 # This field is only supported in Global Security Policies of type
3705 # CLOUD_ARMOR.
3706 &quot;requestHeadersToAdds&quot;: [ # The list of request headers to add or overwrite if they&#x27;re already
3707 # present.
3708 {
3709 &quot;headerName&quot;: &quot;A String&quot;, # The name of the header to set.
3710 &quot;headerValue&quot;: &quot;A String&quot;, # The value to set the named header to.
3711 },
3712 ],
3713 },
3714 &quot;kind&quot;: &quot;compute#securityPolicyRule&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyRule for security policy rules
3715 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. # A match condition that incoming traffic is evaluated against.
3716 # If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
3717 # Exactly one field must be specified.
3718 &quot;config&quot;: { # The configuration options available when specifying versioned_expr.
3719 # This field must be specified if versioned_expr is specified and cannot
3720 # be specified if versioned_expr is not specified.
3721 &quot;destIpRanges&quot;: [ # CIDR IP address range.
3722 #
3723 # This field may only be specified when versioned_expr is set to
3724 # FIREWALL.
3725 &quot;A String&quot;,
3726 ],
3727 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
3728 #
3729 # This field may only be specified when versioned_expr is set to
3730 # FIREWALL.
3731 {
3732 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is
3733 # required when creating a firewall rule. This value can either be
3734 # one of the following well known protocol strings (tcp,udp, icmp, esp,ah, ipip, sctp), or the IP
3735 # protocol number.
3736 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is
3737 # only applicable for UDP or TCP protocol. Each entry must be either
3738 # an integer or a range. If not specified, this rule applies to
3739 # connections through any port.
3740 #
3741 # Example inputs include: [&quot;22&quot;],[&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
3742 #
3743 # This field may only be specified when versioned_expr is set to
3744 # FIREWALL.
3745 &quot;A String&quot;,
3746 ],
3747 },
3748 ],
3749 &quot;srcIpRanges&quot;: [ # CIDR IP address range.
3750 # Maximum number of src_ip_ranges allowed is 10.
3751 &quot;A String&quot;,
3752 ],
3753 },
3754 &quot;expr&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # User defined CEVAL expression.
3755 # A CEVAL expression is used to specify match criteria such as origin.ip,
3756 # source.region_code and contents in the request header.
3757 # Expressions containing `evaluateThreatIntelligence` require a Cloud
3758 # Armor Enterprise subscription and are not supported in Edge Policies
3759 # nor in Regional Policies. Expressions containing
3760 # `evaluatePreconfiguredExpr(&#x27;sourceiplist-*&#x27;)` require a Cloud Armor
3761 # Enterprise subscription and are only supported in Global Security
3762 # Policies.
3763 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
3764 # are documented at https://github.com/google/cel-spec.
3765 #
3766 # Example (Comparison):
3767 #
3768 # title: &quot;Summary size limit&quot;
3769 # description: &quot;Determines if a summary is less than 100 chars&quot;
3770 # expression: &quot;document.summary.size() &lt; 100&quot;
3771 #
3772 # Example (Equality):
3773 #
3774 # title: &quot;Requestor is owner&quot;
3775 # description: &quot;Determines if requestor is the document owner&quot;
3776 # expression: &quot;document.owner == request.auth.claims.email&quot;
3777 #
3778 # Example (Logic):
3779 #
3780 # title: &quot;Public documents&quot;
3781 # description: &quot;Determine whether the document should be publicly visible&quot;
3782 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
3783 #
3784 # Example (Data Manipulation):
3785 #
3786 # title: &quot;Notification string&quot;
3787 # description: &quot;Create a notification string with a timestamp.&quot;
3788 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
3789 #
3790 # The exact variables and functions that may be referenced within an expression
3791 # are determined by the service that evaluates it. See the service
3792 # documentation for additional information.
3793 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
3794 # describes the expression, e.g. when hovered over it in a UI.
3795 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
3796 # syntax.
3797 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
3798 # reporting, e.g. a file name and a position in the file.
3799 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
3800 # its purpose. This can be used e.g. in UIs which allow to enter the
3801 # expression.
3802 },
3803 &quot;exprOptions&quot;: { # The configuration options available when specifying a user defined
3804 # CEVAL expression (i.e., &#x27;expr&#x27;).
3805 &quot;recaptchaOptions&quot;: { # reCAPTCHA configuration options to be applied for the rule. If the
3806 # rule does not evaluate reCAPTCHA tokens, this field has no effect.
3807 &quot;actionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
3808 # action-tokens. The provided site keys need to be created from
3809 # reCAPTCHA API under the same project where the security policy is
3810 # created.
3811 &quot;A String&quot;,
3812 ],
3813 &quot;sessionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
3814 # session-tokens. The provided site keys need to be created from
3815 # reCAPTCHA API under the same project where the security policy is
3816 # created.
3817 &quot;A String&quot;,
3818 ],
3819 },
3820 },
3821 &quot;versionedExpr&quot;: &quot;A String&quot;, # Preconfigured versioned expression.
3822 # If this field is specified, config must also be specified.
3823 # Available preconfigured expressions along with their requirements are:
3824 # SRC_IPS_V1 - must specify the corresponding src_ip_range field in
3825 # config.
3826 },
3827 &quot;networkMatch&quot;: { # Represents a match condition that incoming network traffic is evaluated # A match condition that incoming packets are evaluated against for
3828 # CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding
3829 # &#x27;action&#x27; is enforced.
3830 #
3831 # The match criteria for a rule consists of built-in match fields (like
3832 # &#x27;srcIpRanges&#x27;) and potentially multiple user-defined match fields
3833 # (&#x27;userDefinedFields&#x27;).
3834 #
3835 # Field values may be extracted directly from the packet or derived from it
3836 # (e.g. &#x27;srcRegionCodes&#x27;). Some fields may not be present in every packet
3837 # (e.g. &#x27;srcPorts&#x27;). A user-defined field is only present if the base
3838 # header is found in the packet and the entire field is in bounds.
3839 #
3840 # Each match field may specify which values can match it, listing one or
3841 # more ranges, prefixes, or exact values that are considered a match for
3842 # the field. A field value must be present in order to match a specified
3843 # match field. If no match values are specified for a match field, then any
3844 # field value is considered to match it, and it&#x27;s not required to be
3845 # present. For strings specifying &#x27;*&#x27; is also equivalent to match all.
3846 #
3847 # For a packet to match a rule, all specified match fields must match the
3848 # corresponding field values derived from the packet.
3849 #
3850 # Example:
3851 #
3852 # networkMatch:
3853 # srcIpRanges:
3854 # - &quot;192.0.2.0/24&quot;
3855 # - &quot;198.51.100.0/24&quot;
3856 # userDefinedFields:
3857 # - name: &quot;ipv4_fragment_offset&quot;
3858 # values:
3859 # - &quot;1-0x1fff&quot;
3860 #
3861 # The above match condition matches packets with a source IP in
3862 # 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named
3863 # &quot;ipv4_fragment_offset&quot; with a value between 1 and 0x1fff inclusive.
3864 # against.
3865 &quot;destIpRanges&quot;: [ # Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text
3866 # format.
3867 &quot;A String&quot;,
3868 ],
3869 &quot;destPorts&quot;: [ # Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
3870 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
3871 &quot;A String&quot;,
3872 ],
3873 &quot;ipProtocols&quot;: [ # IPv4 protocol / IPv6 next header (after extension headers). Each
3874 # element can be an 8-bit unsigned decimal number (e.g. &quot;6&quot;), range (e.g.
3875 # &quot;253-254&quot;), or one of the following protocol names: &quot;tcp&quot;, &quot;udp&quot;,
3876 # &quot;icmp&quot;, &quot;esp&quot;, &quot;ah&quot;, &quot;ipip&quot;, or &quot;sctp&quot;.
3877 &quot;A String&quot;,
3878 ],
3879 &quot;srcAsns&quot;: [ # BGP Autonomous System Number associated with the source IP address.
3880 42,
3881 ],
3882 &quot;srcIpRanges&quot;: [ # Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
3883 &quot;A String&quot;,
3884 ],
3885 &quot;srcPorts&quot;: [ # Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
3886 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
3887 &quot;A String&quot;,
3888 ],
3889 &quot;srcRegionCodes&quot;: [ # Two-letter ISO 3166-1 alpha-2 country code associated with the source
3890 # IP address.
3891 &quot;A String&quot;,
3892 ],
3893 &quot;userDefinedFields&quot;: [ # User-defined fields. Each element names a defined field and lists the
3894 # matching values for that field.
3895 {
3896 &quot;name&quot;: &quot;A String&quot;, # Name of the user-defined field, as given in the definition.
3897 &quot;values&quot;: [ # Matching values of the field. Each element can be a 32-bit unsigned
3898 # decimal or hexadecimal (starting with &quot;0x&quot;) number (e.g. &quot;64&quot;) or
3899 # range (e.g. &quot;0x400-0x7ff&quot;).
3900 &quot;A String&quot;,
3901 ],
3902 },
3903 ],
3904 },
3905 &quot;preconfiguredWafConfig&quot;: { # Preconfigured WAF configuration to be applied for the rule. If the rule
3906 # does not evaluate preconfigured WAF rules, i.e., if
3907 # evaluatePreconfiguredWaf() is not used, this field will have no effect.
3908 &quot;exclusions&quot;: [ # A list of exclusions to apply during preconfigured WAF evaluation.
3909 {
3910 &quot;requestBodiesToExclude&quot;: [ # A list of request body fields to be excluded from inspection during
3911 # preconfigured WAF evaluation.
3912 {
3913 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
3914 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
3915 },
3916 ],
3917 &quot;requestCookiesToExclude&quot;: [ # A list of request cookie names whose value will be excluded from
3918 # inspection during preconfigured WAF evaluation.
3919 {
3920 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
3921 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
3922 },
3923 ],
3924 &quot;requestHeadersToExclude&quot;: [ # A list of request header names whose value will be excluded from
3925 # inspection during preconfigured WAF evaluation.
3926 {
3927 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
3928 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
3929 },
3930 ],
3931 &quot;requestQueryParamsToExclude&quot;: [ # A list of request query parameter names whose value will be excluded
3932 # from inspection during preconfigured WAF evaluation. Note that the
3933 # parameter can be in the query string or in the POST body.
3934 {
3935 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
3936 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
3937 },
3938 ],
3939 &quot;requestUrisToExclude&quot;: [ # A list of request URIs from the request line to be excluded from
3940 # inspection during preconfigured WAF evaluation. When specifying this
3941 # field, the query or fragment part should be excluded.
3942 {
3943 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
3944 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
3945 },
3946 ],
3947 &quot;targetRuleIds&quot;: [ # A list of target rule IDs under the WAF rule set to apply the
3948 # preconfigured WAF exclusion. If omitted, it refers to all the rule
3949 # IDs under the WAF rule set.
3950 &quot;A String&quot;,
3951 ],
3952 &quot;targetRuleSet&quot;: &quot;A String&quot;, # Target WAF rule set to apply the preconfigured WAF exclusion.
3953 },
3954 ],
3955 },
3956 &quot;preview&quot;: True or False, # If set to true, the specified action is not enforced.
3957 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority
3958 # must be a positive value between 0 and 2147483647.
3959 # Rules are evaluated from highest to lowest priority where 0 is the
3960 # highest priority and 2147483647 is the lowest priority.
3961 &quot;rateLimitOptions&quot;: { # Must be specified if the action is &quot;rate_based_ban&quot; or &quot;throttle&quot; or
3962 # &quot;fairshare&quot;. Cannot be specified for any other actions.
3963 &quot;banDurationSec&quot;: 42, # Can only be specified if the action for the rule is
3964 # &quot;rate_based_ban&quot;. If specified, determines the time (in seconds)
3965 # the traffic will continue to be banned by the rate limit after the
3966 # rate falls below the threshold.
3967 &quot;banThreshold&quot;: { # Can only be specified if the action for the rule is
3968 # &quot;rate_based_ban&quot;. If specified, the key will be banned for the
3969 # configured &#x27;ban_duration_sec&#x27; when the number of requests that exceed
3970 # the &#x27;rate_limit_threshold&#x27; also exceed this &#x27;ban_threshold&#x27;.
3971 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
3972 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
3973 },
3974 &quot;conformAction&quot;: &quot;A String&quot;, # Action to take for requests that are under the configured rate limit
3975 # threshold. Valid option is &quot;allow&quot; only.
3976 &quot;enforceOnKey&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
3977 # values are:
3978 #
3979 # - ALL: A single rate limit threshold is applied to all
3980 # the requests matching this rule. This is the default value if
3981 # &quot;enforceOnKey&quot; is not configured.
3982 # - IP: The source IP address of
3983 # the request is the key. Each IP has this limit enforced
3984 # separately.
3985 # - HTTP_HEADER: The value of the HTTP
3986 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
3987 # value is truncated to the first 128 bytes of the header value. If no
3988 # such header is present in the request, the key type defaults toALL.
3989 # - XFF_IP: The first IP address (i.e. the
3990 # originating client IP address) specified in the list of IPs under
3991 # X-Forwarded-For HTTP header. If no such header is present or the value
3992 # is not a valid IP, the key defaults to the source IP address of
3993 # the request i.e. key type IP.
3994 # - HTTP_COOKIE: The value of the HTTP
3995 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
3996 # value is truncated to the first 128 bytes of the cookie value. If no
3997 # such cookie is present in the request, the key type defaults toALL.
3998 # - HTTP_PATH: The URL path of the HTTP request. The key
3999 # value is truncated to the first 128 bytes.
4000 # - SNI: Server name indication in the TLS session of the
4001 # HTTPS request. The key value is truncated to the first 128 bytes. The
4002 # key type defaults to ALL on a HTTP session.
4003 # - REGION_CODE: The country/region from which the request
4004 # originates.
4005 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
4006 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
4007 # key type defaults to ALL.
4008 # - USER_IP: The IP address of the originating client,
4009 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
4010 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration or
4011 # an IP address cannot be resolved from it, the key type defaults toIP.
4012 #
4013 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
4014 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
4015 # key type defaults to ALL.
4016 # For &quot;fairshare&quot; action, this value is limited to ALL i.e. a single rate
4017 # limit threshold is enforced for all the requests matching the rule.
4018 &quot;enforceOnKeyConfigs&quot;: [ # If specified, any combination of values of
4019 # enforce_on_key_type/enforce_on_key_name is treated as the key on which
4020 # ratelimit threshold/action is enforced. You can specify up to 3
4021 # enforce_on_key_configs. If enforce_on_key_configs is specified,
4022 # enforce_on_key must not be specified.
4023 {
4024 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
4025 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the
4026 # key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is
4027 # taken as the key value.
4028 &quot;enforceOnKeyType&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
4029 # values are:
4030 #
4031 # - ALL: A single rate limit threshold is applied to all
4032 # the requests matching this rule. This is the default value if
4033 # &quot;enforceOnKeyConfigs&quot; is not configured.
4034 # - IP: The source IP address of
4035 # the request is the key. Each IP has this limit enforced
4036 # separately.
4037 # - HTTP_HEADER: The value of the HTTP
4038 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
4039 # value is truncated to the first 128 bytes of the header value. If no
4040 # such header is present in the request, the key type defaults toALL.
4041 # - XFF_IP: The first IP address (i.e. the
4042 # originating client IP address) specified in the list of IPs under
4043 # X-Forwarded-For HTTP header. If no such header is present or the
4044 # value is not a valid IP, the key defaults to the source IP address of
4045 # the request i.e. key type IP.
4046 # - HTTP_COOKIE: The value of the HTTP
4047 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
4048 # value is truncated to the first 128 bytes of the cookie value. If no
4049 # such cookie is present in the request, the key type defaults toALL.
4050 # - HTTP_PATH: The URL path of the HTTP request. The key
4051 # value is truncated to the first 128 bytes.
4052 # - SNI: Server name indication in the TLS session of
4053 # the HTTPS request. The key value is truncated to the first 128 bytes.
4054 # The key type defaults to ALL on a HTTP session.
4055 # - REGION_CODE: The country/region from which the
4056 # request originates.
4057 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
4058 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
4059 # key type defaults to ALL.
4060 # - USER_IP: The IP address of the originating client,
4061 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
4062 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration
4063 # or an IP address cannot be resolved from it, the key type defaults toIP.
4064 #
4065 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
4066 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
4067 # key type defaults to ALL.
4068 },
4069 ],
4070 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
4071 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the key
4072 # value.
4073 # HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key
4074 # value.
4075 &quot;exceedAction&quot;: &quot;A String&quot;, # Action to take for requests that are above the configured rate limit
4076 # threshold, to either deny with a specified HTTP response code, or
4077 # redirect to a different endpoint.
4078 # Valid options are `deny(STATUS)`, where valid values for
4079 # `STATUS` are 403, 404, 429, and 502, and
4080 # `redirect`, where the redirect parameters come from
4081 # `exceedRedirectOptions` below.
4082 # The `redirect` action is only supported in Global Security Policies of
4083 # type CLOUD_ARMOR.
4084 &quot;exceedRedirectOptions&quot;: { # Parameters defining the redirect action that is used as the exceed
4085 # action. Cannot be specified if the exceed action is not redirect.
4086 # This field is only supported in Global Security Policies of type
4087 # CLOUD_ARMOR.
4088 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
4089 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
4090 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
4091 #
4092 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
4093 # challenge assessment.
4094 # - EXTERNAL_302: redirect to a different URL via a 302
4095 # response.
4096 },
4097 &quot;rateLimitThreshold&quot;: { # Threshold at which to begin ratelimiting.
4098 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
4099 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
4100 },
4101 },
4102 &quot;redirectOptions&quot;: { # Parameters defining the redirect action. Cannot be specified for any
4103 # other actions.
4104 # This field is only supported in Global Security Policies of type
4105 # CLOUD_ARMOR.
4106 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
4107 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
4108 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
4109 #
4110 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
4111 # challenge assessment.
4112 # - EXTERNAL_302: redirect to a different URL via a 302
4113 # response.
4114 },
4115 &quot;ruleNumber&quot;: &quot;A String&quot;, # Identifier for the rule. This is only unique within the given security
4116 # policy. This can only be set during rule creation, if rule number is not
4117 # specified it will be generated by the server.
4118 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Calculation of the complexity of a single firewall security
4119 # policy rule.
4120 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field
4121 # allows you to control which network&#x27;s VMs get this rule. If this field
4122 # is left blank, all VMs within the organization will receive the rule.
4123 #
4124 # This field may only be specified when versioned_expr is set to FIREWALL.
4125 &quot;A String&quot;,
4126 ],
4127 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are
4128 # applied with this rule.
4129 &quot;A String&quot;,
4130 ],
4131 },
4132 ],
4133 &quot;selfLink&quot;: &quot;A String&quot;, # Output only. [Output Only] Server-defined URL for the resource.
4134 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # Output only. [Output Only] Server-defined URL for this resource with the resource id.
4135 &quot;shortName&quot;: &quot;A String&quot;, # User-provided name of the organization security policy. The name should be
4136 # unique in the organization in which the security policy is created. This
4137 # should only be used when SecurityPolicyType is CLOUD_ARMOR.
4138 # The name must be 1-63 characters long, and comply with
4139 # https://www.ietf.org/rfc/rfc1035.txt. Specifically, the name must be 1-63
4140 # characters long and match the regular expression
4141 # `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a
4142 # lowercase letter, and all following characters must be a dash, lowercase
4143 # letter, or digit, except the last character, which cannot be a dash.
4144 &quot;type&quot;: &quot;A String&quot;, # The type indicates the intended use of the security policy.
4145 #
4146 # - CLOUD_ARMOR: Cloud Armor backend security policies can
4147 # be configured to filter incoming HTTP requests targeting backend services.
4148 # They filter requests before they hit the origin servers.
4149 # - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can
4150 # be configured to filter incoming HTTP requests targeting backend services
4151 # (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage).
4152 # They filter requests before the request is served from Google&#x27;s cache.
4153 # - CLOUD_ARMOR_INTERNAL_SERVICE (preview only): Cloud Armor
4154 # internal service policies can be configured to filter HTTP requests
4155 # targeting services managed by Traffic Director in a service mesh. They
4156 # filter requests before the request is served from the application.
4157 #
4158 # - CLOUD_ARMOR_NETWORK: Cloud Armor network policies
4159 # can be configured to filter packets targeting network load balancing
4160 # resources such as backend services, target pools, target instances, and
4161 # instances with external IPs. They filter requests before the request is
4162 # served from the application.
4163 #
4164 #
4165 # This field can be set only at resource creation time.
4166 &quot;userDefinedFields&quot;: [ # Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A
4167 # user-defined field consists of up to 4 bytes extracted from a fixed offset
4168 # in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an
4169 # optional mask to select certain bits. Rules may then specify matching
4170 # values for these fields.
4171 #
4172 # Example:
4173 #
4174 # userDefinedFields:
4175 # - name: &quot;ipv4_fragment_offset&quot;
4176 # base: IPV4
4177 # offset: 6
4178 # size: 2
4179 # mask: &quot;0x1fff&quot;
4180 {
4181 &quot;base&quot;: &quot;A String&quot;, # The base relative to which &#x27;offset&#x27; is measured. Possible values are:
4182 #
4183 # - IPV4: Points to the beginning of the IPv4 header.
4184 # - IPV6: Points to the beginning of the IPv6 header.
4185 # - TCP: Points to the beginning of the TCP header, skipping
4186 # over any IPv4 options or IPv6 extension headers. Not present for
4187 # non-first fragments.
4188 # - UDP: Points to the beginning of the UDP header, skipping
4189 # over any IPv4 options or IPv6 extension headers. Not present for
4190 # non-first fragments.
4191 #
4192 #
4193 # required
4194 &quot;mask&quot;: &quot;A String&quot;, # If specified, apply this mask (bitwise AND) to the field to ignore bits
4195 # before matching. Encoded as a hexadecimal number (starting with &quot;0x&quot;).
4196 # The last byte of the field (in network byte order) corresponds to the
4197 # least significant byte of the mask.
4198 &quot;name&quot;: &quot;A String&quot;, # The name of this field. Must be unique within the policy.
4199 &quot;offset&quot;: 42, # Offset of the first byte of the field (in network byte order) relative to
4200 # &#x27;base&#x27;.
4201 &quot;size&quot;: 42, # Size of the field in bytes. Valid values: 1-4.
4202 },
4203 ],
4204 },
4205 ],
4206 &quot;kind&quot;: &quot;compute#securityPolicyList&quot;, # Output only. [Output Only] Type of resource. Alwayscompute#securityPolicyList for listsof securityPolicies
4207 &quot;nextPageToken&quot;: &quot;A String&quot;, # [Output Only] This token allows you to get the next page of results for
4208 # list requests. If the number of results is larger thanmaxResults, use the nextPageToken as a value for
4209 # the query parameter pageToken in the next list request.
4210 # Subsequent list requests will have their own nextPageToken to
4211 # continue paging through the results.
4212 &quot;warning&quot;: { # [Output Only] Informational warning message.
4213 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute
4214 # Engine returns NO_RESULTS_ON_PAGE if there
4215 # are no results in the response.
4216 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key:
4217 # value format. For example:
4218 #
4219 # &quot;data&quot;: [
4220 # {
4221 # &quot;key&quot;: &quot;scope&quot;,
4222 # &quot;value&quot;: &quot;zones/us-east1-d&quot;
4223 # }
4224 {
4225 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being
4226 # returned. For example, for warnings where there are no results in a list
4227 # request for a particular zone, this key might be scope and
4228 # the key value might be the zone name. Other examples might be a key
4229 # indicating a deprecated resource and a suggested replacement, or a
4230 # warning about invalid network settings (for example, if an instance
4231 # attempts to perform IP forwarding but is not enabled for IP forwarding).
4232 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
4233 },
4234 ],
4235 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
4236 },
4237 }</pre>
4238 </div>
4239
4240 <div class="method">
4241 <code class="details" id="list_next">list_next()</code>
4242 <pre>Retrieves the next page of results.
4243
4244 Args:
4245 previous_request: The request for the previous page. (required)
4246 previous_response: The response from the request for the previous page. (required)
4247
4248 Returns:
4249 A request object that you can call &#x27;execute()&#x27; on to request the next
4250 page. Returns None if there are no more items in the collection.
4251 </pre>
4252 </div>
4253
4254 <div class="method">
4255 <code class="details" id="patch">patch(project, region, securityPolicy, body=None, requestId=None, updateMask=None, x__xgafv=None)</code>
4256 <pre>Patches the specified policy with the data included in the request. To
4257 clear fields in the policy, leave the fields empty and specify them in the
4258 updateMask. This cannot be used to be update the rules in the policy.
4259 Please use the per rule methods like addRule, patchRule, and removeRule
4260 instead.
4261
4262 Args:
4263 project: string, Project ID for this request. (required)
4264 region: string, Name of the region scoping this request. (required)
4265 securityPolicy: string, Name of the security policy to update. (required)
4266 body: object, The request body.
4267 The object takes the form of:
4268
4269 { # Represents a Google Cloud Armor security policy resource.
4270 #
4271 # Only external backend services that use load balancers can
4272 # reference a security policy. For more information, see
4273 # Google Cloud Armor security policy overview.
4274 &quot;adaptiveProtectionConfig&quot;: { # Configuration options for Cloud Armor Adaptive Protection (CAAP).
4275 &quot;autoDeployConfig&quot;: { # Configuration options for Adaptive Protection auto-deploy feature.
4276 &quot;confidenceThreshold&quot;: 3.14,
4277 &quot;expirationSec&quot;: 42,
4278 &quot;impactedBaselineThreshold&quot;: 3.14,
4279 &quot;loadThreshold&quot;: 3.14,
4280 },
4281 &quot;layer7DdosDefenseConfig&quot;: { # Configuration options for L7 DDoS detection. # If set to true, enables Cloud Armor Machine Learning.
4282 # This field is only supported in Global Security Policies of type
4283 # CLOUD_ARMOR.
4284 &quot;enable&quot;: True or False, # If set to true, enables CAAP for L7 DDoS detection.
4285 # This field is only supported in Global Security Policies of type
4286 # CLOUD_ARMOR.
4287 &quot;ruleVisibility&quot;: &quot;A String&quot;, # Rule visibility can be one of the following:
4288 # STANDARD - opaque rules. (default)
4289 # PREMIUM - transparent rules.
4290 # This field is only supported in Global Security Policies of type
4291 # CLOUD_ARMOR.
4292 &quot;thresholdConfigs&quot;: [ # Configuration options for layer7 adaptive protection for various
4293 # customizable thresholds.
4294 {
4295 &quot;autoDeployConfidenceThreshold&quot;: 3.14,
4296 &quot;autoDeployExpirationSec&quot;: 42,
4297 &quot;autoDeployImpactedBaselineThreshold&quot;: 3.14,
4298 &quot;autoDeployLoadThreshold&quot;: 3.14,
4299 &quot;detectionAbsoluteQps&quot;: 3.14,
4300 &quot;detectionLoadThreshold&quot;: 3.14,
4301 &quot;detectionRelativeToBaselineQps&quot;: 3.14,
4302 &quot;name&quot;: &quot;A String&quot;, # The name must be 1-63 characters long, and comply withRFC1035.
4303 # The name must be unique within the security policy.
4304 &quot;trafficGranularityConfigs&quot;: [ # Configuration options for enabling Adaptive Protection to operate
4305 # on specified granular traffic units.
4306 { # Configurations to specifc granular traffic units processed by
4307 # Adaptive Protection.
4308 &quot;enableEachUniqueValue&quot;: True or False, # If enabled, traffic matching each unique value for the specified
4309 # type constitutes a separate traffic unit.
4310 # It can only be set to true if `value` is empty.
4311 &quot;type&quot;: &quot;A String&quot;, # Type of this configuration.
4312 &quot;value&quot;: &quot;A String&quot;, # Requests that match this value constitute a granular traffic unit.
4313 },
4314 ],
4315 },
4316 ],
4317 },
4318 },
4319 &quot;advancedOptionsConfig&quot;: {
4320 &quot;jsonCustomConfig&quot;: { # Custom configuration to apply the JSON parsing. Only applicable when
4321 # json_parsing is set to STANDARD.
4322 &quot;contentTypes&quot;: [ # A list of custom Content-Type header values to apply the JSON parsing.
4323 #
4324 # As per RFC 1341, a Content-Type header value has the following format:
4325 #
4326 # Content-Type := type &quot;/&quot; subtype *[&quot;;&quot; parameter]
4327 #
4328 # When configuring a custom Content-Type header value, only the
4329 # type/subtype needs to be specified, and the parameters should be
4330 # excluded.
4331 &quot;A String&quot;,
4332 ],
4333 },
4334 &quot;jsonParsing&quot;: &quot;A String&quot;,
4335 &quot;logLevel&quot;: &quot;A String&quot;,
4336 &quot;requestBodyInspectionSize&quot;: &quot;A String&quot;, # The maximum request size chosen by the customer with Waf enabled.
4337 # Values supported are &quot;8KB&quot;, &quot;16KB, &quot;32KB&quot;, &quot;48KB&quot; and &quot;64KB&quot;.
4338 # Values are case insensitive.
4339 &quot;userIpRequestHeaders&quot;: [ # An optional list of case-insensitive request header names to use for
4340 # resolving the callers client IP address.
4341 &quot;A String&quot;,
4342 ],
4343 },
4344 &quot;associations&quot;: [ # A list of associations that belong to this policy.
4345 {
4346 &quot;attachmentId&quot;: &quot;A String&quot;, # The resource that the security policy is attached to.
4347 &quot;displayName&quot;: &quot;A String&quot;, # Output only. [Output Only] The display name of the security policy of the association.
4348 &quot;excludedFolders&quot;: [ # A list of folders to exclude from the security policy.
4349 &quot;A String&quot;,
4350 ],
4351 &quot;excludedProjects&quot;: [ # A list of projects to exclude from the security policy.
4352 &quot;A String&quot;,
4353 ],
4354 &quot;name&quot;: &quot;A String&quot;, # The name for an association.
4355 &quot;securityPolicyId&quot;: &quot;A String&quot;, # Output only. [Output Only] The security policy ID of the association.
4356 &quot;shortName&quot;: &quot;A String&quot;, # Output only. [Output Only] The short name of the security policy of the association.
4357 },
4358 ],
4359 &quot;creationTimestamp&quot;: &quot;A String&quot;, # Output only. [Output Only] Creation timestamp inRFC3339
4360 # text format.
4361 &quot;ddosProtectionConfig&quot;: {
4362 &quot;ddosAdaptiveProtection&quot;: &quot;A String&quot;,
4363 &quot;ddosImpactedBaselineThreshold&quot;: 3.14, # DDoS Protection for Network Load Balancers (and VMs with public IPs)
4364 # builds DDoS mitigations that minimize collateral damage. It quantifies
4365 # this as the fraction of a non-abuse baseline that&#x27;s inadvertently
4366 # blocked.
4367 #
4368 # Rules whose collateral damage exceeds ddosImpactedBaselineThreshold will
4369 # not be deployed. Using a lower value will prioritize keeping collateral
4370 # damage low, possibly at the cost of its effectiveness in rate limiting
4371 # some or all of the attack. It should typically be unset, so Advanced DDoS
4372 # (and Adaptive Protection) uses the best mitigation it can find. Setting
4373 # the threshold is advised if there are logs for false positive detections
4374 # with high collateral damage, and will cause Advanced DDoS to attempt to
4375 # find a less aggressive rule that satisfies the constraint. If a suitable
4376 # rule cannot be found, the system falls back to either no mitigation for
4377 # smaller attacks or broader network throttles for larger ones.
4378 &quot;ddosProtection&quot;: &quot;A String&quot;,
4379 },
4380 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
4381 # create the resource.
4382 &quot;displayName&quot;: &quot;A String&quot;, # User-provided name of the organization security policy. The name should be
4383 # unique in the organization in which the security policy is created. This
4384 # should only be used when SecurityPolicyType is FIREWALL.
4385 # The name must be 1-63 characters long, and comply with
4386 # https://www.ietf.org/rfc/rfc1035.txt. Specifically, the name must be 1-63
4387 # characters long and match the regular expression
4388 # `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a
4389 # lowercase letter, and all following characters must be a dash, lowercase
4390 # letter, or digit, except the last character, which cannot be a dash.
4391 &quot;fingerprint&quot;: &quot;A String&quot;, # Specifies a fingerprint for this resource, which is essentially a hash of
4392 # the metadata&#x27;s contents and used for optimistic locking. The
4393 # fingerprint is initially generated by Compute Engine and changes after
4394 # every request to modify or update metadata. You must always provide an
4395 # up-to-date fingerprint hash in order to update or change metadata,
4396 # otherwise the request will fail with error412 conditionNotMet.
4397 #
4398 # To see the latest fingerprint, make get() request to the
4399 # security policy.
4400 &quot;id&quot;: &quot;A String&quot;, # Output only. [Output Only] The unique identifier for the resource. This identifier is
4401 # defined by the server.
4402 &quot;kind&quot;: &quot;compute#securityPolicy&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyfor security policies
4403 &quot;labelFingerprint&quot;: &quot;A String&quot;, # A fingerprint for the labels being applied to this security policy, which
4404 # is essentially a hash of the labels set used for optimistic locking. The
4405 # fingerprint is initially generated by Compute Engine and changes after
4406 # every request to modify or update labels. You must always provide an
4407 # up-to-date fingerprint hash in order to update or change labels.
4408 #
4409 # To see the latest fingerprint, make get() request to the
4410 # security policy.
4411 &quot;labels&quot;: { # Labels for this resource. These can only be added or modified by thesetLabels method. Each label key/value pair must comply withRFC1035.
4412 # Label values may be empty.
4413 &quot;a_key&quot;: &quot;A String&quot;,
4414 },
4415 &quot;name&quot;: &quot;A String&quot;, # Name of the resource. Provided by the client when the resource is created.
4416 # The name must be 1-63 characters long, and comply withRFC1035.
4417 # Specifically, the name must be 1-63 characters long and match the regular
4418 # expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
4419 # character must be a lowercase letter, and all following characters must
4420 # be a dash, lowercase letter, or digit, except the last character, which
4421 # cannot be a dash.
4422 &quot;parent&quot;: &quot;A String&quot;, # Output only. [Output Only] The parent of the security policy.
4423 &quot;recaptchaOptionsConfig&quot;: {
4424 &quot;redirectSiteKey&quot;: &quot;A String&quot;, # An optional field to supply a reCAPTCHA site key to be used for all the
4425 # rules using the redirect action with the type of GOOGLE_RECAPTCHA under
4426 # the security policy. The specified site key needs to be created from the
4427 # reCAPTCHA API. The user is responsible for the validity of the specified
4428 # site key. If not specified, a Google-managed site key is used.
4429 # This field is only supported in Global Security Policies of type
4430 # CLOUD_ARMOR.
4431 },
4432 &quot;region&quot;: &quot;A String&quot;, # Output only. [Output Only] URL of the region where the regional security policy
4433 # resides. This field is not applicable to global security policies.
4434 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Total count of all security policy rule tuples. A security
4435 # policy can not exceed a set number of tuples.
4436 &quot;rules&quot;: [ # A list of rules that belong to this policy.
4437 # There must always be a default rule which is a rule with priority
4438 # 2147483647 and match all condition (for the match condition this means
4439 # match &quot;*&quot; for srcIpRanges and for the networkMatch condition every field
4440 # must be either match &quot;*&quot; or not set). If no rules are provided when
4441 # creating a security policy, a default rule with action &quot;allow&quot; will be
4442 # added.
4443 { # Represents a rule that describes one or more match conditions along with
4444 # the action to be taken when traffic matches this condition (allow or deny).
4445 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the rule is matched.
4446 # The following are the valid actions:
4447 #
4448 # - allow: allow access to target.
4449 # - deny(STATUS): deny access to target, returns the
4450 # HTTP response code specified. Valid values for `STATUS`
4451 # are 403, 404, and 502.
4452 # - rate_based_ban: limit client traffic to the configured
4453 # threshold and ban the client if the traffic exceeds the threshold.
4454 # Configure parameters for this action in RateLimitOptions. Requires
4455 # rate_limit_options to be set.
4456 # - redirect: redirect to a different target. This can
4457 # either be an internal reCAPTCHA redirect, or an external URL-based
4458 # redirect via a 302 response. Parameters for this action can be configured
4459 # via redirectOptions. This action is only supported in Global Security
4460 # Policies of type CLOUD_ARMOR.
4461 # - throttle: limit
4462 # client traffic to the configured threshold. Configure parameters for this
4463 # action in rateLimitOptions. Requires rate_limit_options to be set for
4464 # this.
4465 # - fairshare (preview only): when traffic reaches the
4466 # threshold limit, requests from the clients matching this rule begin to be
4467 # rate-limited using the Fair Share algorithm. This action is only allowed
4468 # in security policies of type `CLOUD_ARMOR_INTERNAL_SERVICE`.
4469 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
4470 # create the resource.
4471 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies. This field may only be
4472 # specified when versioned_expr is set to FIREWALL.
4473 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is
4474 # enabled, logs will be exported to the configured export destination in
4475 # Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you
4476 # cannot enable logging on &quot;goto_next&quot; rules.
4477 #
4478 # This field may only be specified when the versioned_expr is set to
4479 # FIREWALL.
4480 &quot;headerAction&quot;: { # Optional, additional actions that are performed on headers.
4481 # This field is only supported in Global Security Policies of type
4482 # CLOUD_ARMOR.
4483 &quot;requestHeadersToAdds&quot;: [ # The list of request headers to add or overwrite if they&#x27;re already
4484 # present.
4485 {
4486 &quot;headerName&quot;: &quot;A String&quot;, # The name of the header to set.
4487 &quot;headerValue&quot;: &quot;A String&quot;, # The value to set the named header to.
4488 },
4489 ],
4490 },
4491 &quot;kind&quot;: &quot;compute#securityPolicyRule&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyRule for security policy rules
4492 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. # A match condition that incoming traffic is evaluated against.
4493 # If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
4494 # Exactly one field must be specified.
4495 &quot;config&quot;: { # The configuration options available when specifying versioned_expr.
4496 # This field must be specified if versioned_expr is specified and cannot
4497 # be specified if versioned_expr is not specified.
4498 &quot;destIpRanges&quot;: [ # CIDR IP address range.
4499 #
4500 # This field may only be specified when versioned_expr is set to
4501 # FIREWALL.
4502 &quot;A String&quot;,
4503 ],
4504 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
4505 #
4506 # This field may only be specified when versioned_expr is set to
4507 # FIREWALL.
4508 {
4509 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is
4510 # required when creating a firewall rule. This value can either be
4511 # one of the following well known protocol strings (tcp,udp, icmp, esp,ah, ipip, sctp), or the IP
4512 # protocol number.
4513 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is
4514 # only applicable for UDP or TCP protocol. Each entry must be either
4515 # an integer or a range. If not specified, this rule applies to
4516 # connections through any port.
4517 #
4518 # Example inputs include: [&quot;22&quot;],[&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
4519 #
4520 # This field may only be specified when versioned_expr is set to
4521 # FIREWALL.
4522 &quot;A String&quot;,
4523 ],
4524 },
4525 ],
4526 &quot;srcIpRanges&quot;: [ # CIDR IP address range.
4527 # Maximum number of src_ip_ranges allowed is 10.
4528 &quot;A String&quot;,
4529 ],
4530 },
4531 &quot;expr&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # User defined CEVAL expression.
4532 # A CEVAL expression is used to specify match criteria such as origin.ip,
4533 # source.region_code and contents in the request header.
4534 # Expressions containing `evaluateThreatIntelligence` require a Cloud
4535 # Armor Enterprise subscription and are not supported in Edge Policies
4536 # nor in Regional Policies. Expressions containing
4537 # `evaluatePreconfiguredExpr(&#x27;sourceiplist-*&#x27;)` require a Cloud Armor
4538 # Enterprise subscription and are only supported in Global Security
4539 # Policies.
4540 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
4541 # are documented at https://github.com/google/cel-spec.
4542 #
4543 # Example (Comparison):
4544 #
4545 # title: &quot;Summary size limit&quot;
4546 # description: &quot;Determines if a summary is less than 100 chars&quot;
4547 # expression: &quot;document.summary.size() &lt; 100&quot;
4548 #
4549 # Example (Equality):
4550 #
4551 # title: &quot;Requestor is owner&quot;
4552 # description: &quot;Determines if requestor is the document owner&quot;
4553 # expression: &quot;document.owner == request.auth.claims.email&quot;
4554 #
4555 # Example (Logic):
4556 #
4557 # title: &quot;Public documents&quot;
4558 # description: &quot;Determine whether the document should be publicly visible&quot;
4559 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
4560 #
4561 # Example (Data Manipulation):
4562 #
4563 # title: &quot;Notification string&quot;
4564 # description: &quot;Create a notification string with a timestamp.&quot;
4565 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
4566 #
4567 # The exact variables and functions that may be referenced within an expression
4568 # are determined by the service that evaluates it. See the service
4569 # documentation for additional information.
4570 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
4571 # describes the expression, e.g. when hovered over it in a UI.
4572 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
4573 # syntax.
4574 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
4575 # reporting, e.g. a file name and a position in the file.
4576 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
4577 # its purpose. This can be used e.g. in UIs which allow to enter the
4578 # expression.
4579 },
4580 &quot;exprOptions&quot;: { # The configuration options available when specifying a user defined
4581 # CEVAL expression (i.e., &#x27;expr&#x27;).
4582 &quot;recaptchaOptions&quot;: { # reCAPTCHA configuration options to be applied for the rule. If the
4583 # rule does not evaluate reCAPTCHA tokens, this field has no effect.
4584 &quot;actionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
4585 # action-tokens. The provided site keys need to be created from
4586 # reCAPTCHA API under the same project where the security policy is
4587 # created.
4588 &quot;A String&quot;,
4589 ],
4590 &quot;sessionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
4591 # session-tokens. The provided site keys need to be created from
4592 # reCAPTCHA API under the same project where the security policy is
4593 # created.
4594 &quot;A String&quot;,
4595 ],
4596 },
4597 },
4598 &quot;versionedExpr&quot;: &quot;A String&quot;, # Preconfigured versioned expression.
4599 # If this field is specified, config must also be specified.
4600 # Available preconfigured expressions along with their requirements are:
4601 # SRC_IPS_V1 - must specify the corresponding src_ip_range field in
4602 # config.
4603 },
4604 &quot;networkMatch&quot;: { # Represents a match condition that incoming network traffic is evaluated # A match condition that incoming packets are evaluated against for
4605 # CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding
4606 # &#x27;action&#x27; is enforced.
4607 #
4608 # The match criteria for a rule consists of built-in match fields (like
4609 # &#x27;srcIpRanges&#x27;) and potentially multiple user-defined match fields
4610 # (&#x27;userDefinedFields&#x27;).
4611 #
4612 # Field values may be extracted directly from the packet or derived from it
4613 # (e.g. &#x27;srcRegionCodes&#x27;). Some fields may not be present in every packet
4614 # (e.g. &#x27;srcPorts&#x27;). A user-defined field is only present if the base
4615 # header is found in the packet and the entire field is in bounds.
4616 #
4617 # Each match field may specify which values can match it, listing one or
4618 # more ranges, prefixes, or exact values that are considered a match for
4619 # the field. A field value must be present in order to match a specified
4620 # match field. If no match values are specified for a match field, then any
4621 # field value is considered to match it, and it&#x27;s not required to be
4622 # present. For strings specifying &#x27;*&#x27; is also equivalent to match all.
4623 #
4624 # For a packet to match a rule, all specified match fields must match the
4625 # corresponding field values derived from the packet.
4626 #
4627 # Example:
4628 #
4629 # networkMatch:
4630 # srcIpRanges:
4631 # - &quot;192.0.2.0/24&quot;
4632 # - &quot;198.51.100.0/24&quot;
4633 # userDefinedFields:
4634 # - name: &quot;ipv4_fragment_offset&quot;
4635 # values:
4636 # - &quot;1-0x1fff&quot;
4637 #
4638 # The above match condition matches packets with a source IP in
4639 # 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named
4640 # &quot;ipv4_fragment_offset&quot; with a value between 1 and 0x1fff inclusive.
4641 # against.
4642 &quot;destIpRanges&quot;: [ # Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text
4643 # format.
4644 &quot;A String&quot;,
4645 ],
4646 &quot;destPorts&quot;: [ # Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
4647 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
4648 &quot;A String&quot;,
4649 ],
4650 &quot;ipProtocols&quot;: [ # IPv4 protocol / IPv6 next header (after extension headers). Each
4651 # element can be an 8-bit unsigned decimal number (e.g. &quot;6&quot;), range (e.g.
4652 # &quot;253-254&quot;), or one of the following protocol names: &quot;tcp&quot;, &quot;udp&quot;,
4653 # &quot;icmp&quot;, &quot;esp&quot;, &quot;ah&quot;, &quot;ipip&quot;, or &quot;sctp&quot;.
4654 &quot;A String&quot;,
4655 ],
4656 &quot;srcAsns&quot;: [ # BGP Autonomous System Number associated with the source IP address.
4657 42,
4658 ],
4659 &quot;srcIpRanges&quot;: [ # Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
4660 &quot;A String&quot;,
4661 ],
4662 &quot;srcPorts&quot;: [ # Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
4663 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
4664 &quot;A String&quot;,
4665 ],
4666 &quot;srcRegionCodes&quot;: [ # Two-letter ISO 3166-1 alpha-2 country code associated with the source
4667 # IP address.
4668 &quot;A String&quot;,
4669 ],
4670 &quot;userDefinedFields&quot;: [ # User-defined fields. Each element names a defined field and lists the
4671 # matching values for that field.
4672 {
4673 &quot;name&quot;: &quot;A String&quot;, # Name of the user-defined field, as given in the definition.
4674 &quot;values&quot;: [ # Matching values of the field. Each element can be a 32-bit unsigned
4675 # decimal or hexadecimal (starting with &quot;0x&quot;) number (e.g. &quot;64&quot;) or
4676 # range (e.g. &quot;0x400-0x7ff&quot;).
4677 &quot;A String&quot;,
4678 ],
4679 },
4680 ],
4681 },
4682 &quot;preconfiguredWafConfig&quot;: { # Preconfigured WAF configuration to be applied for the rule. If the rule
4683 # does not evaluate preconfigured WAF rules, i.e., if
4684 # evaluatePreconfiguredWaf() is not used, this field will have no effect.
4685 &quot;exclusions&quot;: [ # A list of exclusions to apply during preconfigured WAF evaluation.
4686 {
4687 &quot;requestBodiesToExclude&quot;: [ # A list of request body fields to be excluded from inspection during
4688 # preconfigured WAF evaluation.
4689 {
4690 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
4691 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
4692 },
4693 ],
4694 &quot;requestCookiesToExclude&quot;: [ # A list of request cookie names whose value will be excluded from
4695 # inspection during preconfigured WAF evaluation.
4696 {
4697 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
4698 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
4699 },
4700 ],
4701 &quot;requestHeadersToExclude&quot;: [ # A list of request header names whose value will be excluded from
4702 # inspection during preconfigured WAF evaluation.
4703 {
4704 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
4705 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
4706 },
4707 ],
4708 &quot;requestQueryParamsToExclude&quot;: [ # A list of request query parameter names whose value will be excluded
4709 # from inspection during preconfigured WAF evaluation. Note that the
4710 # parameter can be in the query string or in the POST body.
4711 {
4712 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
4713 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
4714 },
4715 ],
4716 &quot;requestUrisToExclude&quot;: [ # A list of request URIs from the request line to be excluded from
4717 # inspection during preconfigured WAF evaluation. When specifying this
4718 # field, the query or fragment part should be excluded.
4719 {
4720 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
4721 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
4722 },
4723 ],
4724 &quot;targetRuleIds&quot;: [ # A list of target rule IDs under the WAF rule set to apply the
4725 # preconfigured WAF exclusion. If omitted, it refers to all the rule
4726 # IDs under the WAF rule set.
4727 &quot;A String&quot;,
4728 ],
4729 &quot;targetRuleSet&quot;: &quot;A String&quot;, # Target WAF rule set to apply the preconfigured WAF exclusion.
4730 },
4731 ],
4732 },
4733 &quot;preview&quot;: True or False, # If set to true, the specified action is not enforced.
4734 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority
4735 # must be a positive value between 0 and 2147483647.
4736 # Rules are evaluated from highest to lowest priority where 0 is the
4737 # highest priority and 2147483647 is the lowest priority.
4738 &quot;rateLimitOptions&quot;: { # Must be specified if the action is &quot;rate_based_ban&quot; or &quot;throttle&quot; or
4739 # &quot;fairshare&quot;. Cannot be specified for any other actions.
4740 &quot;banDurationSec&quot;: 42, # Can only be specified if the action for the rule is
4741 # &quot;rate_based_ban&quot;. If specified, determines the time (in seconds)
4742 # the traffic will continue to be banned by the rate limit after the
4743 # rate falls below the threshold.
4744 &quot;banThreshold&quot;: { # Can only be specified if the action for the rule is
4745 # &quot;rate_based_ban&quot;. If specified, the key will be banned for the
4746 # configured &#x27;ban_duration_sec&#x27; when the number of requests that exceed
4747 # the &#x27;rate_limit_threshold&#x27; also exceed this &#x27;ban_threshold&#x27;.
4748 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
4749 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
4750 },
4751 &quot;conformAction&quot;: &quot;A String&quot;, # Action to take for requests that are under the configured rate limit
4752 # threshold. Valid option is &quot;allow&quot; only.
4753 &quot;enforceOnKey&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
4754 # values are:
4755 #
4756 # - ALL: A single rate limit threshold is applied to all
4757 # the requests matching this rule. This is the default value if
4758 # &quot;enforceOnKey&quot; is not configured.
4759 # - IP: The source IP address of
4760 # the request is the key. Each IP has this limit enforced
4761 # separately.
4762 # - HTTP_HEADER: The value of the HTTP
4763 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
4764 # value is truncated to the first 128 bytes of the header value. If no
4765 # such header is present in the request, the key type defaults toALL.
4766 # - XFF_IP: The first IP address (i.e. the
4767 # originating client IP address) specified in the list of IPs under
4768 # X-Forwarded-For HTTP header. If no such header is present or the value
4769 # is not a valid IP, the key defaults to the source IP address of
4770 # the request i.e. key type IP.
4771 # - HTTP_COOKIE: The value of the HTTP
4772 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
4773 # value is truncated to the first 128 bytes of the cookie value. If no
4774 # such cookie is present in the request, the key type defaults toALL.
4775 # - HTTP_PATH: The URL path of the HTTP request. The key
4776 # value is truncated to the first 128 bytes.
4777 # - SNI: Server name indication in the TLS session of the
4778 # HTTPS request. The key value is truncated to the first 128 bytes. The
4779 # key type defaults to ALL on a HTTP session.
4780 # - REGION_CODE: The country/region from which the request
4781 # originates.
4782 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
4783 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
4784 # key type defaults to ALL.
4785 # - USER_IP: The IP address of the originating client,
4786 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
4787 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration or
4788 # an IP address cannot be resolved from it, the key type defaults toIP.
4789 #
4790 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
4791 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
4792 # key type defaults to ALL.
4793 # For &quot;fairshare&quot; action, this value is limited to ALL i.e. a single rate
4794 # limit threshold is enforced for all the requests matching the rule.
4795 &quot;enforceOnKeyConfigs&quot;: [ # If specified, any combination of values of
4796 # enforce_on_key_type/enforce_on_key_name is treated as the key on which
4797 # ratelimit threshold/action is enforced. You can specify up to 3
4798 # enforce_on_key_configs. If enforce_on_key_configs is specified,
4799 # enforce_on_key must not be specified.
4800 {
4801 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
4802 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the
4803 # key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is
4804 # taken as the key value.
4805 &quot;enforceOnKeyType&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
4806 # values are:
4807 #
4808 # - ALL: A single rate limit threshold is applied to all
4809 # the requests matching this rule. This is the default value if
4810 # &quot;enforceOnKeyConfigs&quot; is not configured.
4811 # - IP: The source IP address of
4812 # the request is the key. Each IP has this limit enforced
4813 # separately.
4814 # - HTTP_HEADER: The value of the HTTP
4815 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
4816 # value is truncated to the first 128 bytes of the header value. If no
4817 # such header is present in the request, the key type defaults toALL.
4818 # - XFF_IP: The first IP address (i.e. the
4819 # originating client IP address) specified in the list of IPs under
4820 # X-Forwarded-For HTTP header. If no such header is present or the
4821 # value is not a valid IP, the key defaults to the source IP address of
4822 # the request i.e. key type IP.
4823 # - HTTP_COOKIE: The value of the HTTP
4824 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
4825 # value is truncated to the first 128 bytes of the cookie value. If no
4826 # such cookie is present in the request, the key type defaults toALL.
4827 # - HTTP_PATH: The URL path of the HTTP request. The key
4828 # value is truncated to the first 128 bytes.
4829 # - SNI: Server name indication in the TLS session of
4830 # the HTTPS request. The key value is truncated to the first 128 bytes.
4831 # The key type defaults to ALL on a HTTP session.
4832 # - REGION_CODE: The country/region from which the
4833 # request originates.
4834 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
4835 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
4836 # key type defaults to ALL.
4837 # - USER_IP: The IP address of the originating client,
4838 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
4839 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration
4840 # or an IP address cannot be resolved from it, the key type defaults toIP.
4841 #
4842 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
4843 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
4844 # key type defaults to ALL.
4845 },
4846 ],
4847 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
4848 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the key
4849 # value.
4850 # HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key
4851 # value.
4852 &quot;exceedAction&quot;: &quot;A String&quot;, # Action to take for requests that are above the configured rate limit
4853 # threshold, to either deny with a specified HTTP response code, or
4854 # redirect to a different endpoint.
4855 # Valid options are `deny(STATUS)`, where valid values for
4856 # `STATUS` are 403, 404, 429, and 502, and
4857 # `redirect`, where the redirect parameters come from
4858 # `exceedRedirectOptions` below.
4859 # The `redirect` action is only supported in Global Security Policies of
4860 # type CLOUD_ARMOR.
4861 &quot;exceedRedirectOptions&quot;: { # Parameters defining the redirect action that is used as the exceed
4862 # action. Cannot be specified if the exceed action is not redirect.
4863 # This field is only supported in Global Security Policies of type
4864 # CLOUD_ARMOR.
4865 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
4866 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
4867 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
4868 #
4869 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
4870 # challenge assessment.
4871 # - EXTERNAL_302: redirect to a different URL via a 302
4872 # response.
4873 },
4874 &quot;rateLimitThreshold&quot;: { # Threshold at which to begin ratelimiting.
4875 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
4876 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
4877 },
4878 },
4879 &quot;redirectOptions&quot;: { # Parameters defining the redirect action. Cannot be specified for any
4880 # other actions.
4881 # This field is only supported in Global Security Policies of type
4882 # CLOUD_ARMOR.
4883 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
4884 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
4885 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
4886 #
4887 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
4888 # challenge assessment.
4889 # - EXTERNAL_302: redirect to a different URL via a 302
4890 # response.
4891 },
4892 &quot;ruleNumber&quot;: &quot;A String&quot;, # Identifier for the rule. This is only unique within the given security
4893 # policy. This can only be set during rule creation, if rule number is not
4894 # specified it will be generated by the server.
4895 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Calculation of the complexity of a single firewall security
4896 # policy rule.
4897 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field
4898 # allows you to control which network&#x27;s VMs get this rule. If this field
4899 # is left blank, all VMs within the organization will receive the rule.
4900 #
4901 # This field may only be specified when versioned_expr is set to FIREWALL.
4902 &quot;A String&quot;,
4903 ],
4904 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are
4905 # applied with this rule.
4906 &quot;A String&quot;,
4907 ],
4908 },
4909 ],
4910 &quot;selfLink&quot;: &quot;A String&quot;, # Output only. [Output Only] Server-defined URL for the resource.
4911 &quot;selfLinkWithId&quot;: &quot;A String&quot;, # Output only. [Output Only] Server-defined URL for this resource with the resource id.
4912 &quot;shortName&quot;: &quot;A String&quot;, # User-provided name of the organization security policy. The name should be
4913 # unique in the organization in which the security policy is created. This
4914 # should only be used when SecurityPolicyType is CLOUD_ARMOR.
4915 # The name must be 1-63 characters long, and comply with
4916 # https://www.ietf.org/rfc/rfc1035.txt. Specifically, the name must be 1-63
4917 # characters long and match the regular expression
4918 # `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a
4919 # lowercase letter, and all following characters must be a dash, lowercase
4920 # letter, or digit, except the last character, which cannot be a dash.
4921 &quot;type&quot;: &quot;A String&quot;, # The type indicates the intended use of the security policy.
4922 #
4923 # - CLOUD_ARMOR: Cloud Armor backend security policies can
4924 # be configured to filter incoming HTTP requests targeting backend services.
4925 # They filter requests before they hit the origin servers.
4926 # - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can
4927 # be configured to filter incoming HTTP requests targeting backend services
4928 # (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage).
4929 # They filter requests before the request is served from Google&#x27;s cache.
4930 # - CLOUD_ARMOR_INTERNAL_SERVICE (preview only): Cloud Armor
4931 # internal service policies can be configured to filter HTTP requests
4932 # targeting services managed by Traffic Director in a service mesh. They
4933 # filter requests before the request is served from the application.
4934 #
4935 # - CLOUD_ARMOR_NETWORK: Cloud Armor network policies
4936 # can be configured to filter packets targeting network load balancing
4937 # resources such as backend services, target pools, target instances, and
4938 # instances with external IPs. They filter requests before the request is
4939 # served from the application.
4940 #
4941 #
4942 # This field can be set only at resource creation time.
4943 &quot;userDefinedFields&quot;: [ # Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A
4944 # user-defined field consists of up to 4 bytes extracted from a fixed offset
4945 # in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an
4946 # optional mask to select certain bits. Rules may then specify matching
4947 # values for these fields.
4948 #
4949 # Example:
4950 #
4951 # userDefinedFields:
4952 # - name: &quot;ipv4_fragment_offset&quot;
4953 # base: IPV4
4954 # offset: 6
4955 # size: 2
4956 # mask: &quot;0x1fff&quot;
4957 {
4958 &quot;base&quot;: &quot;A String&quot;, # The base relative to which &#x27;offset&#x27; is measured. Possible values are:
4959 #
4960 # - IPV4: Points to the beginning of the IPv4 header.
4961 # - IPV6: Points to the beginning of the IPv6 header.
4962 # - TCP: Points to the beginning of the TCP header, skipping
4963 # over any IPv4 options or IPv6 extension headers. Not present for
4964 # non-first fragments.
4965 # - UDP: Points to the beginning of the UDP header, skipping
4966 # over any IPv4 options or IPv6 extension headers. Not present for
4967 # non-first fragments.
4968 #
4969 #
4970 # required
4971 &quot;mask&quot;: &quot;A String&quot;, # If specified, apply this mask (bitwise AND) to the field to ignore bits
4972 # before matching. Encoded as a hexadecimal number (starting with &quot;0x&quot;).
4973 # The last byte of the field (in network byte order) corresponds to the
4974 # least significant byte of the mask.
4975 &quot;name&quot;: &quot;A String&quot;, # The name of this field. Must be unique within the policy.
4976 &quot;offset&quot;: 42, # Offset of the first byte of the field (in network byte order) relative to
4977 # &#x27;base&#x27;.
4978 &quot;size&quot;: 42, # Size of the field in bytes. Valid values: 1-4.
4979 },
4980 ],
4981 }
4982
4983 requestId: string, An optional request ID to identify requests. Specify a unique request ID so
4984 that if you must retry your request, the server will know to ignore the
4985 request if it has already been completed.
4986
4987 For example, consider a situation where you make an initial request and
4988 the request times out. If you make the request again with the same
4989 request ID, the server can check if original operation with the same
4990 request ID was received, and if so, will ignore the second request. This
4991 prevents clients from accidentally creating duplicate commitments.
4992
4993 The request ID must be
4994 a valid UUID with the exception that zero UUID is not supported
4995 (00000000-0000-0000-0000-000000000000).
4996 updateMask: string, Indicates fields to be cleared as part of this request.
4997 x__xgafv: string, V1 error format.
4998 Allowed values
4999 1 - v1 error format
5000 2 - v2 error format
5001
5002 Returns:
5003 An object of the form:
5004
5005 { # Represents an Operation resource.
5006 #
5007 # Google Compute Engine has three Operation resources:
5008 #
5009 # * [Global](/compute/docs/reference/rest/beta/globalOperations)
5010 # * [Regional](/compute/docs/reference/rest/beta/regionOperations)
5011 # * [Zonal](/compute/docs/reference/rest/beta/zoneOperations)
5012 #
5013 # You can use an operation resource to manage asynchronous API requests.
5014 # For more information, readHandling
5015 # API responses.
5016 #
5017 # Operations can be global, regional or zonal.
5018 #
5019 # - For global operations, use the `globalOperations`
5020 # resource.
5021 # - For regional operations, use the
5022 # `regionOperations` resource.
5023 # - For zonal operations, use
5024 # the `zoneOperations` resource.
5025 #
5026 #
5027 #
5028 # For more information, read
5029 # Global, Regional, and Zonal Resources.
5030 #
5031 # Note that completed Operation resources have a limited
5032 # retention period.
5033 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request.
5034 # Not present otherwise.
5035 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
5036 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is
5037 # set when the operation is created.
5038 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is inRFC3339
5039 # text format.
5040 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation,
5041 # this field will be populated.
5042 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this
5043 # operation.
5044 {
5045 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
5046 &quot;errorDetails&quot;: [ # [Output Only] An optional list of messages that contain the error
5047 # details. There is a set of defined message types to use for providing
5048 # details.The syntax depends on the error code. For example,
5049 # QuotaExceededInfo will have details when the error code is
5050 # QUOTA_EXCEEDED.
5051 {
5052 &quot;errorInfo&quot;: { # Describes the cause of the error with structured details.
5053 #
5054 # Example of an error when contacting the &quot;pubsub.googleapis.com&quot; API when it
5055 # is not enabled:
5056 #
5057 # { &quot;reason&quot;: &quot;API_DISABLED&quot;
5058 # &quot;domain&quot;: &quot;googleapis.com&quot;
5059 # &quot;metadata&quot;: {
5060 # &quot;resource&quot;: &quot;projects/123&quot;,
5061 # &quot;service&quot;: &quot;pubsub.googleapis.com&quot;
5062 # }
5063 # }
5064 #
5065 # This response indicates that the pubsub.googleapis.com API is not enabled.
5066 #
5067 # Example of an error that is returned when attempting to create a Spanner
5068 # instance in a region that is out of stock:
5069 #
5070 # { &quot;reason&quot;: &quot;STOCKOUT&quot;
5071 # &quot;domain&quot;: &quot;spanner.googleapis.com&quot;,
5072 # &quot;metadata&quot;: {
5073 # &quot;availableRegions&quot;: &quot;us-central1,us-east2&quot;
5074 # }
5075 # }
5076 &quot;domain&quot;: &quot;A String&quot;, # The logical grouping to which the &quot;reason&quot; belongs. The error domain
5077 # is typically the registered service name of the tool or product that
5078 # generates the error. Example: &quot;pubsub.googleapis.com&quot;. If the error is
5079 # generated by some common infrastructure, the error domain must be a
5080 # globally unique value that identifies the infrastructure. For Google API
5081 # infrastructure, the error domain is &quot;googleapis.com&quot;.
5082 &quot;metadatas&quot;: { # Additional structured details about this error.
5083 #
5084 # Keys must match a regular expression of `a-z+` but should
5085 # ideally be lowerCamelCase. Also, they must be limited to 64 characters in
5086 # length. When identifying the current value of an exceeded limit, the units
5087 # should be contained in the key, not the value. For example, rather than
5088 # `{&quot;instanceLimit&quot;: &quot;100/request&quot;}`, should be returned as,
5089 # `{&quot;instanceLimitPerRequest&quot;: &quot;100&quot;}`, if the client exceeds the number of
5090 # instances that can be created in a single (batch) request.
5091 &quot;a_key&quot;: &quot;A String&quot;,
5092 },
5093 &quot;reason&quot;: &quot;A String&quot;, # The reason of the error. This is a constant value that identifies the
5094 # proximate cause of the error. Error reasons are unique within a particular
5095 # domain of errors. This should be at most 63 characters and match a
5096 # regular expression of `A-Z+[A-Z0-9]`, which represents
5097 # UPPER_SNAKE_CASE.
5098 },
5099 &quot;help&quot;: { # Provides links to documentation or for performing an out of band action.
5100 #
5101 # For example, if a quota check failed with an error indicating the calling
5102 # project hasn&#x27;t enabled the accessed service, this can contain a URL pointing
5103 # directly to the right place in the developer console to flip the bit.
5104 &quot;links&quot;: [ # URL(s) pointing to additional information on handling the current error.
5105 { # Describes a URL link.
5106 &quot;description&quot;: &quot;A String&quot;, # Describes what the link offers.
5107 &quot;url&quot;: &quot;A String&quot;, # The URL of the link.
5108 },
5109 ],
5110 },
5111 &quot;localizedMessage&quot;: { # Provides a localized error message that is safe to return to the user
5112 # which can be attached to an RPC error.
5113 &quot;locale&quot;: &quot;A String&quot;, # The locale used following the specification defined at
5114 # https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
5115 # Examples are: &quot;en-US&quot;, &quot;fr-CH&quot;, &quot;es-MX&quot;
5116 &quot;message&quot;: &quot;A String&quot;, # The localized error message in the above locale.
5117 },
5118 &quot;quotaInfo&quot;: { # Additional details for quota exceeded error for resource quota.
5119 &quot;dimensions&quot;: { # The map holding related quota dimensions.
5120 &quot;a_key&quot;: &quot;A String&quot;,
5121 },
5122 &quot;futureLimit&quot;: 3.14, # Future quota limit being rolled out. The limit&#x27;s unit depends on the quota
5123 # type or metric.
5124 &quot;limit&quot;: 3.14, # Current effective quota limit. The limit&#x27;s unit depends on the quota type
5125 # or metric.
5126 &quot;limitName&quot;: &quot;A String&quot;, # The name of the quota limit.
5127 &quot;metricName&quot;: &quot;A String&quot;, # The Compute Engine quota metric name.
5128 &quot;rolloutStatus&quot;: &quot;A String&quot;, # Rollout status of the future quota limit.
5129 },
5130 },
5131 ],
5132 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error.
5133 # This property is optional.
5134 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
5135 },
5136 ],
5137 },
5138 &quot;getVersionOperationMetadata&quot;: {
5139 &quot;inlineSbomInfo&quot;: {
5140 &quot;currentComponentVersions&quot;: { # A mapping of components to their currently-applied versions or other
5141 # appropriate identifiers.
5142 &quot;a_key&quot;: &quot;A String&quot;,
5143 },
5144 &quot;targetComponentVersions&quot;: { # A mapping of components to their target versions or other appropriate
5145 # identifiers.
5146 &quot;a_key&quot;: &quot;A String&quot;,
5147 },
5148 },
5149 },
5150 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error
5151 # message that was returned, such as `NOT FOUND`.
5152 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error
5153 # status code that was returned. For example, a `404` means the
5154 # resource was not found.
5155 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is
5156 # defined by the server.
5157 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested.
5158 # This value is inRFC3339
5159 # text format.
5160 &quot;instancesBulkInsertOperationMetadata&quot;: {
5161 &quot;perLocationStatus&quot;: { # Status information per location (location name is key).
5162 # Example key: zones/us-central1-a
5163 &quot;a_key&quot;: {
5164 &quot;createdVmCount&quot;: 42, # [Output Only] Count of VMs successfully created so far.
5165 &quot;deletedVmCount&quot;: 42, # [Output Only] Count of VMs that got deleted during rollback.
5166 &quot;failedToCreateVmCount&quot;: 42, # [Output Only] Count of VMs that started creating but encountered an
5167 # error.
5168 &quot;status&quot;: &quot;A String&quot;, # [Output Only] Creation status of BulkInsert operation - information
5169 # if the flow is rolling forward or rolling back.
5170 &quot;targetVmCount&quot;: 42, # [Output Only] Count of VMs originally planned to be created.
5171 },
5172 },
5173 },
5174 &quot;kind&quot;: &quot;compute#operation&quot;, # Output only. [Output Only] Type of the resource. Always `compute#operation` for
5175 # Operation resources.
5176 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
5177 &quot;operationGroupId&quot;: &quot;A String&quot;, # Output only. [Output Only] An ID that represents a group of operations, such as when a
5178 # group of operations results from a `bulkInsert` API request.
5179 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`,
5180 # `update`, or `delete`, and so on.
5181 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100.
5182 # There is no requirement that this be linear or support any granularity of
5183 # operations. This should not be used to guess when the operation will be
5184 # complete. This number should monotonically increase as the operation
5185 # progresses.
5186 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only
5187 # applicable when performing regional operations.
5188 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
5189 &quot;setCommonInstanceMetadataOperationMetadata&quot;: { # Output only. [Output Only] If the operation is for projects.setCommonInstanceMetadata,
5190 # this field will contain information on all underlying zonal actions and
5191 # their state.
5192 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The client operation id.
5193 &quot;perLocationOperations&quot;: { # [Output Only] Status information per location (location name is key).
5194 # Example key: zones/us-central1-a
5195 &quot;a_key&quot;: {
5196 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is
5197 # populated.
5198 # different programming environments, including REST APIs and RPC APIs. It is
5199 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
5200 # three pieces of data: error code, error message, and error details.
5201 #
5202 # You can find out more about this error model and how to work with it in the
5203 # [API Design Guide](https://cloud.google.com/apis/design/errors).
5204 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
5205 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
5206 # message types for APIs to use.
5207 {
5208 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
5209 },
5210 ],
5211 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
5212 # user-facing error message should be localized and sent in the
5213 # google.rpc.Status.details field, or localized by the client.
5214 },
5215 &quot;state&quot;: &quot;A String&quot;, # [Output Only] Status of the action, which can be one of the following:
5216 # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`.
5217 },
5218 },
5219 },
5220 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server.
5221 # This value is inRFC3339
5222 # text format.
5223 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the
5224 # following:
5225 # `PENDING`, `RUNNING`, or `DONE`.
5226 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the
5227 # operation.
5228 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation
5229 # of the target resource.
5230 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For
5231 # operations related to creating a snapshot, this points to the disk
5232 # that the snapshot was created from.
5233 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example:
5234 # `[email protected]` or
5235 # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`.
5236 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the
5237 # operation, this field will be populated.
5238 {
5239 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute
5240 # Engine returns NO_RESULTS_ON_PAGE if there
5241 # are no results in the response.
5242 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key:
5243 # value format. For example:
5244 #
5245 # &quot;data&quot;: [
5246 # {
5247 # &quot;key&quot;: &quot;scope&quot;,
5248 # &quot;value&quot;: &quot;zones/us-east1-d&quot;
5249 # }
5250 {
5251 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being
5252 # returned. For example, for warnings where there are no results in a list
5253 # request for a particular zone, this key might be scope and
5254 # the key value might be the zone name. Other examples might be a key
5255 # indicating a deprecated resource and a suggested replacement, or a
5256 # warning about invalid network settings (for example, if an instance
5257 # attempts to perform IP forwarding but is not enabled for IP forwarding).
5258 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
5259 },
5260 ],
5261 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
5262 },
5263 ],
5264 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only
5265 # applicable when performing per-zone operations.
5266 }</pre>
5267 </div>
5268
5269 <div class="method">
5270 <code class="details" id="patchRule">patchRule(project, region, securityPolicy, body=None, priority=None, updateMask=None, validateOnly=None, x__xgafv=None)</code>
5271 <pre>Patches a rule at the specified priority. To clear fields in the rule,
5272 leave the fields empty and specify them in the updateMask.
5273
5274 Args:
5275 project: string, Project ID for this request. (required)
5276 region: string, Name of the region scoping this request. (required)
5277 securityPolicy: string, Name of the security policy to update. (required)
5278 body: object, The request body.
5279 The object takes the form of:
5280
5281 { # Represents a rule that describes one or more match conditions along with
5282 # the action to be taken when traffic matches this condition (allow or deny).
5283 &quot;action&quot;: &quot;A String&quot;, # The Action to perform when the rule is matched.
5284 # The following are the valid actions:
5285 #
5286 # - allow: allow access to target.
5287 # - deny(STATUS): deny access to target, returns the
5288 # HTTP response code specified. Valid values for `STATUS`
5289 # are 403, 404, and 502.
5290 # - rate_based_ban: limit client traffic to the configured
5291 # threshold and ban the client if the traffic exceeds the threshold.
5292 # Configure parameters for this action in RateLimitOptions. Requires
5293 # rate_limit_options to be set.
5294 # - redirect: redirect to a different target. This can
5295 # either be an internal reCAPTCHA redirect, or an external URL-based
5296 # redirect via a 302 response. Parameters for this action can be configured
5297 # via redirectOptions. This action is only supported in Global Security
5298 # Policies of type CLOUD_ARMOR.
5299 # - throttle: limit
5300 # client traffic to the configured threshold. Configure parameters for this
5301 # action in rateLimitOptions. Requires rate_limit_options to be set for
5302 # this.
5303 # - fairshare (preview only): when traffic reaches the
5304 # threshold limit, requests from the clients matching this rule begin to be
5305 # rate-limited using the Fair Share algorithm. This action is only allowed
5306 # in security policies of type `CLOUD_ARMOR_INTERNAL_SERVICE`.
5307 &quot;description&quot;: &quot;A String&quot;, # An optional description of this resource. Provide this property when you
5308 # create the resource.
5309 &quot;direction&quot;: &quot;A String&quot;, # The direction in which this rule applies. This field may only be
5310 # specified when versioned_expr is set to FIREWALL.
5311 &quot;enableLogging&quot;: True or False, # Denotes whether to enable logging for a particular rule. If logging is
5312 # enabled, logs will be exported to the configured export destination in
5313 # Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you
5314 # cannot enable logging on &quot;goto_next&quot; rules.
5315 #
5316 # This field may only be specified when the versioned_expr is set to
5317 # FIREWALL.
5318 &quot;headerAction&quot;: { # Optional, additional actions that are performed on headers.
5319 # This field is only supported in Global Security Policies of type
5320 # CLOUD_ARMOR.
5321 &quot;requestHeadersToAdds&quot;: [ # The list of request headers to add or overwrite if they&#x27;re already
5322 # present.
5323 {
5324 &quot;headerName&quot;: &quot;A String&quot;, # The name of the header to set.
5325 &quot;headerValue&quot;: &quot;A String&quot;, # The value to set the named header to.
5326 },
5327 ],
5328 },
5329 &quot;kind&quot;: &quot;compute#securityPolicyRule&quot;, # Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyRule for security policy rules
5330 &quot;match&quot;: { # Represents a match condition that incoming traffic is evaluated against. # A match condition that incoming traffic is evaluated against.
5331 # If it evaluates to true, the corresponding &#x27;action&#x27; is enforced.
5332 # Exactly one field must be specified.
5333 &quot;config&quot;: { # The configuration options available when specifying versioned_expr.
5334 # This field must be specified if versioned_expr is specified and cannot
5335 # be specified if versioned_expr is not specified.
5336 &quot;destIpRanges&quot;: [ # CIDR IP address range.
5337 #
5338 # This field may only be specified when versioned_expr is set to
5339 # FIREWALL.
5340 &quot;A String&quot;,
5341 ],
5342 &quot;layer4Configs&quot;: [ # Pairs of IP protocols and ports that the rule should match.
5343 #
5344 # This field may only be specified when versioned_expr is set to
5345 # FIREWALL.
5346 {
5347 &quot;ipProtocol&quot;: &quot;A String&quot;, # The IP protocol to which this rule applies. The protocol type is
5348 # required when creating a firewall rule. This value can either be
5349 # one of the following well known protocol strings (tcp,udp, icmp, esp,ah, ipip, sctp), or the IP
5350 # protocol number.
5351 &quot;ports&quot;: [ # An optional list of ports to which this rule applies. This field is
5352 # only applicable for UDP or TCP protocol. Each entry must be either
5353 # an integer or a range. If not specified, this rule applies to
5354 # connections through any port.
5355 #
5356 # Example inputs include: [&quot;22&quot;],[&quot;80&quot;,&quot;443&quot;], and [&quot;12345-12349&quot;].
5357 #
5358 # This field may only be specified when versioned_expr is set to
5359 # FIREWALL.
5360 &quot;A String&quot;,
5361 ],
5362 },
5363 ],
5364 &quot;srcIpRanges&quot;: [ # CIDR IP address range.
5365 # Maximum number of src_ip_ranges allowed is 10.
5366 &quot;A String&quot;,
5367 ],
5368 },
5369 &quot;expr&quot;: { # Represents a textual expression in the Common Expression Language (CEL) # User defined CEVAL expression.
5370 # A CEVAL expression is used to specify match criteria such as origin.ip,
5371 # source.region_code and contents in the request header.
5372 # Expressions containing `evaluateThreatIntelligence` require a Cloud
5373 # Armor Enterprise subscription and are not supported in Edge Policies
5374 # nor in Regional Policies. Expressions containing
5375 # `evaluatePreconfiguredExpr(&#x27;sourceiplist-*&#x27;)` require a Cloud Armor
5376 # Enterprise subscription and are only supported in Global Security
5377 # Policies.
5378 # syntax. CEL is a C-like expression language. The syntax and semantics of CEL
5379 # are documented at https://github.com/google/cel-spec.
5380 #
5381 # Example (Comparison):
5382 #
5383 # title: &quot;Summary size limit&quot;
5384 # description: &quot;Determines if a summary is less than 100 chars&quot;
5385 # expression: &quot;document.summary.size() &lt; 100&quot;
5386 #
5387 # Example (Equality):
5388 #
5389 # title: &quot;Requestor is owner&quot;
5390 # description: &quot;Determines if requestor is the document owner&quot;
5391 # expression: &quot;document.owner == request.auth.claims.email&quot;
5392 #
5393 # Example (Logic):
5394 #
5395 # title: &quot;Public documents&quot;
5396 # description: &quot;Determine whether the document should be publicly visible&quot;
5397 # expression: &quot;document.type != &#x27;private&#x27; &amp;&amp; document.type != &#x27;internal&#x27;&quot;
5398 #
5399 # Example (Data Manipulation):
5400 #
5401 # title: &quot;Notification string&quot;
5402 # description: &quot;Create a notification string with a timestamp.&quot;
5403 # expression: &quot;&#x27;New message received at &#x27; + string(document.create_time)&quot;
5404 #
5405 # The exact variables and functions that may be referenced within an expression
5406 # are determined by the service that evaluates it. See the service
5407 # documentation for additional information.
5408 &quot;description&quot;: &quot;A String&quot;, # Optional. Description of the expression. This is a longer text which
5409 # describes the expression, e.g. when hovered over it in a UI.
5410 &quot;expression&quot;: &quot;A String&quot;, # Textual representation of an expression in Common Expression Language
5411 # syntax.
5412 &quot;location&quot;: &quot;A String&quot;, # Optional. String indicating the location of the expression for error
5413 # reporting, e.g. a file name and a position in the file.
5414 &quot;title&quot;: &quot;A String&quot;, # Optional. Title for the expression, i.e. a short string describing
5415 # its purpose. This can be used e.g. in UIs which allow to enter the
5416 # expression.
5417 },
5418 &quot;exprOptions&quot;: { # The configuration options available when specifying a user defined
5419 # CEVAL expression (i.e., &#x27;expr&#x27;).
5420 &quot;recaptchaOptions&quot;: { # reCAPTCHA configuration options to be applied for the rule. If the
5421 # rule does not evaluate reCAPTCHA tokens, this field has no effect.
5422 &quot;actionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
5423 # action-tokens. The provided site keys need to be created from
5424 # reCAPTCHA API under the same project where the security policy is
5425 # created.
5426 &quot;A String&quot;,
5427 ],
5428 &quot;sessionTokenSiteKeys&quot;: [ # A list of site keys to be used during the validation of reCAPTCHA
5429 # session-tokens. The provided site keys need to be created from
5430 # reCAPTCHA API under the same project where the security policy is
5431 # created.
5432 &quot;A String&quot;,
5433 ],
5434 },
5435 },
5436 &quot;versionedExpr&quot;: &quot;A String&quot;, # Preconfigured versioned expression.
5437 # If this field is specified, config must also be specified.
5438 # Available preconfigured expressions along with their requirements are:
5439 # SRC_IPS_V1 - must specify the corresponding src_ip_range field in
5440 # config.
5441 },
5442 &quot;networkMatch&quot;: { # Represents a match condition that incoming network traffic is evaluated # A match condition that incoming packets are evaluated against for
5443 # CLOUD_ARMOR_NETWORK security policies. If it matches, the corresponding
5444 # &#x27;action&#x27; is enforced.
5445 #
5446 # The match criteria for a rule consists of built-in match fields (like
5447 # &#x27;srcIpRanges&#x27;) and potentially multiple user-defined match fields
5448 # (&#x27;userDefinedFields&#x27;).
5449 #
5450 # Field values may be extracted directly from the packet or derived from it
5451 # (e.g. &#x27;srcRegionCodes&#x27;). Some fields may not be present in every packet
5452 # (e.g. &#x27;srcPorts&#x27;). A user-defined field is only present if the base
5453 # header is found in the packet and the entire field is in bounds.
5454 #
5455 # Each match field may specify which values can match it, listing one or
5456 # more ranges, prefixes, or exact values that are considered a match for
5457 # the field. A field value must be present in order to match a specified
5458 # match field. If no match values are specified for a match field, then any
5459 # field value is considered to match it, and it&#x27;s not required to be
5460 # present. For strings specifying &#x27;*&#x27; is also equivalent to match all.
5461 #
5462 # For a packet to match a rule, all specified match fields must match the
5463 # corresponding field values derived from the packet.
5464 #
5465 # Example:
5466 #
5467 # networkMatch:
5468 # srcIpRanges:
5469 # - &quot;192.0.2.0/24&quot;
5470 # - &quot;198.51.100.0/24&quot;
5471 # userDefinedFields:
5472 # - name: &quot;ipv4_fragment_offset&quot;
5473 # values:
5474 # - &quot;1-0x1fff&quot;
5475 #
5476 # The above match condition matches packets with a source IP in
5477 # 192.0.2.0/24 or 198.51.100.0/24 and a user-defined field named
5478 # &quot;ipv4_fragment_offset&quot; with a value between 1 and 0x1fff inclusive.
5479 # against.
5480 &quot;destIpRanges&quot;: [ # Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text
5481 # format.
5482 &quot;A String&quot;,
5483 ],
5484 &quot;destPorts&quot;: [ # Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
5485 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
5486 &quot;A String&quot;,
5487 ],
5488 &quot;ipProtocols&quot;: [ # IPv4 protocol / IPv6 next header (after extension headers). Each
5489 # element can be an 8-bit unsigned decimal number (e.g. &quot;6&quot;), range (e.g.
5490 # &quot;253-254&quot;), or one of the following protocol names: &quot;tcp&quot;, &quot;udp&quot;,
5491 # &quot;icmp&quot;, &quot;esp&quot;, &quot;ah&quot;, &quot;ipip&quot;, or &quot;sctp&quot;.
5492 &quot;A String&quot;,
5493 ],
5494 &quot;srcAsns&quot;: [ # BGP Autonomous System Number associated with the source IP address.
5495 42,
5496 ],
5497 &quot;srcIpRanges&quot;: [ # Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
5498 &quot;A String&quot;,
5499 ],
5500 &quot;srcPorts&quot;: [ # Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit
5501 # unsigned decimal number (e.g. &quot;80&quot;) or range (e.g. &quot;0-1023&quot;).
5502 &quot;A String&quot;,
5503 ],
5504 &quot;srcRegionCodes&quot;: [ # Two-letter ISO 3166-1 alpha-2 country code associated with the source
5505 # IP address.
5506 &quot;A String&quot;,
5507 ],
5508 &quot;userDefinedFields&quot;: [ # User-defined fields. Each element names a defined field and lists the
5509 # matching values for that field.
5510 {
5511 &quot;name&quot;: &quot;A String&quot;, # Name of the user-defined field, as given in the definition.
5512 &quot;values&quot;: [ # Matching values of the field. Each element can be a 32-bit unsigned
5513 # decimal or hexadecimal (starting with &quot;0x&quot;) number (e.g. &quot;64&quot;) or
5514 # range (e.g. &quot;0x400-0x7ff&quot;).
5515 &quot;A String&quot;,
5516 ],
5517 },
5518 ],
5519 },
5520 &quot;preconfiguredWafConfig&quot;: { # Preconfigured WAF configuration to be applied for the rule. If the rule
5521 # does not evaluate preconfigured WAF rules, i.e., if
5522 # evaluatePreconfiguredWaf() is not used, this field will have no effect.
5523 &quot;exclusions&quot;: [ # A list of exclusions to apply during preconfigured WAF evaluation.
5524 {
5525 &quot;requestBodiesToExclude&quot;: [ # A list of request body fields to be excluded from inspection during
5526 # preconfigured WAF evaluation.
5527 {
5528 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
5529 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
5530 },
5531 ],
5532 &quot;requestCookiesToExclude&quot;: [ # A list of request cookie names whose value will be excluded from
5533 # inspection during preconfigured WAF evaluation.
5534 {
5535 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
5536 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
5537 },
5538 ],
5539 &quot;requestHeadersToExclude&quot;: [ # A list of request header names whose value will be excluded from
5540 # inspection during preconfigured WAF evaluation.
5541 {
5542 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
5543 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
5544 },
5545 ],
5546 &quot;requestQueryParamsToExclude&quot;: [ # A list of request query parameter names whose value will be excluded
5547 # from inspection during preconfigured WAF evaluation. Note that the
5548 # parameter can be in the query string or in the POST body.
5549 {
5550 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
5551 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
5552 },
5553 ],
5554 &quot;requestUrisToExclude&quot;: [ # A list of request URIs from the request line to be excluded from
5555 # inspection during preconfigured WAF evaluation. When specifying this
5556 # field, the query or fragment part should be excluded.
5557 {
5558 &quot;op&quot;: &quot;A String&quot;, # The match operator for the field.
5559 &quot;val&quot;: &quot;A String&quot;, # The value of the field.
5560 },
5561 ],
5562 &quot;targetRuleIds&quot;: [ # A list of target rule IDs under the WAF rule set to apply the
5563 # preconfigured WAF exclusion. If omitted, it refers to all the rule
5564 # IDs under the WAF rule set.
5565 &quot;A String&quot;,
5566 ],
5567 &quot;targetRuleSet&quot;: &quot;A String&quot;, # Target WAF rule set to apply the preconfigured WAF exclusion.
5568 },
5569 ],
5570 },
5571 &quot;preview&quot;: True or False, # If set to true, the specified action is not enforced.
5572 &quot;priority&quot;: 42, # An integer indicating the priority of a rule in the list. The priority
5573 # must be a positive value between 0 and 2147483647.
5574 # Rules are evaluated from highest to lowest priority where 0 is the
5575 # highest priority and 2147483647 is the lowest priority.
5576 &quot;rateLimitOptions&quot;: { # Must be specified if the action is &quot;rate_based_ban&quot; or &quot;throttle&quot; or
5577 # &quot;fairshare&quot;. Cannot be specified for any other actions.
5578 &quot;banDurationSec&quot;: 42, # Can only be specified if the action for the rule is
5579 # &quot;rate_based_ban&quot;. If specified, determines the time (in seconds)
5580 # the traffic will continue to be banned by the rate limit after the
5581 # rate falls below the threshold.
5582 &quot;banThreshold&quot;: { # Can only be specified if the action for the rule is
5583 # &quot;rate_based_ban&quot;. If specified, the key will be banned for the
5584 # configured &#x27;ban_duration_sec&#x27; when the number of requests that exceed
5585 # the &#x27;rate_limit_threshold&#x27; also exceed this &#x27;ban_threshold&#x27;.
5586 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
5587 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
5588 },
5589 &quot;conformAction&quot;: &quot;A String&quot;, # Action to take for requests that are under the configured rate limit
5590 # threshold. Valid option is &quot;allow&quot; only.
5591 &quot;enforceOnKey&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
5592 # values are:
5593 #
5594 # - ALL: A single rate limit threshold is applied to all
5595 # the requests matching this rule. This is the default value if
5596 # &quot;enforceOnKey&quot; is not configured.
5597 # - IP: The source IP address of
5598 # the request is the key. Each IP has this limit enforced
5599 # separately.
5600 # - HTTP_HEADER: The value of the HTTP
5601 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
5602 # value is truncated to the first 128 bytes of the header value. If no
5603 # such header is present in the request, the key type defaults toALL.
5604 # - XFF_IP: The first IP address (i.e. the
5605 # originating client IP address) specified in the list of IPs under
5606 # X-Forwarded-For HTTP header. If no such header is present or the value
5607 # is not a valid IP, the key defaults to the source IP address of
5608 # the request i.e. key type IP.
5609 # - HTTP_COOKIE: The value of the HTTP
5610 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
5611 # value is truncated to the first 128 bytes of the cookie value. If no
5612 # such cookie is present in the request, the key type defaults toALL.
5613 # - HTTP_PATH: The URL path of the HTTP request. The key
5614 # value is truncated to the first 128 bytes.
5615 # - SNI: Server name indication in the TLS session of the
5616 # HTTPS request. The key value is truncated to the first 128 bytes. The
5617 # key type defaults to ALL on a HTTP session.
5618 # - REGION_CODE: The country/region from which the request
5619 # originates.
5620 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
5621 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
5622 # key type defaults to ALL.
5623 # - USER_IP: The IP address of the originating client,
5624 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
5625 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration or
5626 # an IP address cannot be resolved from it, the key type defaults toIP.
5627 #
5628 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
5629 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
5630 # key type defaults to ALL.
5631 # For &quot;fairshare&quot; action, this value is limited to ALL i.e. a single rate
5632 # limit threshold is enforced for all the requests matching the rule.
5633 &quot;enforceOnKeyConfigs&quot;: [ # If specified, any combination of values of
5634 # enforce_on_key_type/enforce_on_key_name is treated as the key on which
5635 # ratelimit threshold/action is enforced. You can specify up to 3
5636 # enforce_on_key_configs. If enforce_on_key_configs is specified,
5637 # enforce_on_key must not be specified.
5638 {
5639 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
5640 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the
5641 # key value. HTTP_COOKIE -- Name of the HTTP cookie whose value is
5642 # taken as the key value.
5643 &quot;enforceOnKeyType&quot;: &quot;A String&quot;, # Determines the key to enforce the rate_limit_threshold on. Possible
5644 # values are:
5645 #
5646 # - ALL: A single rate limit threshold is applied to all
5647 # the requests matching this rule. This is the default value if
5648 # &quot;enforceOnKeyConfigs&quot; is not configured.
5649 # - IP: The source IP address of
5650 # the request is the key. Each IP has this limit enforced
5651 # separately.
5652 # - HTTP_HEADER: The value of the HTTP
5653 # header whose name is configured under &quot;enforceOnKeyName&quot;. The key
5654 # value is truncated to the first 128 bytes of the header value. If no
5655 # such header is present in the request, the key type defaults toALL.
5656 # - XFF_IP: The first IP address (i.e. the
5657 # originating client IP address) specified in the list of IPs under
5658 # X-Forwarded-For HTTP header. If no such header is present or the
5659 # value is not a valid IP, the key defaults to the source IP address of
5660 # the request i.e. key type IP.
5661 # - HTTP_COOKIE: The value of the HTTP
5662 # cookie whose name is configured under &quot;enforceOnKeyName&quot;. The key
5663 # value is truncated to the first 128 bytes of the cookie value. If no
5664 # such cookie is present in the request, the key type defaults toALL.
5665 # - HTTP_PATH: The URL path of the HTTP request. The key
5666 # value is truncated to the first 128 bytes.
5667 # - SNI: Server name indication in the TLS session of
5668 # the HTTPS request. The key value is truncated to the first 128 bytes.
5669 # The key type defaults to ALL on a HTTP session.
5670 # - REGION_CODE: The country/region from which the
5671 # request originates.
5672 # - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the
5673 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
5674 # key type defaults to ALL.
5675 # - USER_IP: The IP address of the originating client,
5676 # which is resolved based on &quot;userIpRequestHeaders&quot; configured with the
5677 # security policy. If there is no &quot;userIpRequestHeaders&quot; configuration
5678 # or an IP address cannot be resolved from it, the key type defaults toIP.
5679 #
5680 # - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the
5681 # client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the
5682 # key type defaults to ALL.
5683 },
5684 ],
5685 &quot;enforceOnKeyName&quot;: &quot;A String&quot;, # Rate limit key name applicable only for the following key types:
5686 # HTTP_HEADER -- Name of the HTTP header whose value is taken as the key
5687 # value.
5688 # HTTP_COOKIE -- Name of the HTTP cookie whose value is taken as the key
5689 # value.
5690 &quot;exceedAction&quot;: &quot;A String&quot;, # Action to take for requests that are above the configured rate limit
5691 # threshold, to either deny with a specified HTTP response code, or
5692 # redirect to a different endpoint.
5693 # Valid options are `deny(STATUS)`, where valid values for
5694 # `STATUS` are 403, 404, 429, and 502, and
5695 # `redirect`, where the redirect parameters come from
5696 # `exceedRedirectOptions` below.
5697 # The `redirect` action is only supported in Global Security Policies of
5698 # type CLOUD_ARMOR.
5699 &quot;exceedRedirectOptions&quot;: { # Parameters defining the redirect action that is used as the exceed
5700 # action. Cannot be specified if the exceed action is not redirect.
5701 # This field is only supported in Global Security Policies of type
5702 # CLOUD_ARMOR.
5703 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
5704 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
5705 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
5706 #
5707 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
5708 # challenge assessment.
5709 # - EXTERNAL_302: redirect to a different URL via a 302
5710 # response.
5711 },
5712 &quot;rateLimitThreshold&quot;: { # Threshold at which to begin ratelimiting.
5713 &quot;count&quot;: 42, # Number of HTTP(S) requests for calculating the threshold.
5714 &quot;intervalSec&quot;: 42, # Interval over which the threshold is computed.
5715 },
5716 },
5717 &quot;redirectOptions&quot;: { # Parameters defining the redirect action. Cannot be specified for any
5718 # other actions.
5719 # This field is only supported in Global Security Policies of type
5720 # CLOUD_ARMOR.
5721 &quot;target&quot;: &quot;A String&quot;, # Target for the redirect action. This is required if the type is
5722 # EXTERNAL_302 and cannot be specified for GOOGLE_RECAPTCHA.
5723 &quot;type&quot;: &quot;A String&quot;, # Type of the redirect action. Possible values are:
5724 #
5725 # - GOOGLE_RECAPTCHA: redirect to reCAPTCHA for manual
5726 # challenge assessment.
5727 # - EXTERNAL_302: redirect to a different URL via a 302
5728 # response.
5729 },
5730 &quot;ruleNumber&quot;: &quot;A String&quot;, # Identifier for the rule. This is only unique within the given security
5731 # policy. This can only be set during rule creation, if rule number is not
5732 # specified it will be generated by the server.
5733 &quot;ruleTupleCount&quot;: 42, # Output only. [Output Only] Calculation of the complexity of a single firewall security
5734 # policy rule.
5735 &quot;targetResources&quot;: [ # A list of network resource URLs to which this rule applies. This field
5736 # allows you to control which network&#x27;s VMs get this rule. If this field
5737 # is left blank, all VMs within the organization will receive the rule.
5738 #
5739 # This field may only be specified when versioned_expr is set to FIREWALL.
5740 &quot;A String&quot;,
5741 ],
5742 &quot;targetServiceAccounts&quot;: [ # A list of service accounts indicating the sets of instances that are
5743 # applied with this rule.
5744 &quot;A String&quot;,
5745 ],
5746 }
5747
5748 priority: integer, The priority of the rule to patch.
5749 updateMask: string, Indicates fields to be cleared as part of this request.
5750 validateOnly: boolean, If true, the request will not be committed.
5751 x__xgafv: string, V1 error format.
5752 Allowed values
5753 1 - v1 error format
5754 2 - v2 error format
5755
5756 Returns:
5757 An object of the form:
5758
5759 { # Represents an Operation resource.
5760 #
5761 # Google Compute Engine has three Operation resources:
5762 #
5763 # * [Global](/compute/docs/reference/rest/beta/globalOperations)
5764 # * [Regional](/compute/docs/reference/rest/beta/regionOperations)
5765 # * [Zonal](/compute/docs/reference/rest/beta/zoneOperations)
5766 #
5767 # You can use an operation resource to manage asynchronous API requests.
5768 # For more information, readHandling
5769 # API responses.
5770 #
5771 # Operations can be global, regional or zonal.
5772 #
5773 # - For global operations, use the `globalOperations`
5774 # resource.
5775 # - For regional operations, use the
5776 # `regionOperations` resource.
5777 # - For zonal operations, use
5778 # the `zoneOperations` resource.
5779 #
5780 #
5781 #
5782 # For more information, read
5783 # Global, Regional, and Zonal Resources.
5784 #
5785 # Note that completed Operation resources have a limited
5786 # retention period.
5787 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request.
5788 # Not present otherwise.
5789 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
5790 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is
5791 # set when the operation is created.
5792 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is inRFC3339
5793 # text format.
5794 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation,
5795 # this field will be populated.
5796 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this
5797 # operation.
5798 {
5799 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
5800 &quot;errorDetails&quot;: [ # [Output Only] An optional list of messages that contain the error
5801 # details. There is a set of defined message types to use for providing
5802 # details.The syntax depends on the error code. For example,
5803 # QuotaExceededInfo will have details when the error code is
5804 # QUOTA_EXCEEDED.
5805 {
5806 &quot;errorInfo&quot;: { # Describes the cause of the error with structured details.
5807 #
5808 # Example of an error when contacting the &quot;pubsub.googleapis.com&quot; API when it
5809 # is not enabled:
5810 #
5811 # { &quot;reason&quot;: &quot;API_DISABLED&quot;
5812 # &quot;domain&quot;: &quot;googleapis.com&quot;
5813 # &quot;metadata&quot;: {
5814 # &quot;resource&quot;: &quot;projects/123&quot;,
5815 # &quot;service&quot;: &quot;pubsub.googleapis.com&quot;
5816 # }
5817 # }
5818 #
5819 # This response indicates that the pubsub.googleapis.com API is not enabled.
5820 #
5821 # Example of an error that is returned when attempting to create a Spanner
5822 # instance in a region that is out of stock:
5823 #
5824 # { &quot;reason&quot;: &quot;STOCKOUT&quot;
5825 # &quot;domain&quot;: &quot;spanner.googleapis.com&quot;,
5826 # &quot;metadata&quot;: {
5827 # &quot;availableRegions&quot;: &quot;us-central1,us-east2&quot;
5828 # }
5829 # }
5830 &quot;domain&quot;: &quot;A String&quot;, # The logical grouping to which the &quot;reason&quot; belongs. The error domain
5831 # is typically the registered service name of the tool or product that
5832 # generates the error. Example: &quot;pubsub.googleapis.com&quot;. If the error is
5833 # generated by some common infrastructure, the error domain must be a
5834 # globally unique value that identifies the infrastructure. For Google API
5835 # infrastructure, the error domain is &quot;googleapis.com&quot;.
5836 &quot;metadatas&quot;: { # Additional structured details about this error.
5837 #
5838 # Keys must match a regular expression of `a-z+` but should
5839 # ideally be lowerCamelCase. Also, they must be limited to 64 characters in
5840 # length. When identifying the current value of an exceeded limit, the units
5841 # should be contained in the key, not the value. For example, rather than
5842 # `{&quot;instanceLimit&quot;: &quot;100/request&quot;}`, should be returned as,
5843 # `{&quot;instanceLimitPerRequest&quot;: &quot;100&quot;}`, if the client exceeds the number of
5844 # instances that can be created in a single (batch) request.
5845 &quot;a_key&quot;: &quot;A String&quot;,
5846 },
5847 &quot;reason&quot;: &quot;A String&quot;, # The reason of the error. This is a constant value that identifies the
5848 # proximate cause of the error. Error reasons are unique within a particular
5849 # domain of errors. This should be at most 63 characters and match a
5850 # regular expression of `A-Z+[A-Z0-9]`, which represents
5851 # UPPER_SNAKE_CASE.
5852 },
5853 &quot;help&quot;: { # Provides links to documentation or for performing an out of band action.
5854 #
5855 # For example, if a quota check failed with an error indicating the calling
5856 # project hasn&#x27;t enabled the accessed service, this can contain a URL pointing
5857 # directly to the right place in the developer console to flip the bit.
5858 &quot;links&quot;: [ # URL(s) pointing to additional information on handling the current error.
5859 { # Describes a URL link.
5860 &quot;description&quot;: &quot;A String&quot;, # Describes what the link offers.
5861 &quot;url&quot;: &quot;A String&quot;, # The URL of the link.
5862 },
5863 ],
5864 },
5865 &quot;localizedMessage&quot;: { # Provides a localized error message that is safe to return to the user
5866 # which can be attached to an RPC error.
5867 &quot;locale&quot;: &quot;A String&quot;, # The locale used following the specification defined at
5868 # https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
5869 # Examples are: &quot;en-US&quot;, &quot;fr-CH&quot;, &quot;es-MX&quot;
5870 &quot;message&quot;: &quot;A String&quot;, # The localized error message in the above locale.
5871 },
5872 &quot;quotaInfo&quot;: { # Additional details for quota exceeded error for resource quota.
5873 &quot;dimensions&quot;: { # The map holding related quota dimensions.
5874 &quot;a_key&quot;: &quot;A String&quot;,
5875 },
5876 &quot;futureLimit&quot;: 3.14, # Future quota limit being rolled out. The limit&#x27;s unit depends on the quota
5877 # type or metric.
5878 &quot;limit&quot;: 3.14, # Current effective quota limit. The limit&#x27;s unit depends on the quota type
5879 # or metric.
5880 &quot;limitName&quot;: &quot;A String&quot;, # The name of the quota limit.
5881 &quot;metricName&quot;: &quot;A String&quot;, # The Compute Engine quota metric name.
5882 &quot;rolloutStatus&quot;: &quot;A String&quot;, # Rollout status of the future quota limit.
5883 },
5884 },
5885 ],
5886 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error.
5887 # This property is optional.
5888 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
5889 },
5890 ],
5891 },
5892 &quot;getVersionOperationMetadata&quot;: {
5893 &quot;inlineSbomInfo&quot;: {
5894 &quot;currentComponentVersions&quot;: { # A mapping of components to their currently-applied versions or other
5895 # appropriate identifiers.
5896 &quot;a_key&quot;: &quot;A String&quot;,
5897 },
5898 &quot;targetComponentVersions&quot;: { # A mapping of components to their target versions or other appropriate
5899 # identifiers.
5900 &quot;a_key&quot;: &quot;A String&quot;,
5901 },
5902 },
5903 },
5904 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error
5905 # message that was returned, such as `NOT FOUND`.
5906 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error
5907 # status code that was returned. For example, a `404` means the
5908 # resource was not found.
5909 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is
5910 # defined by the server.
5911 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested.
5912 # This value is inRFC3339
5913 # text format.
5914 &quot;instancesBulkInsertOperationMetadata&quot;: {
5915 &quot;perLocationStatus&quot;: { # Status information per location (location name is key).
5916 # Example key: zones/us-central1-a
5917 &quot;a_key&quot;: {
5918 &quot;createdVmCount&quot;: 42, # [Output Only] Count of VMs successfully created so far.
5919 &quot;deletedVmCount&quot;: 42, # [Output Only] Count of VMs that got deleted during rollback.
5920 &quot;failedToCreateVmCount&quot;: 42, # [Output Only] Count of VMs that started creating but encountered an
5921 # error.
5922 &quot;status&quot;: &quot;A String&quot;, # [Output Only] Creation status of BulkInsert operation - information
5923 # if the flow is rolling forward or rolling back.
5924 &quot;targetVmCount&quot;: 42, # [Output Only] Count of VMs originally planned to be created.
5925 },
5926 },
5927 },
5928 &quot;kind&quot;: &quot;compute#operation&quot;, # Output only. [Output Only] Type of the resource. Always `compute#operation` for
5929 # Operation resources.
5930 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
5931 &quot;operationGroupId&quot;: &quot;A String&quot;, # Output only. [Output Only] An ID that represents a group of operations, such as when a
5932 # group of operations results from a `bulkInsert` API request.
5933 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`,
5934 # `update`, or `delete`, and so on.
5935 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100.
5936 # There is no requirement that this be linear or support any granularity of
5937 # operations. This should not be used to guess when the operation will be
5938 # complete. This number should monotonically increase as the operation
5939 # progresses.
5940 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only
5941 # applicable when performing regional operations.
5942 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
5943 &quot;setCommonInstanceMetadataOperationMetadata&quot;: { # Output only. [Output Only] If the operation is for projects.setCommonInstanceMetadata,
5944 # this field will contain information on all underlying zonal actions and
5945 # their state.
5946 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The client operation id.
5947 &quot;perLocationOperations&quot;: { # [Output Only] Status information per location (location name is key).
5948 # Example key: zones/us-central1-a
5949 &quot;a_key&quot;: {
5950 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is
5951 # populated.
5952 # different programming environments, including REST APIs and RPC APIs. It is
5953 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
5954 # three pieces of data: error code, error message, and error details.
5955 #
5956 # You can find out more about this error model and how to work with it in the
5957 # [API Design Guide](https://cloud.google.com/apis/design/errors).
5958 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
5959 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
5960 # message types for APIs to use.
5961 {
5962 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
5963 },
5964 ],
5965 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
5966 # user-facing error message should be localized and sent in the
5967 # google.rpc.Status.details field, or localized by the client.
5968 },
5969 &quot;state&quot;: &quot;A String&quot;, # [Output Only] Status of the action, which can be one of the following:
5970 # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`.
5971 },
5972 },
5973 },
5974 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server.
5975 # This value is inRFC3339
5976 # text format.
5977 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the
5978 # following:
5979 # `PENDING`, `RUNNING`, or `DONE`.
5980 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the
5981 # operation.
5982 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation
5983 # of the target resource.
5984 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For
5985 # operations related to creating a snapshot, this points to the disk
5986 # that the snapshot was created from.
5987 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example:
5988 # `[email protected]` or
5989 # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`.
5990 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the
5991 # operation, this field will be populated.
5992 {
5993 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute
5994 # Engine returns NO_RESULTS_ON_PAGE if there
5995 # are no results in the response.
5996 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key:
5997 # value format. For example:
5998 #
5999 # &quot;data&quot;: [
6000 # {
6001 # &quot;key&quot;: &quot;scope&quot;,
6002 # &quot;value&quot;: &quot;zones/us-east1-d&quot;
6003 # }
6004 {
6005 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being
6006 # returned. For example, for warnings where there are no results in a list
6007 # request for a particular zone, this key might be scope and
6008 # the key value might be the zone name. Other examples might be a key
6009 # indicating a deprecated resource and a suggested replacement, or a
6010 # warning about invalid network settings (for example, if an instance
6011 # attempts to perform IP forwarding but is not enabled for IP forwarding).
6012 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
6013 },
6014 ],
6015 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
6016 },
6017 ],
6018 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only
6019 # applicable when performing per-zone operations.
6020 }</pre>
6021 </div>
6022
6023 <div class="method">
6024 <code class="details" id="removeRule">removeRule(project, region, securityPolicy, priority=None, x__xgafv=None)</code>
6025 <pre>Deletes a rule at the specified priority.
6026
6027 Args:
6028 project: string, Project ID for this request. (required)
6029 region: string, Name of the region scoping this request. (required)
6030 securityPolicy: string, Name of the security policy to update. (required)
6031 priority: integer, The priority of the rule to remove from the security policy.
6032 x__xgafv: string, V1 error format.
6033 Allowed values
6034 1 - v1 error format
6035 2 - v2 error format
6036
6037 Returns:
6038 An object of the form:
6039
6040 { # Represents an Operation resource.
6041 #
6042 # Google Compute Engine has three Operation resources:
6043 #
6044 # * [Global](/compute/docs/reference/rest/beta/globalOperations)
6045 # * [Regional](/compute/docs/reference/rest/beta/regionOperations)
6046 # * [Zonal](/compute/docs/reference/rest/beta/zoneOperations)
6047 #
6048 # You can use an operation resource to manage asynchronous API requests.
6049 # For more information, readHandling
6050 # API responses.
6051 #
6052 # Operations can be global, regional or zonal.
6053 #
6054 # - For global operations, use the `globalOperations`
6055 # resource.
6056 # - For regional operations, use the
6057 # `regionOperations` resource.
6058 # - For zonal operations, use
6059 # the `zoneOperations` resource.
6060 #
6061 #
6062 #
6063 # For more information, read
6064 # Global, Regional, and Zonal Resources.
6065 #
6066 # Note that completed Operation resources have a limited
6067 # retention period.
6068 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request.
6069 # Not present otherwise.
6070 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
6071 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is
6072 # set when the operation is created.
6073 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is inRFC3339
6074 # text format.
6075 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation,
6076 # this field will be populated.
6077 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this
6078 # operation.
6079 {
6080 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
6081 &quot;errorDetails&quot;: [ # [Output Only] An optional list of messages that contain the error
6082 # details. There is a set of defined message types to use for providing
6083 # details.The syntax depends on the error code. For example,
6084 # QuotaExceededInfo will have details when the error code is
6085 # QUOTA_EXCEEDED.
6086 {
6087 &quot;errorInfo&quot;: { # Describes the cause of the error with structured details.
6088 #
6089 # Example of an error when contacting the &quot;pubsub.googleapis.com&quot; API when it
6090 # is not enabled:
6091 #
6092 # { &quot;reason&quot;: &quot;API_DISABLED&quot;
6093 # &quot;domain&quot;: &quot;googleapis.com&quot;
6094 # &quot;metadata&quot;: {
6095 # &quot;resource&quot;: &quot;projects/123&quot;,
6096 # &quot;service&quot;: &quot;pubsub.googleapis.com&quot;
6097 # }
6098 # }
6099 #
6100 # This response indicates that the pubsub.googleapis.com API is not enabled.
6101 #
6102 # Example of an error that is returned when attempting to create a Spanner
6103 # instance in a region that is out of stock:
6104 #
6105 # { &quot;reason&quot;: &quot;STOCKOUT&quot;
6106 # &quot;domain&quot;: &quot;spanner.googleapis.com&quot;,
6107 # &quot;metadata&quot;: {
6108 # &quot;availableRegions&quot;: &quot;us-central1,us-east2&quot;
6109 # }
6110 # }
6111 &quot;domain&quot;: &quot;A String&quot;, # The logical grouping to which the &quot;reason&quot; belongs. The error domain
6112 # is typically the registered service name of the tool or product that
6113 # generates the error. Example: &quot;pubsub.googleapis.com&quot;. If the error is
6114 # generated by some common infrastructure, the error domain must be a
6115 # globally unique value that identifies the infrastructure. For Google API
6116 # infrastructure, the error domain is &quot;googleapis.com&quot;.
6117 &quot;metadatas&quot;: { # Additional structured details about this error.
6118 #
6119 # Keys must match a regular expression of `a-z+` but should
6120 # ideally be lowerCamelCase. Also, they must be limited to 64 characters in
6121 # length. When identifying the current value of an exceeded limit, the units
6122 # should be contained in the key, not the value. For example, rather than
6123 # `{&quot;instanceLimit&quot;: &quot;100/request&quot;}`, should be returned as,
6124 # `{&quot;instanceLimitPerRequest&quot;: &quot;100&quot;}`, if the client exceeds the number of
6125 # instances that can be created in a single (batch) request.
6126 &quot;a_key&quot;: &quot;A String&quot;,
6127 },
6128 &quot;reason&quot;: &quot;A String&quot;, # The reason of the error. This is a constant value that identifies the
6129 # proximate cause of the error. Error reasons are unique within a particular
6130 # domain of errors. This should be at most 63 characters and match a
6131 # regular expression of `A-Z+[A-Z0-9]`, which represents
6132 # UPPER_SNAKE_CASE.
6133 },
6134 &quot;help&quot;: { # Provides links to documentation or for performing an out of band action.
6135 #
6136 # For example, if a quota check failed with an error indicating the calling
6137 # project hasn&#x27;t enabled the accessed service, this can contain a URL pointing
6138 # directly to the right place in the developer console to flip the bit.
6139 &quot;links&quot;: [ # URL(s) pointing to additional information on handling the current error.
6140 { # Describes a URL link.
6141 &quot;description&quot;: &quot;A String&quot;, # Describes what the link offers.
6142 &quot;url&quot;: &quot;A String&quot;, # The URL of the link.
6143 },
6144 ],
6145 },
6146 &quot;localizedMessage&quot;: { # Provides a localized error message that is safe to return to the user
6147 # which can be attached to an RPC error.
6148 &quot;locale&quot;: &quot;A String&quot;, # The locale used following the specification defined at
6149 # https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
6150 # Examples are: &quot;en-US&quot;, &quot;fr-CH&quot;, &quot;es-MX&quot;
6151 &quot;message&quot;: &quot;A String&quot;, # The localized error message in the above locale.
6152 },
6153 &quot;quotaInfo&quot;: { # Additional details for quota exceeded error for resource quota.
6154 &quot;dimensions&quot;: { # The map holding related quota dimensions.
6155 &quot;a_key&quot;: &quot;A String&quot;,
6156 },
6157 &quot;futureLimit&quot;: 3.14, # Future quota limit being rolled out. The limit&#x27;s unit depends on the quota
6158 # type or metric.
6159 &quot;limit&quot;: 3.14, # Current effective quota limit. The limit&#x27;s unit depends on the quota type
6160 # or metric.
6161 &quot;limitName&quot;: &quot;A String&quot;, # The name of the quota limit.
6162 &quot;metricName&quot;: &quot;A String&quot;, # The Compute Engine quota metric name.
6163 &quot;rolloutStatus&quot;: &quot;A String&quot;, # Rollout status of the future quota limit.
6164 },
6165 },
6166 ],
6167 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error.
6168 # This property is optional.
6169 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
6170 },
6171 ],
6172 },
6173 &quot;getVersionOperationMetadata&quot;: {
6174 &quot;inlineSbomInfo&quot;: {
6175 &quot;currentComponentVersions&quot;: { # A mapping of components to their currently-applied versions or other
6176 # appropriate identifiers.
6177 &quot;a_key&quot;: &quot;A String&quot;,
6178 },
6179 &quot;targetComponentVersions&quot;: { # A mapping of components to their target versions or other appropriate
6180 # identifiers.
6181 &quot;a_key&quot;: &quot;A String&quot;,
6182 },
6183 },
6184 },
6185 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error
6186 # message that was returned, such as `NOT FOUND`.
6187 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error
6188 # status code that was returned. For example, a `404` means the
6189 # resource was not found.
6190 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is
6191 # defined by the server.
6192 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested.
6193 # This value is inRFC3339
6194 # text format.
6195 &quot;instancesBulkInsertOperationMetadata&quot;: {
6196 &quot;perLocationStatus&quot;: { # Status information per location (location name is key).
6197 # Example key: zones/us-central1-a
6198 &quot;a_key&quot;: {
6199 &quot;createdVmCount&quot;: 42, # [Output Only] Count of VMs successfully created so far.
6200 &quot;deletedVmCount&quot;: 42, # [Output Only] Count of VMs that got deleted during rollback.
6201 &quot;failedToCreateVmCount&quot;: 42, # [Output Only] Count of VMs that started creating but encountered an
6202 # error.
6203 &quot;status&quot;: &quot;A String&quot;, # [Output Only] Creation status of BulkInsert operation - information
6204 # if the flow is rolling forward or rolling back.
6205 &quot;targetVmCount&quot;: 42, # [Output Only] Count of VMs originally planned to be created.
6206 },
6207 },
6208 },
6209 &quot;kind&quot;: &quot;compute#operation&quot;, # Output only. [Output Only] Type of the resource. Always `compute#operation` for
6210 # Operation resources.
6211 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
6212 &quot;operationGroupId&quot;: &quot;A String&quot;, # Output only. [Output Only] An ID that represents a group of operations, such as when a
6213 # group of operations results from a `bulkInsert` API request.
6214 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`,
6215 # `update`, or `delete`, and so on.
6216 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100.
6217 # There is no requirement that this be linear or support any granularity of
6218 # operations. This should not be used to guess when the operation will be
6219 # complete. This number should monotonically increase as the operation
6220 # progresses.
6221 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only
6222 # applicable when performing regional operations.
6223 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
6224 &quot;setCommonInstanceMetadataOperationMetadata&quot;: { # Output only. [Output Only] If the operation is for projects.setCommonInstanceMetadata,
6225 # this field will contain information on all underlying zonal actions and
6226 # their state.
6227 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The client operation id.
6228 &quot;perLocationOperations&quot;: { # [Output Only] Status information per location (location name is key).
6229 # Example key: zones/us-central1-a
6230 &quot;a_key&quot;: {
6231 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is
6232 # populated.
6233 # different programming environments, including REST APIs and RPC APIs. It is
6234 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
6235 # three pieces of data: error code, error message, and error details.
6236 #
6237 # You can find out more about this error model and how to work with it in the
6238 # [API Design Guide](https://cloud.google.com/apis/design/errors).
6239 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
6240 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
6241 # message types for APIs to use.
6242 {
6243 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
6244 },
6245 ],
6246 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
6247 # user-facing error message should be localized and sent in the
6248 # google.rpc.Status.details field, or localized by the client.
6249 },
6250 &quot;state&quot;: &quot;A String&quot;, # [Output Only] Status of the action, which can be one of the following:
6251 # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`.
6252 },
6253 },
6254 },
6255 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server.
6256 # This value is inRFC3339
6257 # text format.
6258 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the
6259 # following:
6260 # `PENDING`, `RUNNING`, or `DONE`.
6261 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the
6262 # operation.
6263 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation
6264 # of the target resource.
6265 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For
6266 # operations related to creating a snapshot, this points to the disk
6267 # that the snapshot was created from.
6268 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example:
6269 # `[email protected]` or
6270 # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`.
6271 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the
6272 # operation, this field will be populated.
6273 {
6274 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute
6275 # Engine returns NO_RESULTS_ON_PAGE if there
6276 # are no results in the response.
6277 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key:
6278 # value format. For example:
6279 #
6280 # &quot;data&quot;: [
6281 # {
6282 # &quot;key&quot;: &quot;scope&quot;,
6283 # &quot;value&quot;: &quot;zones/us-east1-d&quot;
6284 # }
6285 {
6286 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being
6287 # returned. For example, for warnings where there are no results in a list
6288 # request for a particular zone, this key might be scope and
6289 # the key value might be the zone name. Other examples might be a key
6290 # indicating a deprecated resource and a suggested replacement, or a
6291 # warning about invalid network settings (for example, if an instance
6292 # attempts to perform IP forwarding but is not enabled for IP forwarding).
6293 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
6294 },
6295 ],
6296 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
6297 },
6298 ],
6299 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only
6300 # applicable when performing per-zone operations.
6301 }</pre>
6302 </div>
6303
6304 <div class="method">
6305 <code class="details" id="setLabels">setLabels(project, region, resource, body=None, requestId=None, x__xgafv=None)</code>
6306 <pre>Sets the labels on a security policy. To learn more about labels,
6307 read the Labeling Resources
6308 documentation.
6309
6310 Args:
6311 project: string, Project ID for this request. (required)
6312 region: string, The region for this request. (required)
6313 resource: string, Name or id of the resource for this request. (required)
6314 body: object, The request body.
6315 The object takes the form of:
6316
6317 {
6318 &quot;labelFingerprint&quot;: &quot;A String&quot;, # The fingerprint of the previous set of labels for this resource,
6319 # used to detect conflicts. The fingerprint is initially generated by Compute
6320 # Engine and changes after every request to modify or update labels. You must
6321 # always provide an up-to-date fingerprint hash in order to update or change
6322 # labels. Make a get() request to the resource to get the latest
6323 # fingerprint.
6324 &quot;labels&quot;: { # The labels to set for this resource.
6325 &quot;a_key&quot;: &quot;A String&quot;,
6326 },
6327 }
6328
6329 requestId: string, An optional request ID to identify requests. Specify a unique request ID so
6330 that if you must retry your request, the server will know to ignore the
6331 request if it has already been completed.
6332
6333 For example, consider a situation where you make an initial request and
6334 the request times out. If you make the request again with the same
6335 request ID, the server can check if original operation with the same
6336 request ID was received, and if so, will ignore the second request. This
6337 prevents clients from accidentally creating duplicate commitments.
6338
6339 The request ID must be
6340 a valid UUID with the exception that zero UUID is not supported
6341 (00000000-0000-0000-0000-000000000000).
6342 x__xgafv: string, V1 error format.
6343 Allowed values
6344 1 - v1 error format
6345 2 - v2 error format
6346
6347 Returns:
6348 An object of the form:
6349
6350 { # Represents an Operation resource.
6351 #
6352 # Google Compute Engine has three Operation resources:
6353 #
6354 # * [Global](/compute/docs/reference/rest/beta/globalOperations)
6355 # * [Regional](/compute/docs/reference/rest/beta/regionOperations)
6356 # * [Zonal](/compute/docs/reference/rest/beta/zoneOperations)
6357 #
6358 # You can use an operation resource to manage asynchronous API requests.
6359 # For more information, readHandling
6360 # API responses.
6361 #
6362 # Operations can be global, regional or zonal.
6363 #
6364 # - For global operations, use the `globalOperations`
6365 # resource.
6366 # - For regional operations, use the
6367 # `regionOperations` resource.
6368 # - For zonal operations, use
6369 # the `zoneOperations` resource.
6370 #
6371 #
6372 #
6373 # For more information, read
6374 # Global, Regional, and Zonal Resources.
6375 #
6376 # Note that completed Operation resources have a limited
6377 # retention period.
6378 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The value of `requestId` if you provided it in the request.
6379 # Not present otherwise.
6380 &quot;creationTimestamp&quot;: &quot;A String&quot;, # [Deprecated] This field is deprecated.
6381 &quot;description&quot;: &quot;A String&quot;, # [Output Only] A textual description of the operation, which is
6382 # set when the operation is created.
6383 &quot;endTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was completed. This value is inRFC3339
6384 # text format.
6385 &quot;error&quot;: { # [Output Only] If errors are generated during processing of the operation,
6386 # this field will be populated.
6387 &quot;errors&quot;: [ # [Output Only] The array of errors encountered while processing this
6388 # operation.
6389 {
6390 &quot;code&quot;: &quot;A String&quot;, # [Output Only] The error type identifier for this error.
6391 &quot;errorDetails&quot;: [ # [Output Only] An optional list of messages that contain the error
6392 # details. There is a set of defined message types to use for providing
6393 # details.The syntax depends on the error code. For example,
6394 # QuotaExceededInfo will have details when the error code is
6395 # QUOTA_EXCEEDED.
6396 {
6397 &quot;errorInfo&quot;: { # Describes the cause of the error with structured details.
6398 #
6399 # Example of an error when contacting the &quot;pubsub.googleapis.com&quot; API when it
6400 # is not enabled:
6401 #
6402 # { &quot;reason&quot;: &quot;API_DISABLED&quot;
6403 # &quot;domain&quot;: &quot;googleapis.com&quot;
6404 # &quot;metadata&quot;: {
6405 # &quot;resource&quot;: &quot;projects/123&quot;,
6406 # &quot;service&quot;: &quot;pubsub.googleapis.com&quot;
6407 # }
6408 # }
6409 #
6410 # This response indicates that the pubsub.googleapis.com API is not enabled.
6411 #
6412 # Example of an error that is returned when attempting to create a Spanner
6413 # instance in a region that is out of stock:
6414 #
6415 # { &quot;reason&quot;: &quot;STOCKOUT&quot;
6416 # &quot;domain&quot;: &quot;spanner.googleapis.com&quot;,
6417 # &quot;metadata&quot;: {
6418 # &quot;availableRegions&quot;: &quot;us-central1,us-east2&quot;
6419 # }
6420 # }
6421 &quot;domain&quot;: &quot;A String&quot;, # The logical grouping to which the &quot;reason&quot; belongs. The error domain
6422 # is typically the registered service name of the tool or product that
6423 # generates the error. Example: &quot;pubsub.googleapis.com&quot;. If the error is
6424 # generated by some common infrastructure, the error domain must be a
6425 # globally unique value that identifies the infrastructure. For Google API
6426 # infrastructure, the error domain is &quot;googleapis.com&quot;.
6427 &quot;metadatas&quot;: { # Additional structured details about this error.
6428 #
6429 # Keys must match a regular expression of `a-z+` but should
6430 # ideally be lowerCamelCase. Also, they must be limited to 64 characters in
6431 # length. When identifying the current value of an exceeded limit, the units
6432 # should be contained in the key, not the value. For example, rather than
6433 # `{&quot;instanceLimit&quot;: &quot;100/request&quot;}`, should be returned as,
6434 # `{&quot;instanceLimitPerRequest&quot;: &quot;100&quot;}`, if the client exceeds the number of
6435 # instances that can be created in a single (batch) request.
6436 &quot;a_key&quot;: &quot;A String&quot;,
6437 },
6438 &quot;reason&quot;: &quot;A String&quot;, # The reason of the error. This is a constant value that identifies the
6439 # proximate cause of the error. Error reasons are unique within a particular
6440 # domain of errors. This should be at most 63 characters and match a
6441 # regular expression of `A-Z+[A-Z0-9]`, which represents
6442 # UPPER_SNAKE_CASE.
6443 },
6444 &quot;help&quot;: { # Provides links to documentation or for performing an out of band action.
6445 #
6446 # For example, if a quota check failed with an error indicating the calling
6447 # project hasn&#x27;t enabled the accessed service, this can contain a URL pointing
6448 # directly to the right place in the developer console to flip the bit.
6449 &quot;links&quot;: [ # URL(s) pointing to additional information on handling the current error.
6450 { # Describes a URL link.
6451 &quot;description&quot;: &quot;A String&quot;, # Describes what the link offers.
6452 &quot;url&quot;: &quot;A String&quot;, # The URL of the link.
6453 },
6454 ],
6455 },
6456 &quot;localizedMessage&quot;: { # Provides a localized error message that is safe to return to the user
6457 # which can be attached to an RPC error.
6458 &quot;locale&quot;: &quot;A String&quot;, # The locale used following the specification defined at
6459 # https://www.rfc-editor.org/rfc/bcp/bcp47.txt.
6460 # Examples are: &quot;en-US&quot;, &quot;fr-CH&quot;, &quot;es-MX&quot;
6461 &quot;message&quot;: &quot;A String&quot;, # The localized error message in the above locale.
6462 },
6463 &quot;quotaInfo&quot;: { # Additional details for quota exceeded error for resource quota.
6464 &quot;dimensions&quot;: { # The map holding related quota dimensions.
6465 &quot;a_key&quot;: &quot;A String&quot;,
6466 },
6467 &quot;futureLimit&quot;: 3.14, # Future quota limit being rolled out. The limit&#x27;s unit depends on the quota
6468 # type or metric.
6469 &quot;limit&quot;: 3.14, # Current effective quota limit. The limit&#x27;s unit depends on the quota type
6470 # or metric.
6471 &quot;limitName&quot;: &quot;A String&quot;, # The name of the quota limit.
6472 &quot;metricName&quot;: &quot;A String&quot;, # The Compute Engine quota metric name.
6473 &quot;rolloutStatus&quot;: &quot;A String&quot;, # Rollout status of the future quota limit.
6474 },
6475 },
6476 ],
6477 &quot;location&quot;: &quot;A String&quot;, # [Output Only] Indicates the field in the request that caused the error.
6478 # This property is optional.
6479 &quot;message&quot;: &quot;A String&quot;, # [Output Only] An optional, human-readable error message.
6480 },
6481 ],
6482 },
6483 &quot;getVersionOperationMetadata&quot;: {
6484 &quot;inlineSbomInfo&quot;: {
6485 &quot;currentComponentVersions&quot;: { # A mapping of components to their currently-applied versions or other
6486 # appropriate identifiers.
6487 &quot;a_key&quot;: &quot;A String&quot;,
6488 },
6489 &quot;targetComponentVersions&quot;: { # A mapping of components to their target versions or other appropriate
6490 # identifiers.
6491 &quot;a_key&quot;: &quot;A String&quot;,
6492 },
6493 },
6494 },
6495 &quot;httpErrorMessage&quot;: &quot;A String&quot;, # [Output Only] If the operation fails, this field contains the HTTP error
6496 # message that was returned, such as `NOT FOUND`.
6497 &quot;httpErrorStatusCode&quot;: 42, # [Output Only] If the operation fails, this field contains the HTTP error
6498 # status code that was returned. For example, a `404` means the
6499 # resource was not found.
6500 &quot;id&quot;: &quot;A String&quot;, # [Output Only] The unique identifier for the operation. This identifier is
6501 # defined by the server.
6502 &quot;insertTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was requested.
6503 # This value is inRFC3339
6504 # text format.
6505 &quot;instancesBulkInsertOperationMetadata&quot;: {
6506 &quot;perLocationStatus&quot;: { # Status information per location (location name is key).
6507 # Example key: zones/us-central1-a
6508 &quot;a_key&quot;: {
6509 &quot;createdVmCount&quot;: 42, # [Output Only] Count of VMs successfully created so far.
6510 &quot;deletedVmCount&quot;: 42, # [Output Only] Count of VMs that got deleted during rollback.
6511 &quot;failedToCreateVmCount&quot;: 42, # [Output Only] Count of VMs that started creating but encountered an
6512 # error.
6513 &quot;status&quot;: &quot;A String&quot;, # [Output Only] Creation status of BulkInsert operation - information
6514 # if the flow is rolling forward or rolling back.
6515 &quot;targetVmCount&quot;: 42, # [Output Only] Count of VMs originally planned to be created.
6516 },
6517 },
6518 },
6519 &quot;kind&quot;: &quot;compute#operation&quot;, # Output only. [Output Only] Type of the resource. Always `compute#operation` for
6520 # Operation resources.
6521 &quot;name&quot;: &quot;A String&quot;, # [Output Only] Name of the operation.
6522 &quot;operationGroupId&quot;: &quot;A String&quot;, # Output only. [Output Only] An ID that represents a group of operations, such as when a
6523 # group of operations results from a `bulkInsert` API request.
6524 &quot;operationType&quot;: &quot;A String&quot;, # [Output Only] The type of operation, such as `insert`,
6525 # `update`, or `delete`, and so on.
6526 &quot;progress&quot;: 42, # [Output Only] An optional progress indicator that ranges from 0 to 100.
6527 # There is no requirement that this be linear or support any granularity of
6528 # operations. This should not be used to guess when the operation will be
6529 # complete. This number should monotonically increase as the operation
6530 # progresses.
6531 &quot;region&quot;: &quot;A String&quot;, # [Output Only] The URL of the region where the operation resides. Only
6532 # applicable when performing regional operations.
6533 &quot;selfLink&quot;: &quot;A String&quot;, # [Output Only] Server-defined URL for the resource.
6534 &quot;setCommonInstanceMetadataOperationMetadata&quot;: { # Output only. [Output Only] If the operation is for projects.setCommonInstanceMetadata,
6535 # this field will contain information on all underlying zonal actions and
6536 # their state.
6537 &quot;clientOperationId&quot;: &quot;A String&quot;, # [Output Only] The client operation id.
6538 &quot;perLocationOperations&quot;: { # [Output Only] Status information per location (location name is key).
6539 # Example key: zones/us-central1-a
6540 &quot;a_key&quot;: {
6541 &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for # [Output Only] If state is `ABANDONED` or `FAILED`, this field is
6542 # populated.
6543 # different programming environments, including REST APIs and RPC APIs. It is
6544 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
6545 # three pieces of data: error code, error message, and error details.
6546 #
6547 # You can find out more about this error model and how to work with it in the
6548 # [API Design Guide](https://cloud.google.com/apis/design/errors).
6549 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
6550 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
6551 # message types for APIs to use.
6552 {
6553 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
6554 },
6555 ],
6556 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
6557 # user-facing error message should be localized and sent in the
6558 # google.rpc.Status.details field, or localized by the client.
6559 },
6560 &quot;state&quot;: &quot;A String&quot;, # [Output Only] Status of the action, which can be one of the following:
6561 # `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`.
6562 },
6563 },
6564 },
6565 &quot;startTime&quot;: &quot;A String&quot;, # [Output Only] The time that this operation was started by the server.
6566 # This value is inRFC3339
6567 # text format.
6568 &quot;status&quot;: &quot;A String&quot;, # [Output Only] The status of the operation, which can be one of the
6569 # following:
6570 # `PENDING`, `RUNNING`, or `DONE`.
6571 &quot;statusMessage&quot;: &quot;A String&quot;, # [Output Only] An optional textual description of the current status of the
6572 # operation.
6573 &quot;targetId&quot;: &quot;A String&quot;, # [Output Only] The unique target ID, which identifies a specific incarnation
6574 # of the target resource.
6575 &quot;targetLink&quot;: &quot;A String&quot;, # [Output Only] The URL of the resource that the operation modifies. For
6576 # operations related to creating a snapshot, this points to the disk
6577 # that the snapshot was created from.
6578 &quot;user&quot;: &quot;A String&quot;, # [Output Only] User who requested the operation, for example:
6579 # `[email protected]` or
6580 # `alice_smith_identifier (global/workforcePools/example-com-us-employees)`.
6581 &quot;warnings&quot;: [ # [Output Only] If warning messages are generated during processing of the
6582 # operation, this field will be populated.
6583 {
6584 &quot;code&quot;: &quot;A String&quot;, # [Output Only] A warning code, if applicable. For example, Compute
6585 # Engine returns NO_RESULTS_ON_PAGE if there
6586 # are no results in the response.
6587 &quot;data&quot;: [ # [Output Only] Metadata about this warning in key:
6588 # value format. For example:
6589 #
6590 # &quot;data&quot;: [
6591 # {
6592 # &quot;key&quot;: &quot;scope&quot;,
6593 # &quot;value&quot;: &quot;zones/us-east1-d&quot;
6594 # }
6595 {
6596 &quot;key&quot;: &quot;A String&quot;, # [Output Only] A key that provides more detail on the warning being
6597 # returned. For example, for warnings where there are no results in a list
6598 # request for a particular zone, this key might be scope and
6599 # the key value might be the zone name. Other examples might be a key
6600 # indicating a deprecated resource and a suggested replacement, or a
6601 # warning about invalid network settings (for example, if an instance
6602 # attempts to perform IP forwarding but is not enabled for IP forwarding).
6603 &quot;value&quot;: &quot;A String&quot;, # [Output Only] A warning data value corresponding to the key.
6604 },
6605 ],
6606 &quot;message&quot;: &quot;A String&quot;, # [Output Only] A human-readable description of the warning code.
6607 },
6608 ],
6609 &quot;zone&quot;: &quot;A String&quot;, # [Output Only] The URL of the zone where the operation resides. Only
6610 # applicable when performing per-zone operations.
6611 }</pre>
6612 </div>
6613
6614 </body></html>