#[non_exhaustive]pub struct SecurityPolicy {Show 20 fields
pub adaptive_protection_config: Option<SecurityPolicyAdaptiveProtectionConfig>,
pub advanced_options_config: Option<SecurityPolicyAdvancedOptionsConfig>,
pub associations: Vec<SecurityPolicyAssociation>,
pub creation_timestamp: Option<String>,
pub ddos_protection_config: Option<SecurityPolicyDdosProtectionConfig>,
pub description: Option<String>,
pub fingerprint: Option<Bytes>,
pub id: Option<u64>,
pub kind: Option<String>,
pub label_fingerprint: Option<Bytes>,
pub labels: HashMap<String, String>,
pub name: Option<String>,
pub parent: Option<String>,
pub recaptcha_options_config: Option<SecurityPolicyRecaptchaOptionsConfig>,
pub region: Option<String>,
pub rules: Vec<SecurityPolicyRule>,
pub self_link: Option<String>,
pub short_name: Option<String>,
pub type: Option<Type>,
pub user_defined_fields: Vec<SecurityPolicyUserDefinedField>,
/* private fields */
}organization-security-policies or region-security-policies or security-policies only.Expand description
Represents a Google Cloud Armor security policy resource.
Only external backend services that use load balancers can reference a security policy. For more information, see Google Cloud Armor security policy overview.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.adaptive_protection_config: Option<SecurityPolicyAdaptiveProtectionConfig>§advanced_options_config: Option<SecurityPolicyAdvancedOptionsConfig>§associations: Vec<SecurityPolicyAssociation>A list of associations that belong to this policy.
creation_timestamp: Option<String>Output only. [Output Only] Creation timestamp inRFC3339 text format.
ddos_protection_config: Option<SecurityPolicyDdosProtectionConfig>§description: Option<String>An optional description of this resource. Provide this property when you create the resource.
fingerprint: Option<Bytes>Specifies a fingerprint for this resource, which is essentially a hash of the metadata’s contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error412 conditionNotMet.
To see the latest fingerprint, make get() request to the security policy.
id: Option<u64>Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server.
kind: Option<String>Output only. [Output only] Type of the resource. Alwayscompute#securityPolicyfor security policies
label_fingerprint: Option<Bytes>A fingerprint for the labels being applied to this security policy, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels.
To see the latest fingerprint, make get() request to the security policy.
labels: HashMap<String, String>Labels for this resource. These can only be added or modified by thesetLabels method. Each label key/value pair must comply withRFC1035. Label values may be empty.
name: Option<String>Name of the resource. Provided by the client when the resource is created.
The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first
character must be a lowercase letter, and all following characters must
be a dash, lowercase letter, or digit, except the last character, which
cannot be a dash.
parent: Option<String>Output only. [Output Only] The parent of the security policy.
recaptcha_options_config: Option<SecurityPolicyRecaptchaOptionsConfig>§region: Option<String>Output only. [Output Only] URL of the region where the regional security policy resides. This field is not applicable to global security policies.
rules: Vec<SecurityPolicyRule>A list of rules that belong to this policy. There must always be a default rule which is a rule with priority 2147483647 and match all condition (for the match condition this means match “” for srcIpRanges and for the networkMatch condition every field must be either match “” or not set). If no rules are provided when creating a security policy, a default rule with action “allow” will be added.
self_link: Option<String>Output only. [Output Only] Server-defined URL for the resource.
short_name: Option<String>User-provided name of the organization security policy. The name should be
unique in the organization in which the security policy is created. This
should only be used when SecurityPolicyType is CLOUD_ARMOR.
The name must be 1-63 characters long, and comply with
https://www.ietf.org/rfc/rfc1035.txt. Specifically, the name must be 1-63
characters long and match the regular expression
[a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a
lowercase letter, and all following characters must be a dash, lowercase
letter, or digit, except the last character, which cannot be a dash.
type: Option<Type>The type indicates the intended use of the security policy.
-
CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers.
-
CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google’s cache.
-
CLOUD_ARMOR_INTERNAL_SERVICE (preview only): Cloud Armor internal service policies can be configured to filter HTTP requests targeting services managed by Traffic Director in a service mesh. They filter requests before the request is served from the application.
-
CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application.
This field can be set only at resource creation time.
user_defined_fields: Vec<SecurityPolicyUserDefinedField>Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies. A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits. Rules may then specify matching values for these fields.
Example:
userDefinedFields:
- name: “ipv4_fragment_offset” base: IPV4 offset: 6 size: 2 mask: “0x1fff”
Implementations§
Source§impl SecurityPolicy
impl SecurityPolicy
pub fn new() -> Self
Sourcepub fn set_adaptive_protection_config<T>(self, v: T) -> Selfwhere
T: Into<SecurityPolicyAdaptiveProtectionConfig>,
pub fn set_adaptive_protection_config<T>(self, v: T) -> Selfwhere
T: Into<SecurityPolicyAdaptiveProtectionConfig>,
Sets the value of adaptive_protection_config.
§Example
use google_cloud_compute_v1::model::SecurityPolicyAdaptiveProtectionConfig;
let x = SecurityPolicy::new().set_adaptive_protection_config(SecurityPolicyAdaptiveProtectionConfig::default()/* use setters */);Sourcepub fn set_or_clear_adaptive_protection_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SecurityPolicyAdaptiveProtectionConfig>,
pub fn set_or_clear_adaptive_protection_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SecurityPolicyAdaptiveProtectionConfig>,
Sets or clears the value of adaptive_protection_config.
§Example
use google_cloud_compute_v1::model::SecurityPolicyAdaptiveProtectionConfig;
let x = SecurityPolicy::new().set_or_clear_adaptive_protection_config(Some(SecurityPolicyAdaptiveProtectionConfig::default()/* use setters */));
let x = SecurityPolicy::new().set_or_clear_adaptive_protection_config(None::<SecurityPolicyAdaptiveProtectionConfig>);Sourcepub fn set_advanced_options_config<T>(self, v: T) -> Selfwhere
T: Into<SecurityPolicyAdvancedOptionsConfig>,
pub fn set_advanced_options_config<T>(self, v: T) -> Selfwhere
T: Into<SecurityPolicyAdvancedOptionsConfig>,
Sets the value of advanced_options_config.
§Example
use google_cloud_compute_v1::model::SecurityPolicyAdvancedOptionsConfig;
let x = SecurityPolicy::new().set_advanced_options_config(SecurityPolicyAdvancedOptionsConfig::default()/* use setters */);Sourcepub fn set_or_clear_advanced_options_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SecurityPolicyAdvancedOptionsConfig>,
pub fn set_or_clear_advanced_options_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SecurityPolicyAdvancedOptionsConfig>,
Sets or clears the value of advanced_options_config.
§Example
use google_cloud_compute_v1::model::SecurityPolicyAdvancedOptionsConfig;
let x = SecurityPolicy::new().set_or_clear_advanced_options_config(Some(SecurityPolicyAdvancedOptionsConfig::default()/* use setters */));
let x = SecurityPolicy::new().set_or_clear_advanced_options_config(None::<SecurityPolicyAdvancedOptionsConfig>);Sourcepub fn set_associations<T, V>(self, v: T) -> Self
pub fn set_associations<T, V>(self, v: T) -> Self
Sets the value of associations.
§Example
use google_cloud_compute_v1::model::SecurityPolicyAssociation;
let x = SecurityPolicy::new()
.set_associations([
SecurityPolicyAssociation::default()/* use setters */,
SecurityPolicyAssociation::default()/* use (different) setters */,
]);Sourcepub fn set_creation_timestamp<T>(self, v: T) -> Self
pub fn set_creation_timestamp<T>(self, v: T) -> Self
Sets the value of creation_timestamp.
§Example
let x = SecurityPolicy::new().set_creation_timestamp("example");Sourcepub fn set_or_clear_creation_timestamp<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_creation_timestamp<T>(self, v: Option<T>) -> Self
Sets or clears the value of creation_timestamp.
§Example
let x = SecurityPolicy::new().set_or_clear_creation_timestamp(Some("example"));
let x = SecurityPolicy::new().set_or_clear_creation_timestamp(None::<String>);Sourcepub fn set_ddos_protection_config<T>(self, v: T) -> Selfwhere
T: Into<SecurityPolicyDdosProtectionConfig>,
pub fn set_ddos_protection_config<T>(self, v: T) -> Selfwhere
T: Into<SecurityPolicyDdosProtectionConfig>,
Sets the value of ddos_protection_config.
§Example
use google_cloud_compute_v1::model::SecurityPolicyDdosProtectionConfig;
let x = SecurityPolicy::new().set_ddos_protection_config(SecurityPolicyDdosProtectionConfig::default()/* use setters */);Sourcepub fn set_or_clear_ddos_protection_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SecurityPolicyDdosProtectionConfig>,
pub fn set_or_clear_ddos_protection_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SecurityPolicyDdosProtectionConfig>,
Sets or clears the value of ddos_protection_config.
§Example
use google_cloud_compute_v1::model::SecurityPolicyDdosProtectionConfig;
let x = SecurityPolicy::new().set_or_clear_ddos_protection_config(Some(SecurityPolicyDdosProtectionConfig::default()/* use setters */));
let x = SecurityPolicy::new().set_or_clear_ddos_protection_config(None::<SecurityPolicyDdosProtectionConfig>);Sourcepub fn set_description<T>(self, v: T) -> Self
pub fn set_description<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
Sets or clears the value of description.
§Example
let x = SecurityPolicy::new().set_or_clear_description(Some("example"));
let x = SecurityPolicy::new().set_or_clear_description(None::<String>);Sourcepub fn set_fingerprint<T>(self, v: T) -> Self
pub fn set_fingerprint<T>(self, v: T) -> Self
Sets the value of fingerprint.
§Example
let x = SecurityPolicy::new().set_fingerprint(bytes::Bytes::from_static(b"example"));Sourcepub fn set_or_clear_fingerprint<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_fingerprint<T>(self, v: Option<T>) -> Self
Sets or clears the value of fingerprint.
§Example
let x = SecurityPolicy::new().set_or_clear_fingerprint(Some(bytes::Bytes::from_static(b"example")));
let x = SecurityPolicy::new().set_or_clear_fingerprint(None::<bytes::Bytes>);Sourcepub fn set_or_clear_id<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_id<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
Sourcepub fn set_label_fingerprint<T>(self, v: T) -> Self
pub fn set_label_fingerprint<T>(self, v: T) -> Self
Sets the value of label_fingerprint.
§Example
let x = SecurityPolicy::new().set_label_fingerprint(bytes::Bytes::from_static(b"example"));Sourcepub fn set_or_clear_label_fingerprint<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_label_fingerprint<T>(self, v: Option<T>) -> Self
Sets or clears the value of label_fingerprint.
§Example
let x = SecurityPolicy::new().set_or_clear_label_fingerprint(Some(bytes::Bytes::from_static(b"example")));
let x = SecurityPolicy::new().set_or_clear_label_fingerprint(None::<bytes::Bytes>);Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_or_clear_name<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_name<T>(self, v: Option<T>) -> Self
Sourcepub fn set_parent<T>(self, v: T) -> Self
pub fn set_parent<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_parent<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_parent<T>(self, v: Option<T>) -> Self
Sourcepub fn set_recaptcha_options_config<T>(self, v: T) -> Selfwhere
T: Into<SecurityPolicyRecaptchaOptionsConfig>,
pub fn set_recaptcha_options_config<T>(self, v: T) -> Selfwhere
T: Into<SecurityPolicyRecaptchaOptionsConfig>,
Sets the value of recaptcha_options_config.
§Example
use google_cloud_compute_v1::model::SecurityPolicyRecaptchaOptionsConfig;
let x = SecurityPolicy::new().set_recaptcha_options_config(SecurityPolicyRecaptchaOptionsConfig::default()/* use setters */);Sourcepub fn set_or_clear_recaptcha_options_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SecurityPolicyRecaptchaOptionsConfig>,
pub fn set_or_clear_recaptcha_options_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<SecurityPolicyRecaptchaOptionsConfig>,
Sets or clears the value of recaptcha_options_config.
§Example
use google_cloud_compute_v1::model::SecurityPolicyRecaptchaOptionsConfig;
let x = SecurityPolicy::new().set_or_clear_recaptcha_options_config(Some(SecurityPolicyRecaptchaOptionsConfig::default()/* use setters */));
let x = SecurityPolicy::new().set_or_clear_recaptcha_options_config(None::<SecurityPolicyRecaptchaOptionsConfig>);Sourcepub fn set_region<T>(self, v: T) -> Self
pub fn set_region<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_region<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_region<T>(self, v: Option<T>) -> Self
Sourcepub fn set_self_link<T>(self, v: T) -> Self
pub fn set_self_link<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_self_link<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_self_link<T>(self, v: Option<T>) -> Self
Sourcepub fn set_short_name<T>(self, v: T) -> Self
pub fn set_short_name<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_short_name<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_short_name<T>(self, v: Option<T>) -> Self
Sets or clears the value of short_name.
§Example
let x = SecurityPolicy::new().set_or_clear_short_name(Some("example"));
let x = SecurityPolicy::new().set_or_clear_short_name(None::<String>);Sourcepub fn set_or_clear_type<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_type<T>(self, v: Option<T>) -> Self
Sets or clears the value of r#type.
§Example
use google_cloud_compute_v1::model::security_policy::Type;
let x0 = SecurityPolicy::new().set_or_clear_type(Some(Type::CloudArmorEdge));
let x1 = SecurityPolicy::new().set_or_clear_type(Some(Type::CloudArmorNetwork));
let x_none = SecurityPolicy::new().set_or_clear_type(None::<Type>);Sourcepub fn set_user_defined_fields<T, V>(self, v: T) -> Self
pub fn set_user_defined_fields<T, V>(self, v: T) -> Self
Sets the value of user_defined_fields.
§Example
use google_cloud_compute_v1::model::SecurityPolicyUserDefinedField;
let x = SecurityPolicy::new()
.set_user_defined_fields([
SecurityPolicyUserDefinedField::default()/* use setters */,
SecurityPolicyUserDefinedField::default()/* use (different) setters */,
]);Trait Implementations§
Source§impl Clone for SecurityPolicy
impl Clone for SecurityPolicy
Source§fn clone(&self) -> SecurityPolicy
fn clone(&self) -> SecurityPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more