Class GkeHubClient

java.lang.Object
com.google.cloud.gkehub.v1beta.GkeHubClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@BetaApi @Generated("by gapic-generator-java") public class GkeHubClient extends Object implements BackgroundResource
Service Description: The GKE Hub service handles the registration of many Kubernetes clusters to Google Cloud, and the management of multi-cluster features over those clusters.

The GKE Hub service operates on the following resources:

  • [Membership][google.cloud.gkehub.v1beta.Membership]
  • [Feature][google.cloud.gkehub.v1beta.Feature]

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()) {
   String name = "name3373707";
   Feature response = gkeHubClient.getFeature(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().

Methods
Method Description Method Variants

ListFeatures

Lists Features in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listFeatures(ListFeaturesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listFeatures(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listFeaturesPagedCallable()

  • listFeaturesCallable()

GetFeature

Gets details of a single Feature.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getFeature(GetFeatureRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getFeature(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getFeatureCallable()

CreateFeature

Adds a new Feature.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createFeatureAsync(CreateFeatureRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createFeatureAsync(String parent, Feature resource, String featureId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createFeatureOperationCallable()

  • createFeatureCallable()

DeleteFeature

Removes a Feature.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteFeatureAsync(DeleteFeatureRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteFeatureAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteFeatureOperationCallable()

  • deleteFeatureCallable()

UpdateFeature

Updates an existing Feature.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateFeatureAsync(UpdateFeatureRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateFeatureAsync(String name, Feature resource, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateFeatureOperationCallable()

  • updateFeatureCallable()

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.newHttpJsonBuilder().build();
 GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings);
 

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

  • Constructor Details

    • GkeHubClient

      protected GkeHubClient(GkeHubSettings settings) throws IOException
      Constructs an instance of GkeHubClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
      Throws:
      IOException
    • GkeHubClient

      protected GkeHubClient(GkeHubStub stub)
  • Method Details

    • create

      public static final GkeHubClient create() throws IOException
      Constructs an instance of GkeHubClient with default settings.
      Throws:
      IOException
    • create

      public static final GkeHubClient create(GkeHubSettings settings) throws IOException
      Constructs an instance of GkeHubClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
      Throws:
      IOException
    • create

      public static final GkeHubClient create(GkeHubStub stub)
      Constructs an instance of GkeHubClient, using the given stub for making calls. This is for advanced usage - prefer using create(GkeHubSettings).
    • getSettings

      public final GkeHubSettings getSettings()
    • getStub

      public GkeHubStub getStub()
    • getOperationsClient

      public final OperationsClient getOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • getHttpJsonOperationsClient

      @BetaApi public final OperationsClient getHttpJsonOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • listFeatures

      public final GkeHubClient.ListFeaturesPagedResponse listFeatures(String parent)
      Lists Features in a given project and location.

      Sample code:

      
       // 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()) {
         String parent = "parent-995424086";
         for (Feature element : gkeHubClient.listFeatures(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - The parent (project and location) where the Features will be listed. Specified in the format `projects/*/locations/*`.
      Throws:
      ApiException - if the remote call fails
    • listFeatures

      public final GkeHubClient.ListFeaturesPagedResponse listFeatures(ListFeaturesRequest request)
      Lists Features in a given project and location.

      Sample code:

      
       // 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()) {
         ListFeaturesRequest request =
             ListFeaturesRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (Feature element : gkeHubClient.listFeatures(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listFeaturesPagedCallable

      Lists Features in a given project and location.

      Sample code:

      
       // 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()) {
         ListFeaturesRequest request =
             ListFeaturesRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<Feature> future = gkeHubClient.listFeaturesPagedCallable().futureCall(request);
         // Do something.
         for (Feature element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listFeaturesCallable

      public final UnaryCallable<ListFeaturesRequest,ListFeaturesResponse> listFeaturesCallable()
      Lists Features in a given project and location.

      Sample code:

      
       // 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()) {
         ListFeaturesRequest request =
             ListFeaturesRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListFeaturesResponse response = gkeHubClient.listFeaturesCallable().call(request);
           for (Feature element : response.getResourcesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getFeature

      public final Feature getFeature(String name)
      Gets details of a single Feature.

      Sample code:

      
       // 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()) {
         String name = "name3373707";
         Feature response = gkeHubClient.getFeature(name);
       }
       
      Parameters:
      name - The Feature resource name in the format `projects/*/locations/*/features/*`
      Throws:
      ApiException - if the remote call fails
    • getFeature

      public final Feature getFeature(GetFeatureRequest request)
      Gets details of a single Feature.

      Sample code:

      
       // 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()) {
         GetFeatureRequest request = GetFeatureRequest.newBuilder().setName("name3373707").build();
         Feature response = gkeHubClient.getFeature(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getFeatureCallable

      public final UnaryCallable<GetFeatureRequest,Feature> getFeatureCallable()
      Gets details of a single Feature.

      Sample code:

      
       // 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()) {
         GetFeatureRequest request = GetFeatureRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Feature> future = gkeHubClient.getFeatureCallable().futureCall(request);
         // Do something.
         Feature response = future.get();
       }
       
    • createFeatureAsync

      public final OperationFuture<Feature,OperationMetadata> createFeatureAsync(String parent, Feature resource, String featureId)
      Adds a new Feature.

      Sample code:

      
       // 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()) {
         String parent = "parent-995424086";
         Feature resource = Feature.newBuilder().build();
         String featureId = "featureId-420503887";
         Feature response = gkeHubClient.createFeatureAsync(parent, resource, featureId).get();
       }
       
      Parameters:
      parent - The parent (project and location) where the Feature will be created. Specified in the format `projects/*/locations/*`.
      resource - The Feature resource to create.
      featureId - The ID of the feature to create.
      Throws:
      ApiException - if the remote call fails
    • createFeatureAsync

      public final OperationFuture<Feature,OperationMetadata> createFeatureAsync(CreateFeatureRequest request)
      Adds a new Feature.

      Sample code:

      
       // 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()) {
         CreateFeatureRequest request =
             CreateFeatureRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setFeatureId("featureId-420503887")
                 .setResource(Feature.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Feature response = gkeHubClient.createFeatureAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createFeatureOperationCallable

      public final OperationCallable<CreateFeatureRequest,Feature,OperationMetadata> createFeatureOperationCallable()
      Adds a new Feature.

      Sample code:

      
       // 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()) {
         CreateFeatureRequest request =
             CreateFeatureRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setFeatureId("featureId-420503887")
                 .setResource(Feature.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Feature, OperationMetadata> future =
             gkeHubClient.createFeatureOperationCallable().futureCall(request);
         // Do something.
         Feature response = future.get();
       }
       
    • createFeatureCallable

      public final UnaryCallable<CreateFeatureRequest,Operation> createFeatureCallable()
      Adds a new Feature.

      Sample code:

      
       // 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()) {
         CreateFeatureRequest request =
             CreateFeatureRequest.newBuilder()
                 .setParent("parent-995424086")
                 .setFeatureId("featureId-420503887")
                 .setResource(Feature.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = gkeHubClient.createFeatureCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteFeatureAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteFeatureAsync(String name)
      Removes a Feature.

      Sample code:

      
       // 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()) {
         String name = "name3373707";
         gkeHubClient.deleteFeatureAsync(name).get();
       }
       
      Parameters:
      name - The Feature resource name in the format `projects/*/locations/*/features/*`.
      Throws:
      ApiException - if the remote call fails
    • deleteFeatureAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteFeatureAsync(DeleteFeatureRequest request)
      Removes a Feature.

      Sample code:

      
       // 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()) {
         DeleteFeatureRequest request =
             DeleteFeatureRequest.newBuilder()
                 .setName("name3373707")
                 .setForce(true)
                 .setRequestId("requestId693933066")
                 .build();
         gkeHubClient.deleteFeatureAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteFeatureOperationCallable

      public final OperationCallable<DeleteFeatureRequest,com.google.protobuf.Empty,OperationMetadata> deleteFeatureOperationCallable()
      Removes a Feature.

      Sample code:

      
       // 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()) {
         DeleteFeatureRequest request =
             DeleteFeatureRequest.newBuilder()
                 .setName("name3373707")
                 .setForce(true)
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             gkeHubClient.deleteFeatureOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteFeatureCallable

      public final UnaryCallable<DeleteFeatureRequest,Operation> deleteFeatureCallable()
      Removes a Feature.

      Sample code:

      
       // 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()) {
         DeleteFeatureRequest request =
             DeleteFeatureRequest.newBuilder()
                 .setName("name3373707")
                 .setForce(true)
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = gkeHubClient.deleteFeatureCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • updateFeatureAsync

      public final OperationFuture<Feature,OperationMetadata> updateFeatureAsync(String name, Feature resource, com.google.protobuf.FieldMask updateMask)
      Updates an existing Feature.

      Sample code:

      
       // 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()) {
         String name = "name3373707";
         Feature resource = Feature.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Feature response = gkeHubClient.updateFeatureAsync(name, resource, updateMask).get();
       }
       
      Parameters:
      name - The Feature resource name in the format `projects/*/locations/*/features/*`.
      resource - Only fields specified in update_mask are updated. If you specify a field in the update_mask but don't specify its value here that field will be deleted. If you are updating a map field, set the value of a key to null or empty string to delete the key from the map. It's not possible to update a key's value to the empty string. If you specify the update_mask to be a special path "*", fully replaces all user-modifiable fields to match `resource`.
      updateMask - Mask of fields to update.
      Throws:
      ApiException - if the remote call fails
    • updateFeatureAsync

      public final OperationFuture<Feature,OperationMetadata> updateFeatureAsync(UpdateFeatureRequest request)
      Updates an existing Feature.

      Sample code:

      
       // 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()) {
         UpdateFeatureRequest request =
             UpdateFeatureRequest.newBuilder()
                 .setName("name3373707")
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setResource(Feature.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Feature response = gkeHubClient.updateFeatureAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateFeatureOperationCallable

      public final OperationCallable<UpdateFeatureRequest,Feature,OperationMetadata> updateFeatureOperationCallable()
      Updates an existing Feature.

      Sample code:

      
       // 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()) {
         UpdateFeatureRequest request =
             UpdateFeatureRequest.newBuilder()
                 .setName("name3373707")
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setResource(Feature.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Feature, OperationMetadata> future =
             gkeHubClient.updateFeatureOperationCallable().futureCall(request);
         // Do something.
         Feature response = future.get();
       }
       
    • updateFeatureCallable

      public final UnaryCallable<UpdateFeatureRequest,Operation> updateFeatureCallable()
      Updates an existing Feature.

      Sample code:

      
       // 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()) {
         UpdateFeatureRequest request =
             UpdateFeatureRequest.newBuilder()
                 .setName("name3373707")
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setResource(Feature.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = gkeHubClient.updateFeatureCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException