Package com.google.cloud.gkeconnect.gateway.v1beta1

The interfaces provided are listed below, along with usage samples.

GatewayServiceClient

Service Description: 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.

Sample for GatewayServiceClient:


 try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
   HttpBody request =
       HttpBody.newBuilder()
           .setContentType("contentType-389131437")
           .setData(ByteString.EMPTY)
           .addAllExtensions(new ArrayList<Any>())
           .build();
   HttpBody response = gatewayServiceClient.getResource(request);
 }
 

Classes

GatewayProto

GatewayServiceClient

Service Description: 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.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 try (GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create()) {
   HttpBody request =
       HttpBody.newBuilder()
           .setContentType("contentType-389131437")
           .setData(ByteString.EMPTY)
           .addAllExtensions(new ArrayList<Any>())
           .build();
   HttpBody response = gatewayServiceClient.getResource(request);
 }
 

Note: close() needs to be called on the GatewayServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of GatewayServiceSettings to create(). For example:

To customize credentials:


 GatewayServiceSettings gatewayServiceSettings =
     GatewayServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create(gatewayServiceSettings);
 

To customize the endpoint:


 GatewayServiceSettings gatewayServiceSettings =
     GatewayServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 GatewayServiceClient gatewayServiceClient = GatewayServiceClient.create(gatewayServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

GatewayServiceGrpc

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.

GatewayServiceGrpc.GatewayServiceBlockingStub

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.

GatewayServiceGrpc.GatewayServiceFutureStub

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.

GatewayServiceGrpc.GatewayServiceImplBase

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.

GatewayServiceGrpc.GatewayServiceStub

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.

GatewayServiceSettings

Settings class to configure an instance of GatewayServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (connectgateway.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of getResource to 30 seconds:


 GatewayServiceSettings.Builder gatewayServiceSettingsBuilder =
     GatewayServiceSettings.newBuilder();
 gatewayServiceSettingsBuilder
     .getResourceSettings()
     .setRetrySettings(
         gatewayServiceSettingsBuilder
             .getResourceSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 GatewayServiceSettings gatewayServiceSettings = gatewayServiceSettingsBuilder.build();
 

GatewayServiceSettings.Builder

Builder for GatewayServiceSettings.