#[non_exhaustive]pub struct ResolveServiceRequest {
pub name: String,
pub max_endpoints: i32,
pub endpoint_filter: String,
/* private fields */
}Expand description
The request message for LookupService.ResolveService. Looks up a service by its name, returns the service and its endpoints.
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.name: StringRequired. The name of the service to resolve.
max_endpoints: i32Optional. The maximum number of endpoints to return. Defaults to 25. Maximum is 100. If a value less than one is specified, the Default is used. If a value greater than the Maximum is specified, the Maximum is used.
endpoint_filter: StringOptional. The filter applied to the endpoints of the resolved service.
General filter string syntax:
<field> <operator> <value> (<logical connector>)
<field>can bename,address,port, orannotations.<key>for map field<operator>can be<,>,<=,>=,!=,=,:. Of which:meansHAS, and is roughly the same as=<value>must be the same data type as field<logical connector>can beAND,OR,NOT
Examples of valid filters:
annotations.ownerreturns endpoints that have a annotation with the keyowner, this is the same asannotations:ownerannotations.protocol=gRPCreturns endpoints that have key/valueprotocol=gRPCaddress=192.108.1.105returns endpoints that have this addressport>8080returns endpoints that have port number larger than 8080
name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c
returns endpoints that have name that is alphabetically later than the
string, so “endpoint-e” is returned but “endpoint-a” is not
*
name=projects/my-project/locations/us-central1/namespaces/my-namespace/services/my-service/endpoints/ep-1
returns the endpoint that has an endpoint_id equal to ep-1
annotations.owner!=sd AND annotations.foo=barreturns endpoints that haveownerin annotation key but value is notsdAND have key/valuefoo=bardoesnotexist.foo=barreturns an empty list. Note that endpoint doesn’t have a field called “doesnotexist”. Since the filter does not match any endpoint, it returns no results
For more information about filtering, see API Filtering.
Implementations§
Source§impl ResolveServiceRequest
impl ResolveServiceRequest
Sourcepub fn set_max_endpoints<T: Into<i32>>(self, v: T) -> Self
pub fn set_max_endpoints<T: Into<i32>>(self, v: T) -> Self
Sets the value of max_endpoints.
§Example
let x = ResolveServiceRequest::new().set_max_endpoints(42);Sourcepub fn set_endpoint_filter<T: Into<String>>(self, v: T) -> Self
pub fn set_endpoint_filter<T: Into<String>>(self, v: T) -> Self
Sets the value of endpoint_filter.
§Example
let x = ResolveServiceRequest::new().set_endpoint_filter("example");Trait Implementations§
Source§impl Clone for ResolveServiceRequest
impl Clone for ResolveServiceRequest
Source§fn clone(&self) -> ResolveServiceRequest
fn clone(&self) -> ResolveServiceRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more