Package com.google.cloud.gkehub.v1alpha2 (1.4.0)

A client to GKE Hub API

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

GkeHubClient

Service Description: The GKE Hub service handles the registration of many Kubernetes clusters to Google Cloud, represented with the Membership resource.

GKE Hub is currently only available in the global region.

**Membership management may be non-trivial:** it is recommended to use one of the Google-provided client libraries or tools where possible when working with Membership resources.

Sample for GkeHubClient:


 // 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.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
   MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]");
   Membership response = gkeHubClient.getMembership(name);
 }
 

Classes

Authority

Authority encodes how Google will recognize identities from this Membership. See the workload identity documentation for more details: https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity

Protobuf type google.cloud.gkehub.v1alpha2.Authority

Authority.Builder

Authority encodes how Google will recognize identities from this Membership. See the workload identity documentation for more details: https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity

Protobuf type google.cloud.gkehub.v1alpha2.Authority

ConnectAgentResource

ConnectAgentResource represents a Kubernetes resource manifest for Connect Agent deployment.

Protobuf type google.cloud.gkehub.v1alpha2.ConnectAgentResource

ConnectAgentResource.Builder

ConnectAgentResource represents a Kubernetes resource manifest for Connect Agent deployment.

Protobuf type google.cloud.gkehub.v1alpha2.ConnectAgentResource

CreateMembershipRequest

Request message for the GkeHub.CreateMembership method.

Protobuf type google.cloud.gkehub.v1alpha2.CreateMembershipRequest

CreateMembershipRequest.Builder

Request message for the GkeHub.CreateMembership method.

Protobuf type google.cloud.gkehub.v1alpha2.CreateMembershipRequest

DeleteMembershipRequest

Request message for GkeHub.DeleteMembership method.

Protobuf type google.cloud.gkehub.v1alpha2.DeleteMembershipRequest

DeleteMembershipRequest.Builder

Request message for GkeHub.DeleteMembership method.

Protobuf type google.cloud.gkehub.v1alpha2.DeleteMembershipRequest

GenerateConnectManifestRequest

Request message for GkeHub.GenerateConnectManifest method. .

Protobuf type google.cloud.gkehub.v1alpha2.GenerateConnectManifestRequest

GenerateConnectManifestRequest.Builder

Request message for GkeHub.GenerateConnectManifest method. .

Protobuf type google.cloud.gkehub.v1alpha2.GenerateConnectManifestRequest

GenerateConnectManifestResponse

GenerateConnectManifestResponse contains manifest information for installing/upgrading a Connect agent.

Protobuf type google.cloud.gkehub.v1alpha2.GenerateConnectManifestResponse

GenerateConnectManifestResponse.Builder

GenerateConnectManifestResponse contains manifest information for installing/upgrading a Connect agent.

Protobuf type google.cloud.gkehub.v1alpha2.GenerateConnectManifestResponse

GetMembershipRequest

Request message for GkeHub.GetMembership method.

Protobuf type google.cloud.gkehub.v1alpha2.GetMembershipRequest

GetMembershipRequest.Builder

Request message for GkeHub.GetMembership method.

Protobuf type google.cloud.gkehub.v1alpha2.GetMembershipRequest

GkeCluster

GkeCluster contains information specific to GKE clusters.

Protobuf type google.cloud.gkehub.v1alpha2.GkeCluster

GkeCluster.Builder

GkeCluster contains information specific to GKE clusters.

Protobuf type google.cloud.gkehub.v1alpha2.GkeCluster

GkeHubClient

Service Description: The GKE Hub service handles the registration of many Kubernetes clusters to Google Cloud, represented with the Membership resource.

GKE Hub is currently only available in the global region.

**Membership management may be non-trivial:** it is recommended to use one of the Google-provided client libraries or tools where possible when working with Membership resources.

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:


 // 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.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (GkeHubClient gkeHubClient = GkeHubClient.create()) {
   MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]");
   Membership response = gkeHubClient.getMembership(name);
 }
 

Note: close() needs to be called on the GkeHubClient 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 GkeHubSettings to create(). For example:

To customize credentials:


 // 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.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 GkeHubSettings gkeHubSettings =
     GkeHubSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings);
 

To customize the endpoint:


 // 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.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 GkeHubSettings gkeHubSettings = GkeHubSettings.newBuilder().setEndpoint(myEndpoint).build();
 GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // 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.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 GkeHubSettings gkeHubSettings =
     GkeHubSettings.newBuilder()
         .setTransportChannelProvider(
             GkeHubSettings.defaultHttpJsonTransportProviderBuilder().build())
         .build();
 GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings);
 

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

GkeHubClient.ListMembershipsFixedSizeCollection

GkeHubClient.ListMembershipsPage

GkeHubClient.ListMembershipsPagedResponse

GkeHubGrpc

