@Generated(value="by gapic-generator-java") public class InterconnectsClient 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
String project = "project-309310695";
String interconnect = "interconnect-849140594";
Interconnect response = interconnectsClient.get(project, interconnect);
}
Note: close() needs to be called on the InterconnectsClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
Delete |
Deletes the specified Interconnect. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Get |
Returns the specified Interconnect. Get a list of available Interconnects by making a list() request. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDiagnostics |
Returns the interconnectDiagnostics for the specified Interconnect. In the event of a global outage, do not use this API to make decisions about where to redirect your network traffic. Unlike a VLAN attachment, which is regional, a Cloud Interconnect connection is a global resource. A global outage can prevent this API from functioning properly. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetMacsecConfig |
Returns the interconnectMacsecConfig for the specified Interconnect. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Insert |
Creates an Interconnect in the specified project using the data included in the request. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
List |
Retrieves the list of Interconnects available to the specified project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Patch |
Updates the specified Interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetLabels |
Sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of InterconnectsSettings 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
InterconnectsSettings interconnectsSettings =
InterconnectsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
InterconnectsClient interconnectsClient = InterconnectsClient.create(interconnectsSettings);
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
InterconnectsSettings interconnectsSettings =
InterconnectsSettings.newBuilder().setEndpoint(myEndpoint).build();
InterconnectsClient interconnectsClient = InterconnectsClient.create(interconnectsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
InterconnectsClient.ListFixedSizeCollection |
static class |
InterconnectsClient.ListPage |
static class |
InterconnectsClient.ListPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
InterconnectsClient(InterconnectsSettings settings)
Constructs an instance of InterconnectsClient, using the given settings.
|
protected |
InterconnectsClient(InterconnectsStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static InterconnectsClient |
create()
Constructs an instance of InterconnectsClient with default settings.
|
static InterconnectsClient |
create(InterconnectsSettings settings)
Constructs an instance of InterconnectsClient, using the given settings.
|
static InterconnectsClient |
create(InterconnectsStub stub)
Constructs an instance of InterconnectsClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(DeleteInterconnectRequest request)
Deletes the specified Interconnect.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(String project,
String interconnect)
Deletes the specified Interconnect.
|
com.google.api.gax.rpc.UnaryCallable<DeleteInterconnectRequest,Operation> |
deleteCallable()
Deletes the specified Interconnect.
|
com.google.api.gax.rpc.OperationCallable<DeleteInterconnectRequest,Operation,Operation> |
deleteOperationCallable()
Deletes the specified Interconnect.
|
Interconnect |
get(GetInterconnectRequest request)
Returns the specified Interconnect.
|
Interconnect |
get(String project,
String interconnect)
Returns the specified Interconnect.
|
com.google.api.gax.rpc.UnaryCallable<GetInterconnectRequest,Interconnect> |
getCallable()
Returns the specified Interconnect.
|
InterconnectsGetDiagnosticsResponse |
getDiagnostics(GetDiagnosticsInterconnectRequest request)
Returns the interconnectDiagnostics for the specified Interconnect.
|
InterconnectsGetDiagnosticsResponse |
getDiagnostics(String project,
String interconnect)
Returns the interconnectDiagnostics for the specified Interconnect.
|
com.google.api.gax.rpc.UnaryCallable<GetDiagnosticsInterconnectRequest,InterconnectsGetDiagnosticsResponse> |
getDiagnosticsCallable()
Returns the interconnectDiagnostics for the specified Interconnect.
|
InterconnectsGetMacsecConfigResponse |
getMacsecConfig(GetMacsecConfigInterconnectRequest request)
Returns the interconnectMacsecConfig for the specified Interconnect.
|
InterconnectsGetMacsecConfigResponse |
getMacsecConfig(String project,
String interconnect)
Returns the interconnectMacsecConfig for the specified Interconnect.
|
com.google.api.gax.rpc.UnaryCallable<GetMacsecConfigInterconnectRequest,InterconnectsGetMacsecConfigResponse> |
getMacsecConfigCallable()
Returns the interconnectMacsecConfig for the specified Interconnect.
|
InterconnectsSettings |
getSettings() |
InterconnectsStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(InsertInterconnectRequest request)
Creates an Interconnect in the specified project using the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(String project,
Interconnect interconnectResource)
Creates an Interconnect in the specified project using the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertInterconnectRequest,Operation> |
insertCallable()
Creates an Interconnect in the specified project using the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<InsertInterconnectRequest,Operation,Operation> |
insertOperationCallable()
Creates an Interconnect in the specified project using the data included in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
InterconnectsClient.ListPagedResponse |
list(ListInterconnectsRequest request)
Retrieves the list of Interconnects available to the specified project.
|
InterconnectsClient.ListPagedResponse |
list(String project)
Retrieves the list of Interconnects available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListInterconnectsRequest,InterconnectList> |
listCallable()
Retrieves the list of Interconnects available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListInterconnectsRequest,InterconnectsClient.ListPagedResponse> |
listPagedCallable()
Retrieves the list of Interconnects available to the specified project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchAsync(PatchInterconnectRequest request)
Updates the specified Interconnect with the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchAsync(String project,
String interconnect,
Interconnect interconnectResource)
Updates the specified Interconnect with the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<PatchInterconnectRequest,Operation> |
patchCallable()
Updates the specified Interconnect with the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<PatchInterconnectRequest,Operation,Operation> |
patchOperationCallable()
Updates the specified Interconnect with the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setLabelsAsync(SetLabelsInterconnectRequest request)
Sets the labels on an Interconnect.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setLabelsAsync(String project,
String resource,
GlobalSetLabelsRequest globalSetLabelsRequestResource)
Sets the labels on an Interconnect.
|
com.google.api.gax.rpc.UnaryCallable<SetLabelsInterconnectRequest,Operation> |
setLabelsCallable()
Sets the labels on an Interconnect.
|
com.google.api.gax.rpc.OperationCallable<SetLabelsInterconnectRequest,Operation,Operation> |
setLabelsOperationCallable()
Sets the labels on an Interconnect.
|
void |
shutdown() |
void |
shutdownNow() |
protected InterconnectsClient(InterconnectsSettings settings) throws IOException
IOExceptionprotected InterconnectsClient(InterconnectsStub stub)
public static final InterconnectsClient create() throws IOException
IOExceptionpublic static final InterconnectsClient create(InterconnectsSettings settings) throws IOException
IOExceptionpublic static final InterconnectsClient create(InterconnectsStub stub)
public final InterconnectsSettings getSettings()
public InterconnectsStub getStub()
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String project, String interconnect)
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
String project = "project-309310695";
String interconnect = "interconnect-849140594";
Operation response = interconnectsClient.deleteAsync(project, interconnect).get();
}
project - Project ID for this request.interconnect - Name of the interconnect to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteInterconnectRequest 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
DeleteInterconnectRequest request =
DeleteInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = interconnectsClient.deleteAsync(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<DeleteInterconnectRequest,Operation,Operation> deleteOperationCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
DeleteInterconnectRequest request =
DeleteInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
interconnectsClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteInterconnectRequest,Operation> deleteCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
DeleteInterconnectRequest request =
DeleteInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = interconnectsClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Interconnect get(String project, String interconnect)
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
String project = "project-309310695";
String interconnect = "interconnect-849140594";
Interconnect response = interconnectsClient.get(project, interconnect);
}
project - Project ID for this request.interconnect - Name of the interconnect to return.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Interconnect get(GetInterconnectRequest 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
GetInterconnectRequest request =
GetInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setProject("project-309310695")
.build();
Interconnect response = interconnectsClient.get(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<GetInterconnectRequest,Interconnect> getCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
GetInterconnectRequest request =
GetInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setProject("project-309310695")
.build();
ApiFuture<Interconnect> future = interconnectsClient.getCallable().futureCall(request);
// Do something.
Interconnect response = future.get();
}
public final InterconnectsGetDiagnosticsResponse getDiagnostics(String project, String interconnect)
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
String project = "project-309310695";
String interconnect = "interconnect-849140594";
InterconnectsGetDiagnosticsResponse response =
interconnectsClient.getDiagnostics(project, interconnect);
}
project - Project ID for this request.interconnect - Name of the interconnect resource to query.com.google.api.gax.rpc.ApiException - if the remote call failspublic final InterconnectsGetDiagnosticsResponse getDiagnostics(GetDiagnosticsInterconnectRequest 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
GetDiagnosticsInterconnectRequest request =
GetDiagnosticsInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setProject("project-309310695")
.build();
InterconnectsGetDiagnosticsResponse response = interconnectsClient.getDiagnostics(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<GetDiagnosticsInterconnectRequest,InterconnectsGetDiagnosticsResponse> getDiagnosticsCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
GetDiagnosticsInterconnectRequest request =
GetDiagnosticsInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setProject("project-309310695")
.build();
ApiFuture<InterconnectsGetDiagnosticsResponse> future =
interconnectsClient.getDiagnosticsCallable().futureCall(request);
// Do something.
InterconnectsGetDiagnosticsResponse response = future.get();
}
public final InterconnectsGetMacsecConfigResponse getMacsecConfig(String project, String interconnect)
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
String project = "project-309310695";
String interconnect = "interconnect-849140594";
InterconnectsGetMacsecConfigResponse response =
interconnectsClient.getMacsecConfig(project, interconnect);
}
project - Project ID for this request.interconnect - Name of the interconnect resource to query.com.google.api.gax.rpc.ApiException - if the remote call failspublic final InterconnectsGetMacsecConfigResponse getMacsecConfig(GetMacsecConfigInterconnectRequest 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
GetMacsecConfigInterconnectRequest request =
GetMacsecConfigInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setProject("project-309310695")
.build();
InterconnectsGetMacsecConfigResponse response = interconnectsClient.getMacsecConfig(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<GetMacsecConfigInterconnectRequest,InterconnectsGetMacsecConfigResponse> getMacsecConfigCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
GetMacsecConfigInterconnectRequest request =
GetMacsecConfigInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setProject("project-309310695")
.build();
ApiFuture<InterconnectsGetMacsecConfigResponse> future =
interconnectsClient.getMacsecConfigCallable().futureCall(request);
// Do something.
InterconnectsGetMacsecConfigResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(String project, Interconnect interconnectResource)
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
String project = "project-309310695";
Interconnect interconnectResource = Interconnect.newBuilder().build();
Operation response = interconnectsClient.insertAsync(project, interconnectResource).get();
}
project - Project ID for this request.interconnectResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(InsertInterconnectRequest 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
InsertInterconnectRequest request =
InsertInterconnectRequest.newBuilder()
.setInterconnectResource(Interconnect.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = interconnectsClient.insertAsync(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<InsertInterconnectRequest,Operation,Operation> insertOperationCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
InsertInterconnectRequest request =
InsertInterconnectRequest.newBuilder()
.setInterconnectResource(Interconnect.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
interconnectsClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<InsertInterconnectRequest,Operation> insertCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
InsertInterconnectRequest request =
InsertInterconnectRequest.newBuilder()
.setInterconnectResource(Interconnect.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = interconnectsClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final InterconnectsClient.ListPagedResponse list(String project)
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
String project = "project-309310695";
for (Interconnect element : interconnectsClient.list(project).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final InterconnectsClient.ListPagedResponse list(ListInterconnectsRequest 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
ListInterconnectsRequest request =
ListInterconnectsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
for (Interconnect element : interconnectsClient.list(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<ListInterconnectsRequest,InterconnectsClient.ListPagedResponse> listPagedCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
ListInterconnectsRequest request =
ListInterconnectsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
ApiFuture<Interconnect> future = interconnectsClient.listPagedCallable().futureCall(request);
// Do something.
for (Interconnect element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListInterconnectsRequest,InterconnectList> listCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
ListInterconnectsRequest request =
ListInterconnectsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
while (true) {
InterconnectList response = interconnectsClient.listCallable().call(request);
for (Interconnect element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(String project, String interconnect, Interconnect interconnectResource)
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
String project = "project-309310695";
String interconnect = "interconnect-849140594";
Interconnect interconnectResource = Interconnect.newBuilder().build();
Operation response =
interconnectsClient.patchAsync(project, interconnect, interconnectResource).get();
}
project - Project ID for this request.interconnect - Name of the interconnect to update.interconnectResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(PatchInterconnectRequest 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
PatchInterconnectRequest request =
PatchInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setInterconnectResource(Interconnect.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = interconnectsClient.patchAsync(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<PatchInterconnectRequest,Operation,Operation> patchOperationCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
PatchInterconnectRequest request =
PatchInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setInterconnectResource(Interconnect.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
interconnectsClient.patchOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<PatchInterconnectRequest,Operation> patchCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
PatchInterconnectRequest request =
PatchInterconnectRequest.newBuilder()
.setInterconnect("interconnect-849140594")
.setInterconnectResource(Interconnect.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = interconnectsClient.patchCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setLabelsAsync(String project, String resource, GlobalSetLabelsRequest globalSetLabelsRequestResource)
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
String project = "project-309310695";
String resource = "resource-341064690";
GlobalSetLabelsRequest globalSetLabelsRequestResource =
GlobalSetLabelsRequest.newBuilder().build();
Operation response =
interconnectsClient
.setLabelsAsync(project, resource, globalSetLabelsRequestResource)
.get();
}
project - Project ID for this request.resource - Name or id of the resource for this request.globalSetLabelsRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setLabelsAsync(SetLabelsInterconnectRequest 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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
SetLabelsInterconnectRequest request =
SetLabelsInterconnectRequest.newBuilder()
.setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest.newBuilder().build())
.setProject("project-309310695")
.setResource("resource-341064690")
.build();
Operation response = interconnectsClient.setLabelsAsync(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<SetLabelsInterconnectRequest,Operation,Operation> setLabelsOperationCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
SetLabelsInterconnectRequest request =
SetLabelsInterconnectRequest.newBuilder()
.setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest.newBuilder().build())
.setProject("project-309310695")
.setResource("resource-341064690")
.build();
OperationFuture<Operation, Operation> future =
interconnectsClient.setLabelsOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetLabelsInterconnectRequest,Operation> setLabelsCallable()
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 (InterconnectsClient interconnectsClient = InterconnectsClient.create()) {
SetLabelsInterconnectRequest request =
SetLabelsInterconnectRequest.newBuilder()
.setGlobalSetLabelsRequestResource(GlobalSetLabelsRequest.newBuilder().build())
.setProject("project-309310695")
.setResource("resource-341064690")
.build();
ApiFuture<Operation> future = interconnectsClient.setLabelsCallable().futureCall(request);
// Do something.
Operation response = 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 © 2024 Google LLC. All rights reserved.