Debian Codegraph @

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