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 |
---|
Name | Description |
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
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()
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns |
---|
Type | Description |
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 |
---|
Name | Description |
request |
IHttpBody
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
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;
Returns |
---|
Type | Description |
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;
Returns |
---|
Type | Description |
void | |
getProjectId()
getProjectId(): Promise<string>;
Returns |
---|
Type | Description |
Promise<string> | |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter |
---|
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Returns |
---|
Type | Description |
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 |
---|
Name | Description |
request |
IHttpBody
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
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;
Returns |
---|
Type | Description |
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;
Returns |
---|
Type | Description |
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 |
---|
Type | Description |
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 |
---|
Name | Description |
request |
IHttpBody
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
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;
Returns |
---|
Type | Description |
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;
Returns |
---|
Type | Description |
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 |
---|
Name | Description |
request |
IHttpBody
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
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;
Returns |
---|
Type | Description |
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;
Returns |
---|
Type | Description |
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 |
---|
Name | Description |
request |
IHttpBody
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
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;
Returns |
---|
Type | Description |
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;
Returns |
---|
Type | Description |
void | |