The GKE Hub service handles the registration of many Kubernetes clusters to Google Cloud, represented with the Membership resource. GKE Hub is currently only available in the global region. Membership management may be non-trivial: it is recommended to use one of the Google-provided client libraries or tools where possible when working with Membership resources.

GkeHubGrpc.GkeHubBlockingStub

The GKE Hub service handles the registration of many Kubernetes clusters to Google Cloud, represented with the Membership resource. GKE Hub is currently only available in the global region. Membership management may be non-trivial: it is recommended to use one of the Google-provided client libraries or tools where possible when working with Membership resources.

GkeHubGrpc.GkeHubFutureStub

The GKE Hub service handles the registration of many Kubernetes clusters to Google Cloud, represented with the Membership resource. GKE Hub is currently only available in the global region. Membership management may be non-trivial: it is recommended to use one of the Google-provided client libraries or tools where possible when working with Membership resources.

GkeHubGrpc.GkeHubImplBase

The GKE Hub service handles the registration of many Kubernetes clusters to Google Cloud, represented with the Membership resource. GKE Hub is currently only available in the global region. Membership management may be non-trivial: it is recommended to use one of the Google-provided client libraries or tools where possible when working with Membership resources.

GkeHubGrpc.GkeHubStub

The GKE Hub service handles the registration of many Kubernetes clusters to Google Cloud, represented with the Membership resource. GKE Hub is currently only available in the global region. Membership management may be non-trivial: it is recommended to use one of the Google-provided client libraries or tools where possible when working with Membership resources.

GkeHubSettings

Settings class to configure an instance of GkeHubClient.

