Class LookupServiceClient (0.2.0)

LookupServiceClient(*, credentials: google.auth.credentials.Credentials = None, transport: Union[str, google.cloud.servicedirectory_v1beta1.services.lookup_service.transports.base.LookupServiceTransport] = None, client_options: <module 'google.api_core.client_options' from '/workspace/python-service-directory/.nox/docfx/lib/python3.9/site-packages/google/api_core/client_options.py'> = None)

Service Directory API for looking up service data at runtime.

Methods

LookupServiceClient

LookupServiceClient(*, credentials: google.auth.credentials.Credentials = None, transport: Union[str, google.cloud.servicedirectory_v1beta1.services.lookup_service.transports.base.LookupServiceTransport] = None, client_options: <module 'google.api_core.client_options' from '/workspace/python-service-directory/.nox/docfx/lib/python3.9/site-packages/google/api_core/client_options.py'> = None)

Instantiate the lookup service client.

Parameters
NameDescription
credentials Optional[google.auth.credentials.Credentials]

The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment.

transport Union[str, .LookupServiceTransport]

The transport to use. If set to None, a transport is chosen automatically.

client_options ClientOptions

Custom options for the client. (1) The api_endpoint property can be used to override the default endpoint provided by the client. (2) If transport argument is None, client_options can be used to create a mutual TLS transport. If client_cert_source is provided, mutual TLS transport will be created with the given api_endpoint or the default mTLS endpoint, and the client SSL credentials obtained from client_cert_source.

Exceptions
TypeDescription
google.auth.exceptions.MutualTlsChannelErrorIf mutual TLS transport creation failed for any reason.

from_service_account_file

from_service_account_file(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
NameDescription
filename str

The path to the service account private key json file.

Returns
TypeDescription
{@api.name}The constructed client.

from_service_account_json

from_service_account_json(filename: str, *args, **kwargs)

Creates an instance of this client using the provided credentials file.

Parameter
NameDescription
filename str

The path to the service account private key json file.

Returns
TypeDescription
{@api.name}The constructed client.

resolve_service

resolve_service(request: Optional[google.cloud.servicedirectory_v1beta1.types.lookup_service.ResolveServiceRequest] = None, *, retry: google.api_core.retry.Retry = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = ())

Returns a xref_service and its associated endpoints. Resolving a service is not considered an active developer method.

Parameters
NameDescription
request .lookup_service.ResolveServiceRequest

The request object. The request message for LookupService.ResolveService. Looks up a service by its name, returns the service and its endpoints.

retry google.api_core.retry.Retry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request.

metadata Sequence[Tuple[str, str]]

Strings which should be sent along with the request as metadata.

Returns
TypeDescription
.lookup_service.ResolveServiceResponseThe response message for LookupService.ResolveService.