@Generated(value="by gapic-generator-java") public class EdgeContainerClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
Cluster response = edgeContainerClient.getCluster(name);
}
Note: close() needs to be called on the EdgeContainerClient 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:
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 EdgeContainerSettings 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
EdgeContainerSettings edgeContainerSettings =
EdgeContainerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
EdgeContainerClient edgeContainerClient = EdgeContainerClient.create(edgeContainerSettings);
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
EdgeContainerSettings edgeContainerSettings =
EdgeContainerSettings.newBuilder().setEndpoint(myEndpoint).build();
EdgeContainerClient edgeContainerClient = EdgeContainerClient.create(edgeContainerSettings);
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
EdgeContainerSettings edgeContainerSettings =
EdgeContainerSettings.newHttpJsonBuilder().build();
EdgeContainerClient edgeContainerClient = EdgeContainerClient.create(edgeContainerSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
EdgeContainerClient.ListClustersFixedSizeCollection |
static class |
EdgeContainerClient.ListClustersPage |
static class |
EdgeContainerClient.ListClustersPagedResponse |
static class |
EdgeContainerClient.ListMachinesFixedSizeCollection |
static class |
EdgeContainerClient.ListMachinesPage |
static class |
EdgeContainerClient.ListMachinesPagedResponse |
static class |
EdgeContainerClient.ListNodePoolsFixedSizeCollection |
static class |
EdgeContainerClient.ListNodePoolsPage |
static class |
EdgeContainerClient.ListNodePoolsPagedResponse |
static class |
EdgeContainerClient.ListVpnConnectionsFixedSizeCollection |
static class |
EdgeContainerClient.ListVpnConnectionsPage |
static class |
EdgeContainerClient.ListVpnConnectionsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
EdgeContainerClient(EdgeContainerSettings settings)
Constructs an instance of EdgeContainerClient, using the given settings.
|
protected |
EdgeContainerClient(EdgeContainerStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static EdgeContainerClient |
create()
Constructs an instance of EdgeContainerClient with default settings.
|
static EdgeContainerClient |
create(EdgeContainerSettings settings)
Constructs an instance of EdgeContainerClient, using the given settings.
|
static EdgeContainerClient |
create(EdgeContainerStub stub)
Constructs an instance of EdgeContainerClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
createClusterAsync(CreateClusterRequest request)
Creates a new Cluster in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
createClusterAsync(LocationName parent,
Cluster cluster,
String clusterId)
Creates a new Cluster in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
createClusterAsync(String parent,
Cluster cluster,
String clusterId)
Creates a new Cluster in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateClusterRequest,com.google.longrunning.Operation> |
createClusterCallable()
Creates a new Cluster in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateClusterRequest,Cluster,OperationMetadata> |
createClusterOperationCallable()
Creates a new Cluster in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<NodePool,OperationMetadata> |
createNodePoolAsync(ClusterName parent,
NodePool nodePool,
String nodePoolId)
Creates a new NodePool in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<NodePool,OperationMetadata> |
createNodePoolAsync(CreateNodePoolRequest request)
Creates a new NodePool in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<NodePool,OperationMetadata> |
createNodePoolAsync(String parent,
NodePool nodePool,
String nodePoolId)
Creates a new NodePool in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateNodePoolRequest,com.google.longrunning.Operation> |
createNodePoolCallable()
Creates a new NodePool in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateNodePoolRequest,NodePool,OperationMetadata> |
createNodePoolOperationCallable()
Creates a new NodePool in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<VpnConnection,OperationMetadata> |
createVpnConnectionAsync(CreateVpnConnectionRequest request)
Creates a new VPN connection in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<VpnConnection,OperationMetadata> |
createVpnConnectionAsync(LocationName parent,
VpnConnection vpnConnection,
String vpnConnectionId)
Creates a new VPN connection in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<VpnConnection,OperationMetadata> |
createVpnConnectionAsync(String parent,
VpnConnection vpnConnection,
String vpnConnectionId)
Creates a new VPN connection in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateVpnConnectionRequest,com.google.longrunning.Operation> |
createVpnConnectionCallable()
Creates a new VPN connection in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateVpnConnectionRequest,VpnConnection,OperationMetadata> |
createVpnConnectionOperationCallable()
Creates a new VPN connection in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteClusterAsync(ClusterName name)
Deletes a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteClusterAsync(DeleteClusterRequest request)
Deletes a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteClusterAsync(String name)
Deletes a single Cluster.
|
com.google.api.gax.rpc.UnaryCallable<DeleteClusterRequest,com.google.longrunning.Operation> |
deleteClusterCallable()
Deletes a single Cluster.
|
com.google.api.gax.rpc.OperationCallable<DeleteClusterRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteClusterOperationCallable()
Deletes a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteNodePoolAsync(DeleteNodePoolRequest request)
Deletes a single NodePool.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteNodePoolAsync(NodePoolName name)
Deletes a single NodePool.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteNodePoolAsync(String name)
Deletes a single NodePool.
|
com.google.api.gax.rpc.UnaryCallable<DeleteNodePoolRequest,com.google.longrunning.Operation> |
deleteNodePoolCallable()
Deletes a single NodePool.
|
com.google.api.gax.rpc.OperationCallable<DeleteNodePoolRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteNodePoolOperationCallable()
Deletes a single NodePool.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteVpnConnectionAsync(DeleteVpnConnectionRequest request)
Deletes a single VPN connection.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteVpnConnectionAsync(String name)
Deletes a single VPN connection.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> |
deleteVpnConnectionAsync(VpnConnectionName name)
Deletes a single VPN connection.
|
com.google.api.gax.rpc.UnaryCallable<DeleteVpnConnectionRequest,com.google.longrunning.Operation> |
deleteVpnConnectionCallable()
Deletes a single VPN connection.
|
com.google.api.gax.rpc.OperationCallable<DeleteVpnConnectionRequest,com.google.protobuf.Empty,OperationMetadata> |
deleteVpnConnectionOperationCallable()
Deletes a single VPN connection.
|
GenerateAccessTokenResponse |
generateAccessToken(ClusterName cluster)
Generates an access token for a Cluster.
|
GenerateAccessTokenResponse |
generateAccessToken(GenerateAccessTokenRequest request)
Generates an access token for a Cluster.
|
GenerateAccessTokenResponse |
generateAccessToken(String cluster)
Generates an access token for a Cluster.
|
com.google.api.gax.rpc.UnaryCallable<GenerateAccessTokenRequest,GenerateAccessTokenResponse> |
generateAccessTokenCallable()
Generates an access token for a Cluster.
|
Cluster |
getCluster(ClusterName name)
Gets details of a single Cluster.
|
Cluster |
getCluster(GetClusterRequest request)
Gets details of a single Cluster.
|
Cluster |
getCluster(String name)
Gets details of a single Cluster.
|
com.google.api.gax.rpc.UnaryCallable<GetClusterRequest,Cluster> |
getClusterCallable()
Gets details of a single Cluster.
|
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.
|
Machine |
getMachine(GetMachineRequest request)
Gets details of a single Machine.
|
Machine |
getMachine(MachineName name)
Gets details of a single Machine.
|
Machine |
getMachine(String name)
Gets details of a single Machine.
|
com.google.api.gax.rpc.UnaryCallable<GetMachineRequest,Machine> |
getMachineCallable()
Gets details of a single Machine.
|
NodePool |
getNodePool(GetNodePoolRequest request)
Gets details of a single NodePool.
|
NodePool |
getNodePool(NodePoolName name)
Gets details of a single NodePool.
|
NodePool |
getNodePool(String name)
Gets details of a single NodePool.
|
com.google.api.gax.rpc.UnaryCallable<GetNodePoolRequest,NodePool> |
getNodePoolCallable()
Gets details of a single NodePool.
|
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.
|
EdgeContainerSettings |
getSettings() |
EdgeContainerStub |
getStub() |
VpnConnection |
getVpnConnection(GetVpnConnectionRequest request)
Gets details of a single VPN connection.
|
VpnConnection |
getVpnConnection(String name)
Gets details of a single VPN connection.
|
VpnConnection |
getVpnConnection(VpnConnectionName name)
Gets details of a single VPN connection.
|
com.google.api.gax.rpc.UnaryCallable<GetVpnConnectionRequest,VpnConnection> |
getVpnConnectionCallable()
Gets details of a single VPN connection.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
EdgeContainerClient.ListClustersPagedResponse |
listClusters(ListClustersRequest request)
Lists Clusters in a given project and location.
|
EdgeContainerClient.ListClustersPagedResponse |
listClusters(LocationName parent)
Lists Clusters in a given project and location.
|
EdgeContainerClient.ListClustersPagedResponse |
listClusters(String parent)
Lists Clusters in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListClustersRequest,ListClustersResponse> |
listClustersCallable()
Lists Clusters in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListClustersRequest,EdgeContainerClient.ListClustersPagedResponse> |
listClustersPagedCallable()
Lists Clusters in a given project and location.
|
EdgeContainerClient.ListMachinesPagedResponse |
listMachines(ListMachinesRequest request)
Lists Machines in a given project and location.
|
EdgeContainerClient.ListMachinesPagedResponse |
listMachines(LocationName parent)
Lists Machines in a given project and location.
|
EdgeContainerClient.ListMachinesPagedResponse |
listMachines(String parent)
Lists Machines in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListMachinesRequest,ListMachinesResponse> |
listMachinesCallable()
Lists Machines in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListMachinesRequest,EdgeContainerClient.ListMachinesPagedResponse> |
listMachinesPagedCallable()
Lists Machines in a given project and location.
|
EdgeContainerClient.ListNodePoolsPagedResponse |
listNodePools(ClusterName parent)
Lists NodePools in a given project and location.
|
EdgeContainerClient.ListNodePoolsPagedResponse |
listNodePools(ListNodePoolsRequest request)
Lists NodePools in a given project and location.
|
EdgeContainerClient.ListNodePoolsPagedResponse |
listNodePools(String parent)
Lists NodePools in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListNodePoolsRequest,ListNodePoolsResponse> |
listNodePoolsCallable()
Lists NodePools in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListNodePoolsRequest,EdgeContainerClient.ListNodePoolsPagedResponse> |
listNodePoolsPagedCallable()
Lists NodePools in a given project and location.
|
EdgeContainerClient.ListVpnConnectionsPagedResponse |
listVpnConnections(ListVpnConnectionsRequest request)
Lists VPN connections in a given project and location.
|
EdgeContainerClient.ListVpnConnectionsPagedResponse |
listVpnConnections(LocationName parent)
Lists VPN connections in a given project and location.
|
EdgeContainerClient.ListVpnConnectionsPagedResponse |
listVpnConnections(String parent)
Lists VPN connections in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListVpnConnectionsRequest,ListVpnConnectionsResponse> |
listVpnConnectionsCallable()
Lists VPN connections in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListVpnConnectionsRequest,EdgeContainerClient.ListVpnConnectionsPagedResponse> |
listVpnConnectionsPagedCallable()
Lists VPN connections in a given project and location.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
updateClusterAsync(Cluster cluster,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> |
updateClusterAsync(UpdateClusterRequest request)
Updates the parameters of a single Cluster.
|
com.google.api.gax.rpc.UnaryCallable<UpdateClusterRequest,com.google.longrunning.Operation> |
updateClusterCallable()
Updates the parameters of a single Cluster.
|
com.google.api.gax.rpc.OperationCallable<UpdateClusterRequest,Cluster,OperationMetadata> |
updateClusterOperationCallable()
Updates the parameters of a single Cluster.
|
com.google.api.gax.longrunning.OperationFuture<NodePool,OperationMetadata> |
updateNodePoolAsync(NodePool nodePool,
com.google.protobuf.FieldMask updateMask)
Updates the parameters of a single NodePool.
|
com.google.api.gax.longrunning.OperationFuture<NodePool,OperationMetadata> |
updateNodePoolAsync(UpdateNodePoolRequest request)
Updates the parameters of a single NodePool.
|
com.google.api.gax.rpc.UnaryCallable<UpdateNodePoolRequest,com.google.longrunning.Operation> |
updateNodePoolCallable()
Updates the parameters of a single NodePool.
|
com.google.api.gax.rpc.OperationCallable<UpdateNodePoolRequest,NodePool,OperationMetadata> |
updateNodePoolOperationCallable()
Updates the parameters of a single NodePool.
|
protected EdgeContainerClient(EdgeContainerSettings settings) throws IOException
IOExceptionprotected EdgeContainerClient(EdgeContainerStub stub)
public static final EdgeContainerClient create() throws IOException
IOExceptionpublic static final EdgeContainerClient create(EdgeContainerSettings settings) throws IOException
IOExceptionpublic static final EdgeContainerClient create(EdgeContainerStub stub)
public final EdgeContainerSettings getSettings()
public EdgeContainerStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final EdgeContainerClient.ListClustersPagedResponse listClusters(LocationName parent)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Cluster element : edgeContainerClient.listClusters(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent location, which owns this collection of clusters.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EdgeContainerClient.ListClustersPagedResponse listClusters(String parent)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Cluster element : edgeContainerClient.listClusters(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent location, which owns this collection of clusters.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EdgeContainerClient.ListClustersPagedResponse listClusters(ListClustersRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListClustersRequest request =
ListClustersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Cluster element : edgeContainerClient.listClusters(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListClustersRequest,EdgeContainerClient.ListClustersPagedResponse> listClustersPagedCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListClustersRequest request =
ListClustersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Cluster> future =
edgeContainerClient.listClustersPagedCallable().futureCall(request);
// Do something.
for (Cluster element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListClustersRequest,ListClustersResponse> listClustersCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListClustersRequest request =
ListClustersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListClustersResponse response = edgeContainerClient.listClustersCallable().call(request);
for (Cluster element : response.getClustersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Cluster getCluster(ClusterName name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
Cluster response = edgeContainerClient.getCluster(name);
}
name - Required. The resource name of the cluster.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Cluster getCluster(String name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
Cluster response = edgeContainerClient.getCluster(name);
}
name - Required. The resource name of the cluster.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Cluster getCluster(GetClusterRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
GetClusterRequest request =
GetClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.build();
Cluster response = edgeContainerClient.getCluster(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetClusterRequest,Cluster> getClusterCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
GetClusterRequest request =
GetClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.build();
ApiFuture<Cluster> future = edgeContainerClient.getClusterCallable().futureCall(request);
// Do something.
Cluster response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> createClusterAsync(LocationName parent, Cluster cluster, String clusterId)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Cluster cluster = Cluster.newBuilder().build();
String clusterId = "clusterId561939637";
Cluster response = edgeContainerClient.createClusterAsync(parent, cluster, clusterId).get();
}
parent - Required. The parent location where this cluster will be created.cluster - Required. The cluster to create.clusterId - Required. A client-specified unique identifier for the cluster.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> createClusterAsync(String parent, Cluster cluster, String clusterId)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Cluster cluster = Cluster.newBuilder().build();
String clusterId = "clusterId561939637";
Cluster response = edgeContainerClient.createClusterAsync(parent, cluster, clusterId).get();
}
parent - Required. The parent location where this cluster will be created.cluster - Required. The cluster to create.clusterId - Required. A client-specified unique identifier for the cluster.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> createClusterAsync(CreateClusterRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
CreateClusterRequest request =
CreateClusterRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setClusterId("clusterId561939637")
.setCluster(Cluster.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Cluster response = edgeContainerClient.createClusterAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateClusterRequest,Cluster,OperationMetadata> createClusterOperationCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
CreateClusterRequest request =
CreateClusterRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setClusterId("clusterId561939637")
.setCluster(Cluster.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Cluster, OperationMetadata> future =
edgeContainerClient.createClusterOperationCallable().futureCall(request);
// Do something.
Cluster response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateClusterRequest,com.google.longrunning.Operation> createClusterCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
CreateClusterRequest request =
CreateClusterRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setClusterId("clusterId561939637")
.setCluster(Cluster.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = edgeContainerClient.createClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> updateClusterAsync(Cluster cluster, com.google.protobuf.FieldMask updateMask)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
Cluster cluster = Cluster.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Cluster response = edgeContainerClient.updateClusterAsync(cluster, updateMask).get();
}
cluster - The updated cluster.updateMask - Field mask is used to specify the fields to be overwritten in the Cluster
resource by the update. The fields specified in the update_mask are relative to the
resource, not the full request. A field will be overwritten if it is in the mask. If the
user does not provide a mask then all fields will be overwritten.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Cluster,OperationMetadata> updateClusterAsync(UpdateClusterRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
UpdateClusterRequest request =
UpdateClusterRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setCluster(Cluster.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Cluster response = edgeContainerClient.updateClusterAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateClusterRequest,Cluster,OperationMetadata> updateClusterOperationCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
UpdateClusterRequest request =
UpdateClusterRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setCluster(Cluster.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Cluster, OperationMetadata> future =
edgeContainerClient.updateClusterOperationCallable().futureCall(request);
// Do something.
Cluster response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateClusterRequest,com.google.longrunning.Operation> updateClusterCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
UpdateClusterRequest request =
UpdateClusterRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setCluster(Cluster.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = edgeContainerClient.updateClusterCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(ClusterName name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
edgeContainerClient.deleteClusterAsync(name).get();
}
name - Required. The resource name of the cluster.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(String name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
edgeContainerClient.deleteClusterAsync(name).get();
}
name - Required. The resource name of the cluster.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(DeleteClusterRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
DeleteClusterRequest request =
DeleteClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setRequestId("requestId693933066")
.build();
edgeContainerClient.deleteClusterAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteClusterRequest,com.google.protobuf.Empty,OperationMetadata> deleteClusterOperationCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
DeleteClusterRequest request =
DeleteClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
edgeContainerClient.deleteClusterOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteClusterRequest,com.google.longrunning.Operation> deleteClusterCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
DeleteClusterRequest request =
DeleteClusterRequest.newBuilder()
.setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = edgeContainerClient.deleteClusterCallable().futureCall(request);
// Do something.
future.get();
}
public final GenerateAccessTokenResponse generateAccessToken(ClusterName 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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ClusterName cluster = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
GenerateAccessTokenResponse response = edgeContainerClient.generateAccessToken(cluster);
}
cluster - Required. The resource name of the cluster.com.google.api.gax.rpc.ApiException - if the remote call failspublic final GenerateAccessTokenResponse generateAccessToken(String 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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String cluster = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
GenerateAccessTokenResponse response = edgeContainerClient.generateAccessToken(cluster);
}
cluster - Required. The resource name of the cluster.com.google.api.gax.rpc.ApiException - if the remote call failspublic final GenerateAccessTokenResponse generateAccessToken(GenerateAccessTokenRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
GenerateAccessTokenRequest request =
GenerateAccessTokenRequest.newBuilder()
.setCluster(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.build();
GenerateAccessTokenResponse response = edgeContainerClient.generateAccessToken(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GenerateAccessTokenRequest,GenerateAccessTokenResponse> generateAccessTokenCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
GenerateAccessTokenRequest request =
GenerateAccessTokenRequest.newBuilder()
.setCluster(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.build();
ApiFuture<GenerateAccessTokenResponse> future =
edgeContainerClient.generateAccessTokenCallable().futureCall(request);
// Do something.
GenerateAccessTokenResponse response = future.get();
}
public final EdgeContainerClient.ListNodePoolsPagedResponse listNodePools(ClusterName parent)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
for (NodePool element : edgeContainerClient.listNodePools(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent cluster, which owns this collection of node pools.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EdgeContainerClient.ListNodePoolsPagedResponse listNodePools(String parent)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
for (NodePool element : edgeContainerClient.listNodePools(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent cluster, which owns this collection of node pools.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EdgeContainerClient.ListNodePoolsPagedResponse listNodePools(ListNodePoolsRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListNodePoolsRequest request =
ListNodePoolsRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (NodePool element : edgeContainerClient.listNodePools(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListNodePoolsRequest,EdgeContainerClient.ListNodePoolsPagedResponse> listNodePoolsPagedCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListNodePoolsRequest request =
ListNodePoolsRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<NodePool> future =
edgeContainerClient.listNodePoolsPagedCallable().futureCall(request);
// Do something.
for (NodePool element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListNodePoolsRequest,ListNodePoolsResponse> listNodePoolsCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListNodePoolsRequest request =
ListNodePoolsRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListNodePoolsResponse response = edgeContainerClient.listNodePoolsCallable().call(request);
for (NodePool element : response.getNodePoolsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final NodePool getNodePool(NodePoolName name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
NodePoolName name = NodePoolName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[NODE_POOL]");
NodePool response = edgeContainerClient.getNodePool(name);
}
name - Required. The resource name of the node pool.com.google.api.gax.rpc.ApiException - if the remote call failspublic final NodePool getNodePool(String name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String name =
NodePoolName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[NODE_POOL]").toString();
NodePool response = edgeContainerClient.getNodePool(name);
}
name - Required. The resource name of the node pool.com.google.api.gax.rpc.ApiException - if the remote call failspublic final NodePool getNodePool(GetNodePoolRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
GetNodePoolRequest request =
GetNodePoolRequest.newBuilder()
.setName(
NodePoolName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[NODE_POOL]").toString())
.build();
NodePool response = edgeContainerClient.getNodePool(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetNodePoolRequest,NodePool> getNodePoolCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
GetNodePoolRequest request =
GetNodePoolRequest.newBuilder()
.setName(
NodePoolName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[NODE_POOL]").toString())
.build();
ApiFuture<NodePool> future = edgeContainerClient.getNodePoolCallable().futureCall(request);
// Do something.
NodePool response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<NodePool,OperationMetadata> createNodePoolAsync(ClusterName parent, NodePool nodePool, String nodePoolId)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ClusterName parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
NodePool nodePool = NodePool.newBuilder().build();
String nodePoolId = "nodePoolId1121557241";
NodePool response =
edgeContainerClient.createNodePoolAsync(parent, nodePool, nodePoolId).get();
}
parent - Required. The parent cluster where this node pool will be created.nodePool - Required. The node pool to create.nodePoolId - Required. A client-specified unique identifier for the node pool.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<NodePool,OperationMetadata> createNodePoolAsync(String parent, NodePool nodePool, String nodePoolId)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String parent = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
NodePool nodePool = NodePool.newBuilder().build();
String nodePoolId = "nodePoolId1121557241";
NodePool response =
edgeContainerClient.createNodePoolAsync(parent, nodePool, nodePoolId).get();
}
parent - Required. The parent cluster where this node pool will be created.nodePool - Required. The node pool to create.nodePoolId - Required. A client-specified unique identifier for the node pool.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<NodePool,OperationMetadata> createNodePoolAsync(CreateNodePoolRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
CreateNodePoolRequest request =
CreateNodePoolRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setNodePoolId("nodePoolId1121557241")
.setNodePool(NodePool.newBuilder().build())
.setRequestId("requestId693933066")
.build();
NodePool response = edgeContainerClient.createNodePoolAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateNodePoolRequest,NodePool,OperationMetadata> createNodePoolOperationCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
CreateNodePoolRequest request =
CreateNodePoolRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setNodePoolId("nodePoolId1121557241")
.setNodePool(NodePool.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<NodePool, OperationMetadata> future =
edgeContainerClient.createNodePoolOperationCallable().futureCall(request);
// Do something.
NodePool response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateNodePoolRequest,com.google.longrunning.Operation> createNodePoolCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
CreateNodePoolRequest request =
CreateNodePoolRequest.newBuilder()
.setParent(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
.setNodePoolId("nodePoolId1121557241")
.setNodePool(NodePool.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
edgeContainerClient.createNodePoolCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<NodePool,OperationMetadata> updateNodePoolAsync(NodePool nodePool, com.google.protobuf.FieldMask updateMask)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
NodePool nodePool = NodePool.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
NodePool response = edgeContainerClient.updateNodePoolAsync(nodePool, updateMask).get();
}
nodePool - The updated node pool.updateMask - Field mask is used to specify the fields to be overwritten in the NodePool
resource by the update. The fields specified in the update_mask are relative to the
resource, not the full request. A field will be overwritten if it is in the mask. If the
user does not provide a mask then all fields will be overwritten.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<NodePool,OperationMetadata> updateNodePoolAsync(UpdateNodePoolRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
UpdateNodePoolRequest request =
UpdateNodePoolRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setNodePool(NodePool.newBuilder().build())
.setRequestId("requestId693933066")
.build();
NodePool response = edgeContainerClient.updateNodePoolAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateNodePoolRequest,NodePool,OperationMetadata> updateNodePoolOperationCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
UpdateNodePoolRequest request =
UpdateNodePoolRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setNodePool(NodePool.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<NodePool, OperationMetadata> future =
edgeContainerClient.updateNodePoolOperationCallable().futureCall(request);
// Do something.
NodePool response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateNodePoolRequest,com.google.longrunning.Operation> updateNodePoolCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
UpdateNodePoolRequest request =
UpdateNodePoolRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setNodePool(NodePool.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
edgeContainerClient.updateNodePoolCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteNodePoolAsync(NodePoolName name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
NodePoolName name = NodePoolName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[NODE_POOL]");
edgeContainerClient.deleteNodePoolAsync(name).get();
}
name - Required. The resource name of the node pool.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteNodePoolAsync(String name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String name =
NodePoolName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[NODE_POOL]").toString();
edgeContainerClient.deleteNodePoolAsync(name).get();
}
name - Required. The resource name of the node pool.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteNodePoolAsync(DeleteNodePoolRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
DeleteNodePoolRequest request =
DeleteNodePoolRequest.newBuilder()
.setName(
NodePoolName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[NODE_POOL]").toString())
.setRequestId("requestId693933066")
.build();
edgeContainerClient.deleteNodePoolAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteNodePoolRequest,com.google.protobuf.Empty,OperationMetadata> deleteNodePoolOperationCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
DeleteNodePoolRequest request =
DeleteNodePoolRequest.newBuilder()
.setName(
NodePoolName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[NODE_POOL]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
edgeContainerClient.deleteNodePoolOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteNodePoolRequest,com.google.longrunning.Operation> deleteNodePoolCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
DeleteNodePoolRequest request =
DeleteNodePoolRequest.newBuilder()
.setName(
NodePoolName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]", "[NODE_POOL]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
edgeContainerClient.deleteNodePoolCallable().futureCall(request);
// Do something.
future.get();
}
public final EdgeContainerClient.ListMachinesPagedResponse listMachines(LocationName parent)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Machine element : edgeContainerClient.listMachines(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent site, which owns this collection of machines.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EdgeContainerClient.ListMachinesPagedResponse listMachines(String parent)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Machine element : edgeContainerClient.listMachines(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent site, which owns this collection of machines.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EdgeContainerClient.ListMachinesPagedResponse listMachines(ListMachinesRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListMachinesRequest request =
ListMachinesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Machine element : edgeContainerClient.listMachines(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListMachinesRequest,EdgeContainerClient.ListMachinesPagedResponse> listMachinesPagedCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListMachinesRequest request =
ListMachinesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Machine> future =
edgeContainerClient.listMachinesPagedCallable().futureCall(request);
// Do something.
for (Machine element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListMachinesRequest,ListMachinesResponse> listMachinesCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListMachinesRequest request =
ListMachinesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListMachinesResponse response = edgeContainerClient.listMachinesCallable().call(request);
for (Machine element : response.getMachinesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Machine getMachine(MachineName name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
MachineName name = MachineName.of("[PROJECT]", "[LOCATION]", "[MACHINE]");
Machine response = edgeContainerClient.getMachine(name);
}
name - Required. The resource name of the machine.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Machine getMachine(String name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String name = MachineName.of("[PROJECT]", "[LOCATION]", "[MACHINE]").toString();
Machine response = edgeContainerClient.getMachine(name);
}
name - Required. The resource name of the machine.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Machine getMachine(GetMachineRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
GetMachineRequest request =
GetMachineRequest.newBuilder()
.setName(MachineName.of("[PROJECT]", "[LOCATION]", "[MACHINE]").toString())
.build();
Machine response = edgeContainerClient.getMachine(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetMachineRequest,Machine> getMachineCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
GetMachineRequest request =
GetMachineRequest.newBuilder()
.setName(MachineName.of("[PROJECT]", "[LOCATION]", "[MACHINE]").toString())
.build();
ApiFuture<Machine> future = edgeContainerClient.getMachineCallable().futureCall(request);
// Do something.
Machine response = future.get();
}
public final EdgeContainerClient.ListVpnConnectionsPagedResponse listVpnConnections(LocationName parent)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (VpnConnection element : edgeContainerClient.listVpnConnections(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent location, which owns this collection of VPN connections.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EdgeContainerClient.ListVpnConnectionsPagedResponse listVpnConnections(String parent)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (VpnConnection element : edgeContainerClient.listVpnConnections(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent location, which owns this collection of VPN connections.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EdgeContainerClient.ListVpnConnectionsPagedResponse listVpnConnections(ListVpnConnectionsRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListVpnConnectionsRequest request =
ListVpnConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (VpnConnection element : edgeContainerClient.listVpnConnections(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListVpnConnectionsRequest,EdgeContainerClient.ListVpnConnectionsPagedResponse> listVpnConnectionsPagedCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListVpnConnectionsRequest request =
ListVpnConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<VpnConnection> future =
edgeContainerClient.listVpnConnectionsPagedCallable().futureCall(request);
// Do something.
for (VpnConnection element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListVpnConnectionsRequest,ListVpnConnectionsResponse> listVpnConnectionsCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
ListVpnConnectionsRequest request =
ListVpnConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListVpnConnectionsResponse response =
edgeContainerClient.listVpnConnectionsCallable().call(request);
for (VpnConnection element : response.getVpnConnectionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final VpnConnection getVpnConnection(VpnConnectionName name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
VpnConnectionName name = VpnConnectionName.of("[PROJECT]", "[LOCATION]", "[VPN_CONNECTION]");
VpnConnection response = edgeContainerClient.getVpnConnection(name);
}
name - Required. The resource name of the vpn connection.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VpnConnection getVpnConnection(String name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String name = VpnConnectionName.of("[PROJECT]", "[LOCATION]", "[VPN_CONNECTION]").toString();
VpnConnection response = edgeContainerClient.getVpnConnection(name);
}
name - Required. The resource name of the vpn connection.com.google.api.gax.rpc.ApiException - if the remote call failspublic final VpnConnection getVpnConnection(GetVpnConnectionRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
GetVpnConnectionRequest request =
GetVpnConnectionRequest.newBuilder()
.setName(
VpnConnectionName.of("[PROJECT]", "[LOCATION]", "[VPN_CONNECTION]").toString())
.build();
VpnConnection response = edgeContainerClient.getVpnConnection(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetVpnConnectionRequest,VpnConnection> getVpnConnectionCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
GetVpnConnectionRequest request =
GetVpnConnectionRequest.newBuilder()
.setName(
VpnConnectionName.of("[PROJECT]", "[LOCATION]", "[VPN_CONNECTION]").toString())
.build();
ApiFuture<VpnConnection> future =
edgeContainerClient.getVpnConnectionCallable().futureCall(request);
// Do something.
VpnConnection response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<VpnConnection,OperationMetadata> createVpnConnectionAsync(LocationName parent, VpnConnection vpnConnection, String vpnConnectionId)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
VpnConnection vpnConnection = VpnConnection.newBuilder().build();
String vpnConnectionId = "vpnConnectionId887330733";
VpnConnection response =
edgeContainerClient
.createVpnConnectionAsync(parent, vpnConnection, vpnConnectionId)
.get();
}
parent - Required. The parent location where this vpn connection will be created.vpnConnection - Required. The VPN connection to create.vpnConnectionId - Required. The VPN connection identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<VpnConnection,OperationMetadata> createVpnConnectionAsync(String parent, VpnConnection vpnConnection, String vpnConnectionId)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
VpnConnection vpnConnection = VpnConnection.newBuilder().build();
String vpnConnectionId = "vpnConnectionId887330733";
VpnConnection response =
edgeContainerClient
.createVpnConnectionAsync(parent, vpnConnection, vpnConnectionId)
.get();
}
parent - Required. The parent location where this vpn connection will be created.vpnConnection - Required. The VPN connection to create.vpnConnectionId - Required. The VPN connection identifier.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<VpnConnection,OperationMetadata> createVpnConnectionAsync(CreateVpnConnectionRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
CreateVpnConnectionRequest request =
CreateVpnConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setVpnConnectionId("vpnConnectionId887330733")
.setVpnConnection(VpnConnection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
VpnConnection response = edgeContainerClient.createVpnConnectionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateVpnConnectionRequest,VpnConnection,OperationMetadata> createVpnConnectionOperationCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
CreateVpnConnectionRequest request =
CreateVpnConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setVpnConnectionId("vpnConnectionId887330733")
.setVpnConnection(VpnConnection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<VpnConnection, OperationMetadata> future =
edgeContainerClient.createVpnConnectionOperationCallable().futureCall(request);
// Do something.
VpnConnection response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateVpnConnectionRequest,com.google.longrunning.Operation> createVpnConnectionCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
CreateVpnConnectionRequest request =
CreateVpnConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setVpnConnectionId("vpnConnectionId887330733")
.setVpnConnection(VpnConnection.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
edgeContainerClient.createVpnConnectionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteVpnConnectionAsync(VpnConnectionName name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
VpnConnectionName name = VpnConnectionName.of("[PROJECT]", "[LOCATION]", "[VPN_CONNECTION]");
edgeContainerClient.deleteVpnConnectionAsync(name).get();
}
name - Required. The resource name of the vpn connection.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteVpnConnectionAsync(String name)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
String name = VpnConnectionName.of("[PROJECT]", "[LOCATION]", "[VPN_CONNECTION]").toString();
edgeContainerClient.deleteVpnConnectionAsync(name).get();
}
name - Required. The resource name of the vpn connection.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteVpnConnectionAsync(DeleteVpnConnectionRequest request)
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
DeleteVpnConnectionRequest request =
DeleteVpnConnectionRequest.newBuilder()
.setName(
VpnConnectionName.of("[PROJECT]", "[LOCATION]", "[VPN_CONNECTION]").toString())
.setRequestId("requestId693933066")
.build();
edgeContainerClient.deleteVpnConnectionAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteVpnConnectionRequest,com.google.protobuf.Empty,OperationMetadata> deleteVpnConnectionOperationCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
DeleteVpnConnectionRequest request =
DeleteVpnConnectionRequest.newBuilder()
.setName(
VpnConnectionName.of("[PROJECT]", "[LOCATION]", "[VPN_CONNECTION]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
edgeContainerClient.deleteVpnConnectionOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteVpnConnectionRequest,com.google.longrunning.Operation> deleteVpnConnectionCallable()
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 (EdgeContainerClient edgeContainerClient = EdgeContainerClient.create()) {
DeleteVpnConnectionRequest request =
DeleteVpnConnectionRequest.newBuilder()
.setName(
VpnConnectionName.of("[PROJECT]", "[LOCATION]", "[VPN_CONNECTION]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
edgeContainerClient.deleteVpnConnectionCallable().futureCall(request);
// Do something.
future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2023 Google LLC. All rights reserved.