Reference documentation and code samples for the Service Directory V1beta1 API class Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.
Client for the LookupService service.
Service Directory API for looking up service data at runtime.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the LookupService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all LookupService clients ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the LookupService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#initialize
def initialize() { |config| ... } -> Client
Create a new LookupService client object.
- (config) — Configure the LookupService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new do |config| config.timeout = 10.0 end
#location_client
def location_client() -> Google::Cloud::Location::Locations::Client
Get the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#resolve_service
def resolve_service(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse
def resolve_service(name: nil, max_endpoints: nil, endpoint_filter: nil) -> ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse
Returns a service and its associated endpoints. Resolving a service is not considered an active developer method.
def resolve_service(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse
resolve_service
via a request object, either of type
ResolveServiceRequest or an equivalent Hash.
- request (::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def resolve_service(name: nil, max_endpoints: nil, endpoint_filter: nil) -> ::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse
resolve_service
via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. The name of the service to resolve.
- max_endpoints (::Integer) — Optional. 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 (::String) — Optional. The filter applied to the endpoints of the resolved service.
General
filter
string syntax:<field> <operator> <value> (<logical connector>)
-
<field>
can bename
,address
,port
, ormetadata.<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:
-
metadata.owner
returns endpoints that have a annotation with the keyowner
, this is the same asmetadata:owner
-
metadata.protocol=gRPC
returns endpoints that have key/valueprotocol=gRPC
-
address=192.108.1.105
returns endpoints that have this address -
port>8080
returns 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 toep-1
-
metadata.owner!=sd AND metadata.foo=bar
returns endpoints that haveowner
in annotation key but value is notsd
AND have key/valuefoo=bar
-
doesnotexist.foo=bar
returns 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.
-
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/service_directory/v1beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new # Call the resolve_service method. result = client.resolve_service request # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse. p result
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)