Class v1beta1.GatewayServiceClient (3.2.0)

Gateway service is a public API which works as a Kubernetes resource model proxy between end users and registered Kubernetes clusters. Each RPC in this service matches with an HTTP verb. End user will initiate kubectl commands against the Gateway service, and Gateway service will forward user requests to clusters. v1beta1

Package

@google-cloud/gke-connect-gateway

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of GatewayServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new GatewayServiceClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

gatewayServiceStub

gatewayServiceStub?: Promise<{
        [name: string]: Function;
    }>;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

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

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

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.

deleteResource(request, options)

deleteResource(request?: protos.google.api.IHttpBody, options?: CallOptions): Promise<[
        protos.google.api.IHttpBody,
        protos.google.api.IHttpBody | undefined,
        {} | undefined
    ]>;

DeleteResource performs an HTTP DELETE on the Kubernetes API Server.

Parameters
NameDescription
request IHttpBody

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.IHttpBody, protos.google.api.IHttpBody | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing HttpBody. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The HTTP Content-Type header value specifying the content type of the body.
   */
  // const contentType = 'abc123'
  /**
   *  The HTTP request/response body as raw binary.
   */
  // const data = Buffer.from('string')
  /**
   *  Application specific response metadata. Must be set in the first response
   *  for streaming APIs.
   */
  // const extensions = [1,2,3,4]

  // Imports the Gateway library
  const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway').v1beta1;

  // Instantiates a client
  const gatewayClient = new GatewayServiceClient();

  async function callDeleteResource() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await gatewayClient.deleteResource(request);
    console.log(response);
  }

  callDeleteResource();

deleteResource(request, options, callback)

deleteResource(request: protos.google.api.IHttpBody, options: CallOptions, callback: Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IHttpBody
options CallOptions
callback Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteResource(request, callback)

deleteResource(request: protos.google.api.IHttpBody, callback: Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IHttpBody
callback Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

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

getResource(request, options)

getResource(request?: protos.google.api.IHttpBody, options?: CallOptions): Promise<[
        protos.google.api.IHttpBody,
        protos.google.api.IHttpBody | undefined,
        {} | undefined
    ]>;

GetResource performs an HTTP GET request on the Kubernetes API Server.

Parameters
NameDescription
request IHttpBody

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.IHttpBody, protos.google.api.IHttpBody | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing HttpBody. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The HTTP Content-Type header value specifying the content type of the body.
   */
  // const contentType = 'abc123'
  /**
   *  The HTTP request/response body as raw binary.
   */
  // const data = Buffer.from('string')
  /**
   *  Application specific response metadata. Must be set in the first response
   *  for streaming APIs.
   */
  // const extensions = [1,2,3,4]

  // Imports the Gateway library
  const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway').v1beta1;

  // Instantiates a client
  const gatewayClient = new GatewayServiceClient();

  async function callGetResource() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await gatewayClient.getResource(request);
    console.log(response);
  }

  callGetResource();

getResource(request, options, callback)

getResource(request: protos.google.api.IHttpBody, options: CallOptions, callback: Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IHttpBody
options CallOptions
callback Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getResource(request, callback)

getResource(request: protos.google.api.IHttpBody, callback: Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IHttpBody
callback Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | 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.

patchResource(request, options)

patchResource(request?: protos.google.api.IHttpBody, options?: CallOptions): Promise<[
        protos.google.api.IHttpBody,
        protos.google.api.IHttpBody | undefined,
        {} | undefined
    ]>;

PatchResource performs an HTTP PATCH on the Kubernetes API Server.

Parameters
NameDescription
request IHttpBody

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.IHttpBody, protos.google.api.IHttpBody | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing HttpBody. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The HTTP Content-Type header value specifying the content type of the body.
   */
  // const contentType = 'abc123'
  /**
   *  The HTTP request/response body as raw binary.
   */
  // const data = Buffer.from('string')
  /**
   *  Application specific response metadata. Must be set in the first response
   *  for streaming APIs.
   */
  // const extensions = [1,2,3,4]

  // Imports the Gateway library
  const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway').v1beta1;

  // Instantiates a client
  const gatewayClient = new GatewayServiceClient();

  async function callPatchResource() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await gatewayClient.patchResource(request);
    console.log(response);
  }

  callPatchResource();

patchResource(request, options, callback)

patchResource(request: protos.google.api.IHttpBody, options: CallOptions, callback: Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IHttpBody
options CallOptions
callback Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

patchResource(request, callback)

patchResource(request: protos.google.api.IHttpBody, callback: Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IHttpBody
callback Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

postResource(request, options)

postResource(request?: protos.google.api.IHttpBody, options?: CallOptions): Promise<[
        protos.google.api.IHttpBody,
        protos.google.api.IHttpBody | undefined,
        {} | undefined
    ]>;

PostResource performs an HTTP POST on the Kubernetes API Server.

Parameters
NameDescription
request IHttpBody

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.IHttpBody, protos.google.api.IHttpBody | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing HttpBody. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The HTTP Content-Type header value specifying the content type of the body.
   */
  // const contentType = 'abc123'
  /**
   *  The HTTP request/response body as raw binary.
   */
  // const data = Buffer.from('string')
  /**
   *  Application specific response metadata. Must be set in the first response
   *  for streaming APIs.
   */
  // const extensions = [1,2,3,4]

  // Imports the Gateway library
  const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway').v1beta1;

  // Instantiates a client
  const gatewayClient = new GatewayServiceClient();

  async function callPostResource() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await gatewayClient.postResource(request);
    console.log(response);
  }

  callPostResource();

postResource(request, options, callback)

postResource(request: protos.google.api.IHttpBody, options: CallOptions, callback: Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IHttpBody
options CallOptions
callback Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

postResource(request, callback)

postResource(request: protos.google.api.IHttpBody, callback: Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IHttpBody
callback Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

putResource(request, options)

putResource(request?: protos.google.api.IHttpBody, options?: CallOptions): Promise<[
        protos.google.api.IHttpBody,
        protos.google.api.IHttpBody | undefined,
        {} | undefined
    ]>;

PutResource performs an HTTP PUT on the Kubernetes API Server.

Parameters
NameDescription
request IHttpBody

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.api.IHttpBody, protos.google.api.IHttpBody | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing HttpBody. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  The HTTP Content-Type header value specifying the content type of the body.
   */
  // const contentType = 'abc123'
  /**
   *  The HTTP request/response body as raw binary.
   */
  // const data = Buffer.from('string')
  /**
   *  Application specific response metadata. Must be set in the first response
   *  for streaming APIs.
   */
  // const extensions = [1,2,3,4]

  // Imports the Gateway library
  const {GatewayServiceClient} = require('@google-cloud/gke-connect-gateway').v1beta1;

  // Instantiates a client
  const gatewayClient = new GatewayServiceClient();

  async function callPutResource() {
    // Construct request
    const request = {
    };

    // Run request
    const response = await gatewayClient.putResource(request);
    console.log(response);
  }

  callPutResource();

putResource(request, options, callback)

putResource(request: protos.google.api.IHttpBody, options: CallOptions, callback: Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IHttpBody
options CallOptions
callback Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

putResource(request, callback)

putResource(request: protos.google.api.IHttpBody, callback: Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IHttpBody
callback Callback<protos.google.api.IHttpBody, protos.google.api.IHttpBody | null | undefined, {} | null | undefined>
Returns
TypeDescription
void