#[non_exhaustive]pub struct UrlMapTest {
pub description: Option<String>,
pub expected_output_url: Option<String>,
pub expected_redirect_response_code: Option<i32>,
pub headers: Vec<UrlMapTestHeader>,
pub host: Option<String>,
pub path: Option<String>,
pub service: Option<String>,
/* private fields */
}region-url-maps or url-maps only.Expand description
Message for the expected URL mappings.
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.description: Option<String>Description of this test case.
expected_output_url: Option<String>The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters.
For rules that forward requests to backends, the test passes only whenexpectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matcheshostRewrite and pathPrefixRewrite in theurlRewrite action. When service is specified,expectedOutputUrl`s scheme is ignored.
For rules with urlRedirect, the test passes only ifexpectedOutputUrl matches the URL in the load balancer’s redirect response. If urlRedirect specifieshttps_redirect, the test passes only if the scheme inexpectedOutputUrl is also set to HTTPS. If urlRedirect specifies strip_query, the test passes only if expectedOutputUrl does not contain any query parameters.
expectedOutputUrl is optional whenservice is specified.
expected_redirect_response_code: Option<i32>For rules with urlRedirect, the test passes only ifexpectedRedirectResponseCode matches the HTTP status code in load balancer’s redirect response.
expectedRedirectResponseCode cannot be set whenservice is set.
headers: Vec<UrlMapTestHeader>HTTP headers for this request. If headers contains a host header, then host must also match the header value.
host: Option<String>Host portion of the URL. If headers contains a host header, then host must also match the header value.
path: Option<String>Path portion of the URL.
service: Option<String>Expected BackendService or BackendBucket resource the given URL should be mapped to.
The service field cannot be set if expectedRedirectResponseCode is set.
Implementations§
Source§impl UrlMapTest
impl UrlMapTest
pub fn new() -> Self
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 = UrlMapTest::new().set_or_clear_description(Some("example"));
let x = UrlMapTest::new().set_or_clear_description(None::<String>);Sourcepub fn set_expected_output_url<T>(self, v: T) -> Self
pub fn set_expected_output_url<T>(self, v: T) -> Self
Sets the value of expected_output_url.
§Example
let x = UrlMapTest::new().set_expected_output_url("example");Sourcepub fn set_or_clear_expected_output_url<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_expected_output_url<T>(self, v: Option<T>) -> Self
Sets or clears the value of expected_output_url.
§Example
let x = UrlMapTest::new().set_or_clear_expected_output_url(Some("example"));
let x = UrlMapTest::new().set_or_clear_expected_output_url(None::<String>);Sourcepub fn set_expected_redirect_response_code<T>(self, v: T) -> Self
pub fn set_expected_redirect_response_code<T>(self, v: T) -> Self
Sets the value of expected_redirect_response_code.
§Example
let x = UrlMapTest::new().set_expected_redirect_response_code(42);Sourcepub fn set_or_clear_expected_redirect_response_code<T>(
self,
v: Option<T>,
) -> Self
pub fn set_or_clear_expected_redirect_response_code<T>( self, v: Option<T>, ) -> Self
Sets or clears the value of expected_redirect_response_code.
§Example
let x = UrlMapTest::new().set_or_clear_expected_redirect_response_code(Some(42));
let x = UrlMapTest::new().set_or_clear_expected_redirect_response_code(None::<i32>);Sourcepub fn set_headers<T, V>(self, v: T) -> Self
pub fn set_headers<T, V>(self, v: T) -> Self
Sourcepub fn set_or_clear_host<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_host<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_path<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_path<T>(self, v: Option<T>) -> Self
Sourcepub fn set_service<T>(self, v: T) -> Self
pub fn set_service<T>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for UrlMapTest
impl Clone for UrlMapTest
Source§fn clone(&self) -> UrlMapTest
fn clone(&self) -> UrlMapTest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more