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
: 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
getapiEndpoint():string;
The DNS address for this API service.
apiEndpoint
staticgetapiEndpoint():string;
The DNS address for this API service - same as servicePath.
{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 libraryconst{GatewayServiceClient}=require('@google-cloud/gke-connect-gateway').v1beta1;// Instantiates a clientconstgatewayClient=newGatewayServiceClient();asyncfunctioncallDeleteResource(){// Construct requestconstrequest={};// Run requestconstresponse=awaitgatewayClient.deleteResource(request);console.log(response);}callDeleteResource();
{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 libraryconst{GatewayServiceClient}=require('@google-cloud/gke-connect-gateway').v1beta1;// Instantiates a clientconstgatewayClient=newGatewayServiceClient();asyncfunctioncallGetResource(){// Construct requestconstrequest={};// Run requestconstresponse=awaitgatewayClient.getResource(request);console.log(response);}callGetResource();
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
Type
Description
Promise<{
[name: string]: Function;
}>
{Promise} A promise that resolves to an authenticated service stub.
{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 libraryconst{GatewayServiceClient}=require('@google-cloud/gke-connect-gateway').v1beta1;// Instantiates a clientconstgatewayClient=newGatewayServiceClient();asyncfunctioncallPatchResource(){// Construct requestconstrequest={};// Run requestconstresponse=awaitgatewayClient.patchResource(request);console.log(response);}callPatchResource();
{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 libraryconst{GatewayServiceClient}=require('@google-cloud/gke-connect-gateway').v1beta1;// Instantiates a clientconstgatewayClient=newGatewayServiceClient();asyncfunctioncallPostResource(){// Construct requestconstrequest={};// Run requestconstresponse=awaitgatewayClient.postResource(request);console.log(response);}callPostResource();
{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 libraryconst{GatewayServiceClient}=require('@google-cloud/gke-connect-gateway').v1beta1;// Instantiates a clientconstgatewayClient=newGatewayServiceClient();asyncfunctioncallPutResource(){// Construct requestconstrequest={};// Run requestconstresponse=awaitgatewayClient.putResource(request);console.log(response);}callPutResource();
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-04 UTC."],[],[]]