The default instance has everything set to sensible defaults:

  • The default service address (gkehub.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 getMembership to 30 seconds:


 // 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.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 GkeHubSettings.Builder gkeHubSettingsBuilder = GkeHubSettings.newBuilder();
 gkeHubSettingsBuilder
     .getMembershipSettings()
     .setRetrySettings(
         gkeHubSettingsBuilder.getMembershipSettings().getRetrySettings().toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 GkeHubSettings gkeHubSettings = gkeHubSettingsBuilder.build();
 

GkeHubSettings.Builder

Builder for GkeHubSettings.

InitializeHubRequest

Request message for the InitializeHub method.

Protobuf type google.cloud.gkehub.v1alpha2.InitializeHubRequest

InitializeHubRequest.Builder

Request message for the InitializeHub method.

Protobuf type google.cloud.gkehub.v1alpha2.InitializeHubRequest

InitializeHubResponse

Response message for the InitializeHub method.

Protobuf type google.cloud.gkehub.v1alpha2.InitializeHubResponse

InitializeHubResponse.Builder

Response message for the InitializeHub method.

Protobuf type google.cloud.gkehub.v1alpha2.InitializeHubResponse

KubernetesMetadata

KubernetesMetadata provides informational metadata for Memberships that are created from Kubernetes Endpoints (currently, these are equivalent to Kubernetes clusters).

Protobuf type google.cloud.gkehub.v1alpha2.KubernetesMetadata

KubernetesMetadata.Builder

KubernetesMetadata provides informational metadata for Memberships that are created from Kubernetes Endpoints (currently, these are equivalent to Kubernetes clusters).

Protobuf type google.cloud.gkehub.v1alpha2.KubernetesMetadata

KubernetesResource

KubernetesResource contains the YAML manifests and configuration for Membership Kubernetes resources in the cluster. After CreateMembership or UpdateMembership, these resources should be re-applied in the cluster.

Protobuf type google.cloud.gkehub.v1alpha2.KubernetesResource

KubernetesResource.Builder

KubernetesResource contains the YAML manifests and configuration for Membership Kubernetes resources in the cluster. After CreateMembership or UpdateMembership, these resources should be re-applied in the cluster.

Protobuf type google.cloud.gkehub.v1alpha2.KubernetesResource

ListMembershipsRequest

Request message for GkeHub.ListMemberships method.

Protobuf type google.cloud.gkehub.v1alpha2.ListMembershipsRequest

ListMembershipsRequest.Builder

Request message for GkeHub.ListMemberships method.

Protobuf type google.cloud.gkehub.v1alpha2.ListMembershipsRequest

ListMembershipsResponse

Response message for the GkeHub.ListMemberships method.

Protobuf type google.cloud.gkehub.v1alpha2.ListMembershipsResponse

ListMembershipsResponse.Builder

Response message for the GkeHub.ListMemberships method.

Protobuf type google.cloud.gkehub.v1alpha2.ListMembershipsResponse

LocationName

LocationName.Builder

Builder for projects/{project}/locations/{location}.

Membership

Membership contains information about a member cluster.

Protobuf type google.cloud.gkehub.v1alpha2.Membership

Membership.Builder

Membership contains information about a member cluster.

Protobuf type google.cloud.gkehub.v1alpha2.Membership

MembershipEndpoint

MembershipEndpoint contains information needed to contact a Kubernetes API, endpoint and any additional Kubernetes metadata.

Protobuf type google.cloud.gkehub.v1alpha2.MembershipEndpoint

MembershipEndpoint.Builder

MembershipEndpoint contains information needed to contact a Kubernetes API, endpoint and any additional Kubernetes metadata.

Protobuf type google.cloud.gkehub.v1alpha2.MembershipEndpoint

MembershipName

MembershipName.Builder

Builder for projects/{project}/locations/{location}/memberships/{membership}.

MembershipProto

MembershipState

MembershipState describes the state of a Membership resource.

Protobuf type google.cloud.gkehub.v1alpha2.MembershipState

MembershipState.Builder

MembershipState describes the state of a Membership resource.

Protobuf type google.cloud.gkehub.v1alpha2.MembershipState

MultiCloudCluster

MultiCloudCluster contains information specific to GKE Multi-Cloud clusters.

Protobuf type google.cloud.gkehub.v1alpha2.MultiCloudCluster

MultiCloudCluster.Builder

MultiCloudCluster contains information specific to GKE Multi-Cloud clusters.

Protobuf type google.cloud.gkehub.v1alpha2.MultiCloudCluster

OnPremCluster

OnPremCluster contains information specific to GKE On-Prem clusters.

Protobuf type google.cloud.gkehub.v1alpha2.OnPremCluster

OnPremCluster.Builder

OnPremCluster contains information specific to GKE On-Prem clusters.

Protobuf type google.cloud.gkehub.v1alpha2.OnPremCluster

OperationMetadata

Represents the metadata of the long-running operation.

Protobuf type google.cloud.gkehub.v1alpha2.OperationMetadata

OperationMetadata.Builder

Represents the metadata of the long-running operation.

Protobuf type google.cloud.gkehub.v1alpha2.OperationMetadata

ResourceManifest

ResourceManifest represents a single Kubernetes resource to be applied to the cluster.

Protobuf type google.cloud.gkehub.v1alpha2.ResourceManifest

ResourceManifest.Builder

ResourceManifest represents a single Kubernetes resource to be applied to the cluster.

Protobuf type google.cloud.gkehub.v1alpha2.ResourceManifest

ResourceOptions

ResourceOptions represent options for Kubernetes resource generation.

Protobuf type google.cloud.gkehub.v1alpha2.ResourceOptions

ResourceOptions.Builder

ResourceOptions represent options for Kubernetes resource generation.

Protobuf type google.cloud.gkehub.v1alpha2.ResourceOptions

TypeMeta

TypeMeta is the type information needed for content unmarshalling of Kubernetes resources in the manifest.

Protobuf type google.cloud.gkehub.v1alpha2.TypeMeta

TypeMeta.Builder

TypeMeta is the type information needed for content unmarshalling of Kubernetes resources in the manifest.

Protobuf type google.cloud.gkehub.v1alpha2.TypeMeta

UpdateMembershipRequest

Request message for GkeHub.UpdateMembership method.

Protobuf type google.cloud.gkehub.v1alpha2.UpdateMembershipRequest

UpdateMembershipRequest.Builder

Request message for GkeHub.UpdateMembership method.

Protobuf type google.cloud.gkehub.v1alpha2.UpdateMembershipRequest

Interfaces

AuthorityOrBuilder

ConnectAgentResourceOrBuilder

CreateMembershipRequestOrBuilder

DeleteMembershipRequestOrBuilder

GenerateConnectManifestRequestOrBuilder

GenerateConnectManifestResponseOrBuilder

GetMembershipRequestOrBuilder

GkeClusterOrBuilder

InitializeHubRequestOrBuilder

InitializeHubResponseOrBuilder

KubernetesMetadataOrBuilder

KubernetesResourceOrBuilder

ListMembershipsRequestOrBuilder

ListMembershipsResponseOrBuilder

MembershipEndpointOrBuilder

MembershipOrBuilder

MembershipStateOrBuilder

MultiCloudClusterOrBuilder

OnPremClusterOrBuilder

OperationMetadataOrBuilder

ResourceManifestOrBuilder

ResourceOptionsOrBuilder

TypeMetaOrBuilder

UpdateMembershipRequestOrBuilder

Enums

Membership.InfrastructureType

Specifies the infrastructure type of a Membership. Infrastructure type is used by Hub to control infrastructure-specific behavior, including pricing. Each GKE distribution (on-GCP, on-Prem, on-X,...) will set this field automatically, but Attached Clusters customers should specify a type during registration.

Protobuf enum google.cloud.gkehub.v1alpha2.Membership.InfrastructureType

Membership.TypeCase

MembershipEndpoint.TypeCase

MembershipState.Code

Code describes the state of a Membership resource.

Protobuf enum google.cloud.gkehub.v1alpha2.MembershipState.Code