Class GkeHubClient
- java.lang.Object
-
- com.google.cloud.gkehub.v1.GkeHubClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class GkeHubClient extends Object implements com.google.api.gax.core.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.v1.Membership]
- [Feature][google.cloud.gkehub.v1.Feature]
GKE Hub is currently available in the global region and all regions in https://cloud.google.com/compute/docs/regions-zones. Feature is only available in global region while membership is global region and all the regions.
**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:
- 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.
- 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.
- 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.newHttpJsonBuilder().build(); GkeHubClient gkeHubClient = GkeHubClient.create(gkeHubSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GkeHubClient.ListFeaturesFixedSizeCollection
static class
GkeHubClient.ListFeaturesPage
static class
GkeHubClient.ListFeaturesPagedResponse
static class
GkeHubClient.ListMembershipsFixedSizeCollection
static class
GkeHubClient.ListMembershipsPage
static class
GkeHubClient.ListMembershipsPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
GkeHubClient(GkeHubSettings settings)
Constructs an instance of GkeHubClient, using the given settings.protected
GkeHubClient(GkeHubStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static GkeHubClient
create()
Constructs an instance of GkeHubClient with default settings.static GkeHubClient
create(GkeHubSettings settings)
Constructs an instance of GkeHubClient, using the given settings.static GkeHubClient
create(GkeHubStub stub)
Constructs an instance of GkeHubClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<Feature,OperationMetadata>
createFeatureAsync(CreateFeatureRequest request)
Adds a new Feature.com.google.api.gax.longrunning.OperationFuture<Feature,OperationMetadata>
createFeatureAsync(LocationName parent, Feature resource, String featureId)
Adds a new Feature.com.google.api.gax.longrunning.OperationFuture<Feature,OperationMetadata>
createFeatureAsync(String parent, Feature resource, String featureId)
Adds a new Feature.com.google.api.gax.rpc.UnaryCallable<CreateFeatureRequest,com.google.longrunning.Operation>
createFeatureCallable()
Adds a new Feature.com.google.api.gax.rpc.OperationCallable<CreateFeatureRequest,Feature,OperationMetadata>
createFeatureOperationCallable()
Adds a new Feature.com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata>
createMembershipAsync(CreateMembershipRequest request)
Creates a new Membership.com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata>
createMembershipAsync(LocationName parent, Membership resource, String membershipId)
Creates a new Membership.com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata>
createMembershipAsync(String parent, Membership resource, String membershipId)
Creates a new Membership.com.google.api.gax.rpc.UnaryCallable<CreateMembershipRequest,com.google.longrunning.Operation>
createMembershipCallable()
Creates a new Membership.com.google.api.gax.rpc.OperationCallable<CreateMembershipRequest,Membership,OperationMetadata>
createMembershipOperationCallable()
Creates a new Membership.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteFeatureAsync(DeleteFeatureRequest request)
Removes a Feature.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteFeatureAsync(FeatureName name)
Removes a Feature.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteFeatureAsync(String name)
Removes a Feature.com.google.api.gax.rpc.UnaryCallable<DeleteFeatureRequest,com.google.longrunning.Operation>
deleteFeatureCallable()
Removes a Feature.com.google.api.gax.rpc.OperationCallable<DeleteFeatureRequest,com.google.protobuf.Empty,OperationMetadata>
deleteFeatureOperationCallable()
Removes a Feature.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteMembershipAsync(DeleteMembershipRequest request)
Removes a Membership.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteMembershipAsync(MembershipName name)
Removes a Membership.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata>
deleteMembershipAsync(String name)
Removes a Membership.com.google.api.gax.rpc.UnaryCallable<DeleteMembershipRequest,com.google.longrunning.Operation>
deleteMembershipCallable()
Removes a Membership.com.google.api.gax.rpc.OperationCallable<DeleteMembershipRequest,com.google.protobuf.Empty,OperationMetadata>
deleteMembershipOperationCallable()
Removes a Membership.GenerateConnectManifestResponse
generateConnectManifest(GenerateConnectManifestRequest request)
Generates the manifest for deployment of the GKE connect agent.com.google.api.gax.rpc.UnaryCallable<GenerateConnectManifestRequest,GenerateConnectManifestResponse>
generateConnectManifestCallable()
Generates the manifest for deployment of the GKE connect agent.Feature
getFeature(FeatureName name)
Gets details of a single Feature.Feature
getFeature(GetFeatureRequest request)
Gets details of a single Feature.Feature
getFeature(String name)
Gets details of a single Feature.com.google.api.gax.rpc.UnaryCallable<GetFeatureRequest,Feature>
getFeatureCallable()
Gets details of a single Feature.com.google.api.gax.httpjson.longrunning.OperationsClient
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.Membership
getMembership(GetMembershipRequest request)
Gets the details of a Membership.Membership
getMembership(MembershipName name)
Gets the details of a Membership.Membership
getMembership(String name)
Gets the details of a Membership.com.google.api.gax.rpc.UnaryCallable<GetMembershipRequest,Membership>
getMembershipCallable()
Gets the details of a Membership.com.google.longrunning.OperationsClient
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.GkeHubSettings
getSettings()
GkeHubStub
getStub()
boolean
isShutdown()
boolean
isTerminated()
GkeHubClient.ListFeaturesPagedResponse
listFeatures(ListFeaturesRequest request)
Lists Features in a given project and location.GkeHubClient.ListFeaturesPagedResponse
listFeatures(LocationName parent)
Lists Features in a given project and location.GkeHubClient.ListFeaturesPagedResponse
listFeatures(String parent)
Lists Features in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListFeaturesRequest,ListFeaturesResponse>
listFeaturesCallable()
Lists Features in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListFeaturesRequest,GkeHubClient.ListFeaturesPagedResponse>
listFeaturesPagedCallable()
Lists Features in a given project and location.GkeHubClient.ListMembershipsPagedResponse
listMemberships(ListMembershipsRequest request)
Lists Memberships in a given project and location.GkeHubClient.ListMembershipsPagedResponse
listMemberships(LocationName parent)
Lists Memberships in a given project and location.GkeHubClient.ListMembershipsPagedResponse
listMemberships(String parent)
Lists Memberships in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListMembershipsRequest,ListMembershipsResponse>
listMembershipsCallable()
Lists Memberships in a given project and location.com.google.api.gax.rpc.UnaryCallable<ListMembershipsRequest,GkeHubClient.ListMembershipsPagedResponse>
listMembershipsPagedCallable()
Lists Memberships in a given project and location.void
shutdown()
void
shutdownNow()
com.google.api.gax.longrunning.OperationFuture<Feature,OperationMetadata>
updateFeatureAsync(FeatureName name, Feature resource, com.google.protobuf.FieldMask updateMask)
Updates an existing Feature.com.google.api.gax.longrunning.OperationFuture<Feature,OperationMetadata>
updateFeatureAsync(UpdateFeatureRequest request)
Updates an existing Feature.com.google.api.gax.longrunning.OperationFuture<Feature,OperationMetadata>
updateFeatureAsync(String name, Feature resource, com.google.protobuf.FieldMask updateMask)
Updates an existing Feature.com.google.api.gax.rpc.UnaryCallable<UpdateFeatureRequest,com.google.longrunning.Operation>
updateFeatureCallable()
Updates an existing Feature.com.google.api.gax.rpc.OperationCallable<UpdateFeatureRequest,Feature,OperationMetadata>
updateFeatureOperationCallable()
Updates an existing Feature.com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata>
updateMembershipAsync(MembershipName name, Membership resource, com.google.protobuf.FieldMask updateMask)
Updates an existing Membership.com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata>
updateMembershipAsync(UpdateMembershipRequest request)
Updates an existing Membership.com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata>
updateMembershipAsync(String name, Membership resource, com.google.protobuf.FieldMask updateMask)
Updates an existing Membership.com.google.api.gax.rpc.UnaryCallable<UpdateMembershipRequest,com.google.longrunning.Operation>
updateMembershipCallable()
Updates an existing Membership.com.google.api.gax.rpc.OperationCallable<UpdateMembershipRequest,Membership,OperationMetadata>
updateMembershipOperationCallable()
Updates an existing Membership.
-
-
-
Constructor Detail
-
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 Detail
-
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 com.google.longrunning.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 com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
listMemberships
public final GkeHubClient.ListMembershipsPagedResponse listMemberships(LocationName parent)
Lists Memberships 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()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Membership element : gkeHubClient.listMemberships(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The parent (project and location) where the Memberships will be listed. Specified in the format `projects/*/locations/*`. `projects/*/locations/-` list memberships in all the regions.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listMemberships
public final GkeHubClient.ListMembershipsPagedResponse listMemberships(String parent)
Lists Memberships 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 = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Membership element : gkeHubClient.listMemberships(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The parent (project and location) where the Memberships will be listed. Specified in the format `projects/*/locations/*`. `projects/*/locations/-` list memberships in all the regions.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listMemberships
public final GkeHubClient.ListMembershipsPagedResponse listMemberships(ListMembershipsRequest request)
Lists Memberships 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()) { ListMembershipsRequest request = ListMembershipsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Membership element : gkeHubClient.listMemberships(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listMembershipsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListMembershipsRequest,GkeHubClient.ListMembershipsPagedResponse> listMembershipsPagedCallable()
Lists Memberships 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()) { ListMembershipsRequest request = ListMembershipsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Membership> future = gkeHubClient.listMembershipsPagedCallable().futureCall(request); // Do something. for (Membership element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listMembershipsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListMembershipsRequest,ListMembershipsResponse> listMembershipsCallable()
Lists Memberships 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()) { ListMembershipsRequest request = ListMembershipsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListMembershipsResponse response = gkeHubClient.listMembershipsCallable().call(request); for (Membership element : response.getResourcesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
listFeatures
public final GkeHubClient.ListFeaturesPagedResponse listFeatures(LocationName 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()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Feature element : gkeHubClient.listFeatures(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The parent (project and location) where the Features will be listed. Specified in the format `projects/*/locations/*`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
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 = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Feature element : gkeHubClient.listFeatures(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The parent (project and location) where the Features will be listed. Specified in the format `projects/*/locations/*`.- Throws:
com.google.api.gax.rpc.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(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listFeaturesPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListFeaturesRequest,GkeHubClient.ListFeaturesPagedResponse> 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(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .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 com.google.api.gax.rpc.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(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .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; } } }
-
getMembership
public final Membership getMembership(MembershipName name)
Gets the details of a Membership.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()) { MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); Membership response = gkeHubClient.getMembership(name); }
- Parameters:
name
- Required. The Membership resource name in the format `projects/*/locations/*/memberships/*`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getMembership
public final Membership getMembership(String name)
Gets the details of a Membership.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 = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString(); Membership response = gkeHubClient.getMembership(name); }
- Parameters:
name
- Required. The Membership resource name in the format `projects/*/locations/*/memberships/*`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getMembership
public final Membership getMembership(GetMembershipRequest request)
Gets the details of a Membership.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()) { GetMembershipRequest request = GetMembershipRequest.newBuilder() .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .build(); Membership response = gkeHubClient.getMembership(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getMembershipCallable
public final com.google.api.gax.rpc.UnaryCallable<GetMembershipRequest,Membership> getMembershipCallable()
Gets the details of a Membership.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()) { GetMembershipRequest request = GetMembershipRequest.newBuilder() .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .build(); ApiFuture<Membership> future = gkeHubClient.getMembershipCallable().futureCall(request); // Do something. Membership response = future.get(); }
-
getFeature
public final Feature getFeature(FeatureName 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()) { FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); Feature response = gkeHubClient.getFeature(name); }
- Parameters:
name
- Required. The Feature resource name in the format `projects/*/locations/*/features/*`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
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 = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString(); Feature response = gkeHubClient.getFeature(name); }
- Parameters:
name
- Required. The Feature resource name in the format `projects/*/locations/*/features/*`- Throws:
com.google.api.gax.rpc.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(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .build(); Feature response = gkeHubClient.getFeature(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getFeatureCallable
public final com.google.api.gax.rpc.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(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .build(); ApiFuture<Feature> future = gkeHubClient.getFeatureCallable().futureCall(request); // Do something. Feature response = future.get(); }
-
createMembershipAsync
public final com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata> createMembershipAsync(LocationName parent, Membership resource, String membershipId)
Creates a new Membership.**This is currently only supported for GKE clusters on Google Cloud**. To register other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
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()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Membership resource = Membership.newBuilder().build(); String membershipId = "membershipId517665681"; Membership response = gkeHubClient.createMembershipAsync(parent, resource, membershipId).get(); }
- Parameters:
parent
- Required. The parent (project and location) where the Memberships will be created. Specified in the format `projects/*/locations/*`.resource
- Required. The membership to create.membershipId
- Required. Client chosen ID for the membership. `membership_id` must be a valid RFC 1123 compliant DNS label:1. At most 63 characters in length 2. It must consist of lower case alphanumeric characters or `-` 3. It must start and end with an alphanumeric character
Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, with a maximum length of 63 characters.
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createMembershipAsync
public final com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata> createMembershipAsync(String parent, Membership resource, String membershipId)
Creates a new Membership.**This is currently only supported for GKE clusters on Google Cloud**. To register other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
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 = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Membership resource = Membership.newBuilder().build(); String membershipId = "membershipId517665681"; Membership response = gkeHubClient.createMembershipAsync(parent, resource, membershipId).get(); }
- Parameters:
parent
- Required. The parent (project and location) where the Memberships will be created. Specified in the format `projects/*/locations/*`.resource
- Required. The membership to create.membershipId
- Required. Client chosen ID for the membership. `membership_id` must be a valid RFC 1123 compliant DNS label:1. At most 63 characters in length 2. It must consist of lower case alphanumeric characters or `-` 3. It must start and end with an alphanumeric character
Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`, with a maximum length of 63 characters.
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createMembershipAsync
public final com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata> createMembershipAsync(CreateMembershipRequest request)
Creates a new Membership.**This is currently only supported for GKE clusters on Google Cloud**. To register other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
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()) { CreateMembershipRequest request = CreateMembershipRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setMembershipId("membershipId517665681") .setResource(Membership.newBuilder().build()) .setRequestId("requestId693933066") .build(); Membership response = gkeHubClient.createMembershipAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createMembershipOperationCallable
public final com.google.api.gax.rpc.OperationCallable<CreateMembershipRequest,Membership,OperationMetadata> createMembershipOperationCallable()
Creates a new Membership.**This is currently only supported for GKE clusters on Google Cloud**. To register other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
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()) { CreateMembershipRequest request = CreateMembershipRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setMembershipId("membershipId517665681") .setResource(Membership.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Membership, OperationMetadata> future = gkeHubClient.createMembershipOperationCallable().futureCall(request); // Do something. Membership response = future.get(); }
-
createMembershipCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateMembershipRequest,com.google.longrunning.Operation> createMembershipCallable()
Creates a new Membership.**This is currently only supported for GKE clusters on Google Cloud**. To register other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.
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()) { CreateMembershipRequest request = CreateMembershipRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setMembershipId("membershipId517665681") .setResource(Membership.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = gkeHubClient.createMembershipCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
createFeatureAsync
public final com.google.api.gax.longrunning.OperationFuture<Feature,OperationMetadata> createFeatureAsync(LocationName 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()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Feature resource = Feature.newBuilder().build(); String featureId = "featureId-420503887"; Feature response = gkeHubClient.createFeatureAsync(parent, resource, featureId).get(); }
- Parameters:
parent
- Required. 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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createFeatureAsync
public final com.google.api.gax.longrunning.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 = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Feature resource = Feature.newBuilder().build(); String featureId = "featureId-420503887"; Feature response = gkeHubClient.createFeatureAsync(parent, resource, featureId).get(); }
- Parameters:
parent
- Required. 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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createFeatureAsync
public final com.google.api.gax.longrunning.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(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createFeatureOperationCallable
public final com.google.api.gax.rpc.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(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .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 com.google.api.gax.rpc.UnaryCallable<CreateFeatureRequest,com.google.longrunning.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(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setFeatureId("featureId-420503887") .setResource(Feature.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = gkeHubClient.createFeatureCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteMembershipAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMembershipAsync(MembershipName name)
Removes a Membership.**This is currently only supported for GKE clusters on Google Cloud**. To unregister other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.
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()) { MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); gkeHubClient.deleteMembershipAsync(name).get(); }
- Parameters:
name
- Required. The Membership resource name in the format `projects/*/locations/*/memberships/*`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteMembershipAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMembershipAsync(String name)
Removes a Membership.**This is currently only supported for GKE clusters on Google Cloud**. To unregister other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.
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 = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString(); gkeHubClient.deleteMembershipAsync(name).get(); }
- Parameters:
name
- Required. The Membership resource name in the format `projects/*/locations/*/memberships/*`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteMembershipAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteMembershipAsync(DeleteMembershipRequest request)
Removes a Membership.**This is currently only supported for GKE clusters on Google Cloud**. To unregister other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.
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()) { DeleteMembershipRequest request = DeleteMembershipRequest.newBuilder() .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setRequestId("requestId693933066") .setForce(true) .build(); gkeHubClient.deleteMembershipAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteMembershipOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteMembershipRequest,com.google.protobuf.Empty,OperationMetadata> deleteMembershipOperationCallable()
Removes a Membership.**This is currently only supported for GKE clusters on Google Cloud**. To unregister other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.
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()) { DeleteMembershipRequest request = DeleteMembershipRequest.newBuilder() .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setRequestId("requestId693933066") .setForce(true) .build(); OperationFuture<Empty, OperationMetadata> future = gkeHubClient.deleteMembershipOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteMembershipCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteMembershipRequest,com.google.longrunning.Operation> deleteMembershipCallable()
Removes a Membership.**This is currently only supported for GKE clusters on Google Cloud**. To unregister other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.
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()) { DeleteMembershipRequest request = DeleteMembershipRequest.newBuilder() .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setRequestId("requestId693933066") .setForce(true) .build(); ApiFuture<Operation> future = gkeHubClient.deleteMembershipCallable().futureCall(request); // Do something. future.get(); }
-
deleteFeatureAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteFeatureAsync(FeatureName 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()) { FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); gkeHubClient.deleteFeatureAsync(name).get(); }
- Parameters:
name
- Required. The Feature resource name in the format `projects/*/locations/*/features/*`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteFeatureAsync
public final com.google.api.gax.longrunning.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 = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString(); gkeHubClient.deleteFeatureAsync(name).get(); }
- Parameters:
name
- Required. The Feature resource name in the format `projects/*/locations/*/features/*`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteFeatureAsync
public final com.google.api.gax.longrunning.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(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .setForce(true) .setRequestId("requestId693933066") .build(); gkeHubClient.deleteFeatureAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteFeatureOperationCallable
public final com.google.api.gax.rpc.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(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .setForce(true) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = gkeHubClient.deleteFeatureOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteFeatureCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteFeatureRequest,com.google.longrunning.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(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .setForce(true) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = gkeHubClient.deleteFeatureCallable().futureCall(request); // Do something. future.get(); }
-
updateMembershipAsync
public final com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata> updateMembershipAsync(MembershipName name, Membership resource, com.google.protobuf.FieldMask updateMask)
Updates an existing Membership.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()) { MembershipName name = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]"); Membership resource = Membership.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Membership response = gkeHubClient.updateMembershipAsync(name, resource, updateMask).get(); }
- Parameters:
name
- Required. The Membership resource name in the format `projects/*/locations/*/memberships/*`.resource
- Required. 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
- Required. Mask of fields to update.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateMembershipAsync
public final com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata> updateMembershipAsync(String name, Membership resource, com.google.protobuf.FieldMask updateMask)
Updates an existing Membership.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 = MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString(); Membership resource = Membership.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Membership response = gkeHubClient.updateMembershipAsync(name, resource, updateMask).get(); }
- Parameters:
name
- Required. The Membership resource name in the format `projects/*/locations/*/memberships/*`.resource
- Required. 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
- Required. Mask of fields to update.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateMembershipAsync
public final com.google.api.gax.longrunning.OperationFuture<Membership,OperationMetadata> updateMembershipAsync(UpdateMembershipRequest request)
Updates an existing Membership.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()) { UpdateMembershipRequest request = UpdateMembershipRequest.newBuilder() .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setUpdateMask(FieldMask.newBuilder().build()) .setResource(Membership.newBuilder().build()) .setRequestId("requestId693933066") .build(); Membership response = gkeHubClient.updateMembershipAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateMembershipOperationCallable
public final com.google.api.gax.rpc.OperationCallable<UpdateMembershipRequest,Membership,OperationMetadata> updateMembershipOperationCallable()
Updates an existing Membership.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()) { UpdateMembershipRequest request = UpdateMembershipRequest.newBuilder() .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setUpdateMask(FieldMask.newBuilder().build()) .setResource(Membership.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Membership, OperationMetadata> future = gkeHubClient.updateMembershipOperationCallable().futureCall(request); // Do something. Membership response = future.get(); }
-
updateMembershipCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateMembershipRequest,com.google.longrunning.Operation> updateMembershipCallable()
Updates an existing Membership.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()) { UpdateMembershipRequest request = UpdateMembershipRequest.newBuilder() .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setUpdateMask(FieldMask.newBuilder().build()) .setResource(Membership.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = gkeHubClient.updateMembershipCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
updateFeatureAsync
public final com.google.api.gax.longrunning.OperationFuture<Feature,OperationMetadata> updateFeatureAsync(FeatureName 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()) { FeatureName name = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]"); Feature resource = Feature.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Feature response = gkeHubClient.updateFeatureAsync(name, resource, updateMask).get(); }
- Parameters:
name
- Required. 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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateFeatureAsync
public final com.google.api.gax.longrunning.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 = FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString(); Feature resource = Feature.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Feature response = gkeHubClient.updateFeatureAsync(name, resource, updateMask).get(); }
- Parameters:
name
- Required. 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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateFeatureAsync
public final com.google.api.gax.longrunning.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(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .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:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateFeatureOperationCallable
public final com.google.api.gax.rpc.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(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .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 com.google.api.gax.rpc.UnaryCallable<UpdateFeatureRequest,com.google.longrunning.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(FeatureName.of("[PROJECT]", "[LOCATION]", "[FEATURE]").toString()) .setUpdateMask(FieldMask.newBuilder().build()) .setResource(Feature.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = gkeHubClient.updateFeatureCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
generateConnectManifest
public final GenerateConnectManifestResponse generateConnectManifest(GenerateConnectManifestRequest request)
Generates the manifest for deployment of the GKE connect agent.**This method is used internally by Google-provided libraries.** Most clients should not need to call this method directly.
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()) { GenerateConnectManifestRequest request = GenerateConnectManifestRequest.newBuilder() .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setNamespace("namespace1252218203") .setProxy(ByteString.EMPTY) .setVersion("version351608024") .setIsUpgrade(true) .setRegistry("registry-690212803") .setImagePullSecretContent(ByteString.EMPTY) .build(); GenerateConnectManifestResponse response = gkeHubClient.generateConnectManifest(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
generateConnectManifestCallable
public final com.google.api.gax.rpc.UnaryCallable<GenerateConnectManifestRequest,GenerateConnectManifestResponse> generateConnectManifestCallable()
Generates the manifest for deployment of the GKE connect agent.**This method is used internally by Google-provided libraries.** Most clients should not need to call this method directly.
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()) { GenerateConnectManifestRequest request = GenerateConnectManifestRequest.newBuilder() .setName(MembershipName.of("[PROJECT]", "[LOCATION]", "[MEMBERSHIP]").toString()) .setNamespace("namespace1252218203") .setProxy(ByteString.EMPTY) .setVersion("version351608024") .setIsUpgrade(true) .setRegistry("registry-690212803") .setImagePullSecretContent(ByteString.EMPTY) .build(); ApiFuture<GenerateConnectManifestResponse> future = gkeHubClient.generateConnectManifestCallable().futureCall(request); // Do something. GenerateConnectManifestResponse response = future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-