Class v1.LookupServiceClient (3.1.2)

Service Directory API for looking up service data at runtime. v1

Package

@google-cloud/service-directory!

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of LookupServiceClient.

Parameter
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

Property Value
TypeDescription
string

auth

auth: gax.GoogleAuth;
Property Value
TypeDescription
gax.GoogleAuth

descriptors

descriptors: Descriptors;
Property Value
TypeDescription
Descriptors

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };
Property Value
TypeDescription
{ [name: string]: Function; }

lookupServiceStub

lookupServiceStub?: Promise<{
        [name: string]: Function;
    }>;
Property Value
TypeDescription
Promise<{ [name: string]: Function; }>

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };
Property Value
TypeDescription
{ [name: string]: gax.PathTemplate; }

port

static get port(): number;

The port for this API service.

Property Value
TypeDescription
number

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

Property Value
TypeDescription
string[]

servicePath

static get servicePath(): string;

The DNS address for this API service.

Property Value
TypeDescription
string

Methods

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

endpointPath(project, location, namespace, service, endpoint)

endpointPath(project: string, location: string, namespace: string, service: string, endpoint: string): string;

Return a fully-qualified endpoint resource name string.

Parameters
NameDescription
project string
location string
namespace string
service string
endpoint string
Returns
TypeDescription
string

{string} Resource name string.

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

matchEndpointFromEndpointName(endpointName)

matchEndpointFromEndpointName(endpointName: string): string | number;

Parse the endpoint from Endpoint resource.

Parameter
NameDescription
endpointName string

A fully-qualified path representing Endpoint resource.

Returns
TypeDescription
string | number

{string} A string representing the endpoint.

matchLocationFromEndpointName(endpointName)

matchLocationFromEndpointName(endpointName: string): string | number;

Parse the location from Endpoint resource.

Parameter
NameDescription
endpointName string

A fully-qualified path representing Endpoint resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromNamespaceName(namespaceName)

matchLocationFromNamespaceName(namespaceName: string): string | number;

Parse the location from Namespace resource.

Parameter
NameDescription
namespaceName string

A fully-qualified path representing Namespace resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromServiceName(serviceName)

matchLocationFromServiceName(serviceName: string): string | number;

Parse the location from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchNamespaceFromEndpointName(endpointName)

matchNamespaceFromEndpointName(endpointName: string): string | number;

Parse the namespace from Endpoint resource.

Parameter
NameDescription
endpointName string

A fully-qualified path representing Endpoint resource.

Returns
TypeDescription
string | number

{string} A string representing the namespace.

matchNamespaceFromNamespaceName(namespaceName)

matchNamespaceFromNamespaceName(namespaceName: string): string | number;

Parse the namespace from Namespace resource.

Parameter
NameDescription
namespaceName string

A fully-qualified path representing Namespace resource.

Returns
TypeDescription
string | number

{string} A string representing the namespace.

matchNamespaceFromServiceName(serviceName)

matchNamespaceFromServiceName(serviceName: string): string | number;

Parse the namespace from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the namespace.

matchProjectFromEndpointName(endpointName)

matchProjectFromEndpointName(endpointName: string): string | number;

Parse the project from Endpoint resource.

Parameter
NameDescription
endpointName string

A fully-qualified path representing Endpoint resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromNamespaceName(namespaceName)

matchProjectFromNamespaceName(namespaceName: string): string | number;

Parse the project from Namespace resource.

Parameter
NameDescription
namespaceName string

A fully-qualified path representing Namespace resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromServiceName(serviceName)

matchProjectFromServiceName(serviceName: string): string | number;

Parse the project from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchServiceFromEndpointName(endpointName)

matchServiceFromEndpointName(endpointName: string): string | number;

Parse the service from Endpoint resource.

Parameter
NameDescription
endpointName string

A fully-qualified path representing Endpoint resource.

Returns
TypeDescription
string | number

{string} A string representing the service.

matchServiceFromServiceName(serviceName)

matchServiceFromServiceName(serviceName: string): string | number;

Parse the service from Service resource.

Parameter
NameDescription
serviceName string

A fully-qualified path representing Service resource.

Returns
TypeDescription
string | number

{string} A string representing the service.

namespacePath(project, location, namespace)

namespacePath(project: string, location: string, namespace: string): string;

Return a fully-qualified namespace resource name string.

Parameters
NameDescription
project string
location string
namespace string
Returns
TypeDescription
string

{string} Resource name string.

resolveService(request, options)

resolveService(request: protos.google.cloud.servicedirectory.v1.IResolveServiceRequest, options?: CallOptions): Promise<[protos.google.cloud.servicedirectory.v1.IResolveServiceResponse, (protos.google.cloud.servicedirectory.v1.IResolveServiceRequest | undefined), {} | undefined]>;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IResolveServiceRequest
options CallOptions
Returns
TypeDescription
Promise<[protos.google.cloud.servicedirectory.v1.IResolveServiceResponse, (protos.google.cloud.servicedirectory.v1.IResolveServiceRequest | undefined), {} | undefined]>

resolveService(request, options, callback)

resolveService(request: protos.google.cloud.servicedirectory.v1.IResolveServiceRequest, options: CallOptions, callback: Callback<protos.google.cloud.servicedirectory.v1.IResolveServiceResponse, protos.google.cloud.servicedirectory.v1.IResolveServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IResolveServiceRequest
options CallOptions
callback Callback<protos.google.cloud.servicedirectory.v1.IResolveServiceResponse, protos.google.cloud.servicedirectory.v1.IResolveServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

resolveService(request, callback)

resolveService(request: protos.google.cloud.servicedirectory.v1.IResolveServiceRequest, callback: Callback<protos.google.cloud.servicedirectory.v1.IResolveServiceResponse, protos.google.cloud.servicedirectory.v1.IResolveServiceRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.servicedirectory.v1.IResolveServiceRequest
callback Callback<protos.google.cloud.servicedirectory.v1.IResolveServiceResponse, protos.google.cloud.servicedirectory.v1.IResolveServiceRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

servicePath(project, location, namespace, service)

servicePath(project: string, location: string, namespace: string, service: string): string;

Return a fully-qualified service resource name string.

Parameters
NameDescription
project string
location string
namespace string
service string
Returns
TypeDescription
string

{string} Resource name string.