#[non_exhaustive]pub struct MetadataFilter {
pub filter_labels: Vec<MetadataFilterLabelMatch>,
pub filter_match_criteria: Option<FilterMatchCriteria>,
/* private fields */
}forwarding-rules or global-forwarding-rules or region-url-maps or url-maps only.Expand description
Opaque filter criteria used by load balancers to restrict routing configuration to a limited set of load balancing proxies. Proxies and sidecars involved in load balancing would typically present metadata to the load balancers that need to match criteria specified here. If a match takes place, the relevant configuration is made available to those proxies.
For each metadataFilter in this list, if itsfilterMatchCriteria is set to MATCH_ANY, at least one of thefilterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata.
An example for using metadataFilters would be: if load balancing involves Envoys, they receive routing configuration when values inmetadataFilters match values supplied in of their XDS requests to loadbalancers.
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.filter_labels: Vec<MetadataFilterLabelMatch>The list of label value pairs that must match labels in the provided metadata based on filterMatchCriteria
This list must not be empty and can have at the most 64 entries.
filter_match_criteria: Option<FilterMatchCriteria>Specifies how individual filter label matches within the list of filterLabels and contributes toward the overall metadataFilter match.
Supported values are:
- MATCH_ANY: at least one of the filterLabels must have a matching label in the provided metadata.
- MATCH_ALL: all filterLabels must have matching labels in the provided metadata.
Implementations§
Source§impl MetadataFilter
impl MetadataFilter
pub fn new() -> Self
Sourcepub fn set_filter_labels<T, V>(self, v: T) -> Self
pub fn set_filter_labels<T, V>(self, v: T) -> Self
Sets the value of filter_labels.
§Example
use google_cloud_compute_v1::model::MetadataFilterLabelMatch;
let x = MetadataFilter::new()
.set_filter_labels([
MetadataFilterLabelMatch::default()/* use setters */,
MetadataFilterLabelMatch::default()/* use (different) setters */,
]);Sourcepub fn set_filter_match_criteria<T>(self, v: T) -> Selfwhere
T: Into<FilterMatchCriteria>,
pub fn set_filter_match_criteria<T>(self, v: T) -> Selfwhere
T: Into<FilterMatchCriteria>,
Sets the value of filter_match_criteria.
§Example
use google_cloud_compute_v1::model::metadata_filter::FilterMatchCriteria;
let x0 = MetadataFilter::new().set_filter_match_criteria(FilterMatchCriteria::MatchAny);
let x1 = MetadataFilter::new().set_filter_match_criteria(FilterMatchCriteria::NotSet);Sourcepub fn set_or_clear_filter_match_criteria<T>(self, v: Option<T>) -> Selfwhere
T: Into<FilterMatchCriteria>,
pub fn set_or_clear_filter_match_criteria<T>(self, v: Option<T>) -> Selfwhere
T: Into<FilterMatchCriteria>,
Sets or clears the value of filter_match_criteria.
§Example
use google_cloud_compute_v1::model::metadata_filter::FilterMatchCriteria;
let x0 = MetadataFilter::new().set_or_clear_filter_match_criteria(Some(FilterMatchCriteria::MatchAny));
let x1 = MetadataFilter::new().set_or_clear_filter_match_criteria(Some(FilterMatchCriteria::NotSet));
let x_none = MetadataFilter::new().set_or_clear_filter_match_criteria(None::<FilterMatchCriteria>);Trait Implementations§
Source§impl Clone for MetadataFilter
impl Clone for MetadataFilter
Source§fn clone(&self) -> MetadataFilter
fn clone(&self) -> MetadataFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more