Debian Codegraph @

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