#[non_exhaustive]pub struct HttpRouteRuleMatch {
pub full_path_match: Option<String>,
pub header_matches: Vec<HttpHeaderMatch>,
pub ignore_case: Option<bool>,
pub metadata_filters: Vec<MetadataFilter>,
pub path_template_match: Option<String>,
pub prefix_match: Option<String>,
pub query_parameter_matches: Vec<HttpQueryParameterMatch>,
pub regex_match: Option<String>,
/* private fields */
}region-url-maps or url-maps only.Expand description
HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur.
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.full_path_match: Option<String>For satisfying the matchRule condition, the path of the request must exactly match the value specified infullPathMatch after removing any query parameters and anchor that may be part of the original URL.
fullPathMatch must be from 1 to 1024 characters.
Only one of prefixMatch, fullPathMatch,regexMatch or path_template_match must be specified.
header_matches: Vec<HttpHeaderMatch>Specifies a list of header match criteria, all of which must match corresponding headers in the request.
ignore_case: Option<bool>Specifies that prefixMatch and fullPathMatch matches are case sensitive.
The default value is false.
ignoreCase must not be used with regexMatch.
Not supported when the URL map is bound to a target gRPC proxy.
metadata_filters: Vec<MetadataFilter>Opaque filter criteria used by the load balancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to the load balancer, xDS clients present node metadata. When there is a match, the relevant routing 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. If multiple metadata filters are specified, all of them need to be satisfied in order to be considered a match.
metadataFilters specified here is applied after those specified in ForwardingRule that refers to theUrlMap this HttpRouteRuleMatch belongs to.
metadataFilters only applies to load balancers that haveloadBalancingScheme set toINTERNAL_SELF_MANAGED.
Not supported when the URL map is bound to a target gRPC proxy that has validateForProxyless field set to true.
path_template_match: Option<String>If specified, this field defines a path template pattern that must match the :path header after the query string is removed.
A path template pattern can include variables and wildcards. Variables are enclosed in curly braces, for example{variable_name}. Wildcards include * that matches a single path segment, and ** that matches zero or more path segments. The pattern must follow these rules:
- The value must be between 1 and 1024 characters.
- The pattern must start with a leading slash ("/").
- No more than 5 operators (variables or wildcards) may appear in
the pattern.Precisely one ofprefixMatch, fullPathMatch,regexMatch, or pathTemplateMatch must be set.
prefix_match: Option<String>For satisfying the matchRule condition, the request’s path must begin with the specified prefixMatch.prefixMatch must begin with a /.
The value must be from 1 to 1024 characters.
The * character inside a prefix match is treated as a literal character, not as a wildcard.
Only one of prefixMatch, fullPathMatch,regexMatch or path_template_match can be used within a matchRule.
query_parameter_matches: Vec<HttpQueryParameterMatch>Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request.
Not supported when the URL map is bound to a target gRPC proxy.
regex_match: Option<String>For satisfying the matchRule condition, the path of the request must satisfy the regular expression specified inregexMatch after removing any query parameters and anchor supplied with the original URL. For more information about regular expression syntax, see Syntax.
Only one of prefixMatch, fullPathMatch,regexMatch or path_template_match must be specified.
Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED, EXTERNAL_MANAGED (regional scope) or INTERNAL_MANAGED.
Implementations§
Source§impl HttpRouteRuleMatch
impl HttpRouteRuleMatch
pub fn new() -> Self
Sourcepub fn set_full_path_match<T>(self, v: T) -> Self
pub fn set_full_path_match<T>(self, v: T) -> Self
Sets the value of full_path_match.
§Example
let x = HttpRouteRuleMatch::new().set_full_path_match("example");Sourcepub fn set_or_clear_full_path_match<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_full_path_match<T>(self, v: Option<T>) -> Self
Sets or clears the value of full_path_match.
§Example
let x = HttpRouteRuleMatch::new().set_or_clear_full_path_match(Some("example"));
let x = HttpRouteRuleMatch::new().set_or_clear_full_path_match(None::<String>);Sourcepub fn set_header_matches<T, V>(self, v: T) -> Self
pub fn set_header_matches<T, V>(self, v: T) -> Self
Sets the value of header_matches.
§Example
use google_cloud_compute_v1::model::HttpHeaderMatch;
let x = HttpRouteRuleMatch::new()
.set_header_matches([
HttpHeaderMatch::default()/* use setters */,
HttpHeaderMatch::default()/* use (different) setters */,
]);Sourcepub fn set_ignore_case<T>(self, v: T) -> Self
pub fn set_ignore_case<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_ignore_case<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_ignore_case<T>(self, v: Option<T>) -> Self
Sets or clears the value of ignore_case.
§Example
let x = HttpRouteRuleMatch::new().set_or_clear_ignore_case(Some(false));
let x = HttpRouteRuleMatch::new().set_or_clear_ignore_case(None::<bool>);Sourcepub fn set_metadata_filters<T, V>(self, v: T) -> Self
pub fn set_metadata_filters<T, V>(self, v: T) -> Self
Sets the value of metadata_filters.
§Example
use google_cloud_compute_v1::model::MetadataFilter;
let x = HttpRouteRuleMatch::new()
.set_metadata_filters([
MetadataFilter::default()/* use setters */,
MetadataFilter::default()/* use (different) setters */,
]);Sourcepub fn set_path_template_match<T>(self, v: T) -> Self
pub fn set_path_template_match<T>(self, v: T) -> Self
Sets the value of path_template_match.
§Example
let x = HttpRouteRuleMatch::new().set_path_template_match("example");Sourcepub fn set_or_clear_path_template_match<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_path_template_match<T>(self, v: Option<T>) -> Self
Sets or clears the value of path_template_match.
§Example
let x = HttpRouteRuleMatch::new().set_or_clear_path_template_match(Some("example"));
let x = HttpRouteRuleMatch::new().set_or_clear_path_template_match(None::<String>);Sourcepub fn set_prefix_match<T>(self, v: T) -> Self
pub fn set_prefix_match<T>(self, v: T) -> Self
Sets the value of prefix_match.
§Example
let x = HttpRouteRuleMatch::new().set_prefix_match("example");Sourcepub fn set_or_clear_prefix_match<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_prefix_match<T>(self, v: Option<T>) -> Self
Sets or clears the value of prefix_match.
§Example
let x = HttpRouteRuleMatch::new().set_or_clear_prefix_match(Some("example"));
let x = HttpRouteRuleMatch::new().set_or_clear_prefix_match(None::<String>);Sourcepub fn set_query_parameter_matches<T, V>(self, v: T) -> Self
pub fn set_query_parameter_matches<T, V>(self, v: T) -> Self
Sets the value of query_parameter_matches.
§Example
use google_cloud_compute_v1::model::HttpQueryParameterMatch;
let x = HttpRouteRuleMatch::new()
.set_query_parameter_matches([
HttpQueryParameterMatch::default()/* use setters */,
HttpQueryParameterMatch::default()/* use (different) setters */,
]);Sourcepub fn set_regex_match<T>(self, v: T) -> Self
pub fn set_regex_match<T>(self, v: T) -> Self
Sets the value of regex_match.
§Example
let x = HttpRouteRuleMatch::new().set_regex_match("example");Sourcepub fn set_or_clear_regex_match<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_regex_match<T>(self, v: Option<T>) -> Self
Sets or clears the value of regex_match.
§Example
let x = HttpRouteRuleMatch::new().set_or_clear_regex_match(Some("example"));
let x = HttpRouteRuleMatch::new().set_or_clear_regex_match(None::<String>);Trait Implementations§
Source§impl Clone for HttpRouteRuleMatch
impl Clone for HttpRouteRuleMatch
Source§fn clone(&self) -> HttpRouteRuleMatch
fn clone(&self) -> HttpRouteRuleMatch
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more