@Generated(value="by gapic-generator") @BetaApi public class InterconnectAttachmentClient 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:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(interconnectAttachment);
}
Note: close() needs to be called on the interconnectAttachmentClient 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 InterconnectAttachmentSettings to create(). For example:
To customize credentials:
InterconnectAttachmentSettings interconnectAttachmentSettings =
InterconnectAttachmentSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
InterconnectAttachmentClient interconnectAttachmentClient =
InterconnectAttachmentClient.create(interconnectAttachmentSettings);
To customize the endpoint:
InterconnectAttachmentSettings interconnectAttachmentSettings =
InterconnectAttachmentSettings.newBuilder().setEndpoint(myEndpoint).build();
InterconnectAttachmentClient interconnectAttachmentClient =
InterconnectAttachmentClient.create(interconnectAttachmentSettings);
Modifier and Type | Class and Description |
---|---|
static class |
InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsFixedSizeCollection |
static class |
InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPage |
static class |
InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse |
static class |
InterconnectAttachmentClient.ListInterconnectAttachmentsFixedSizeCollection |
static class |
InterconnectAttachmentClient.ListInterconnectAttachmentsPage |
static class |
InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
InterconnectAttachmentClient(InterconnectAttachmentSettings settings)
Constructs an instance of InterconnectAttachmentClient, using the given settings.
|
protected |
InterconnectAttachmentClient(InterconnectAttachmentStub stub) |
Modifier and Type | Method and Description |
---|---|
InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse |
aggregatedListInterconnectAttachments(AggregatedListInterconnectAttachmentsHttpRequest request)
Retrieves an aggregated list of interconnect attachments.
|
InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse |
aggregatedListInterconnectAttachments(ProjectName project)
Retrieves an aggregated list of interconnect attachments.
|
InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse |
aggregatedListInterconnectAttachments(String project)
Retrieves an aggregated list of interconnect attachments.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListInterconnectAttachmentsHttpRequest,InterconnectAttachmentAggregatedList> |
aggregatedListInterconnectAttachmentsCallable()
Retrieves an aggregated list of interconnect attachments.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListInterconnectAttachmentsHttpRequest,InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse> |
aggregatedListInterconnectAttachmentsPagedCallable()
Retrieves an aggregated list of interconnect attachments.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static InterconnectAttachmentClient |
create()
Constructs an instance of InterconnectAttachmentClient with default settings.
|
static InterconnectAttachmentClient |
create(InterconnectAttachmentSettings settings)
Constructs an instance of InterconnectAttachmentClient, using the given settings.
|
static InterconnectAttachmentClient |
create(InterconnectAttachmentStub stub)
Constructs an instance of InterconnectAttachmentClient, using the given stub for making calls.
|
Operation |
deleteInterconnectAttachment(DeleteInterconnectAttachmentHttpRequest request)
Deletes the specified interconnect attachment.
|
Operation |
deleteInterconnectAttachment(ProjectRegionInterconnectAttachmentName interconnectAttachment)
Deletes the specified interconnect attachment.
|
Operation |
deleteInterconnectAttachment(String interconnectAttachment)
Deletes the specified interconnect attachment.
|
com.google.api.gax.rpc.UnaryCallable<DeleteInterconnectAttachmentHttpRequest,Operation> |
deleteInterconnectAttachmentCallable()
Deletes the specified interconnect attachment.
|
InterconnectAttachment |
getInterconnectAttachment(GetInterconnectAttachmentHttpRequest request)
Returns the specified interconnect attachment.
|
InterconnectAttachment |
getInterconnectAttachment(ProjectRegionInterconnectAttachmentName interconnectAttachment)
Returns the specified interconnect attachment.
|
InterconnectAttachment |
getInterconnectAttachment(String interconnectAttachment)
Returns the specified interconnect attachment.
|
com.google.api.gax.rpc.UnaryCallable<GetInterconnectAttachmentHttpRequest,InterconnectAttachment> |
getInterconnectAttachmentCallable()
Returns the specified interconnect attachment.
|
InterconnectAttachmentSettings |
getSettings() |
InterconnectAttachmentStub |
getStub() |
Operation |
insertInterconnectAttachment(InsertInterconnectAttachmentHttpRequest request)
Creates an InterconnectAttachment in the specified project using the data included in the
request.
|
Operation |
insertInterconnectAttachment(ProjectRegionName region,
InterconnectAttachment interconnectAttachmentResource)
Creates an InterconnectAttachment in the specified project using the data included in the
request.
|
Operation |
insertInterconnectAttachment(String region,
InterconnectAttachment interconnectAttachmentResource)
Creates an InterconnectAttachment in the specified project using the data included in the
request.
|
com.google.api.gax.rpc.UnaryCallable<InsertInterconnectAttachmentHttpRequest,Operation> |
insertInterconnectAttachmentCallable()
Creates an InterconnectAttachment in the specified project using the data included in the
request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse |
listInterconnectAttachments(ListInterconnectAttachmentsHttpRequest request)
Retrieves the list of interconnect attachments contained within the specified region.
|
InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse |
listInterconnectAttachments(ProjectRegionName region)
Retrieves the list of interconnect attachments contained within the specified region.
|
InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse |
listInterconnectAttachments(String region)
Retrieves the list of interconnect attachments contained within the specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListInterconnectAttachmentsHttpRequest,InterconnectAttachmentList> |
listInterconnectAttachmentsCallable()
Retrieves the list of interconnect attachments contained within the specified region.
|
com.google.api.gax.rpc.UnaryCallable<ListInterconnectAttachmentsHttpRequest,InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse> |
listInterconnectAttachmentsPagedCallable()
Retrieves the list of interconnect attachments contained within the specified region.
|
Operation |
patchInterconnectAttachment(PatchInterconnectAttachmentHttpRequest request)
Updates the specified interconnect attachment with the data included in the request.
|
Operation |
patchInterconnectAttachment(ProjectRegionInterconnectAttachmentName interconnectAttachment,
InterconnectAttachment interconnectAttachmentResource,
List<String> fieldMask)
Updates the specified interconnect attachment with the data included in the request.
|
Operation |
patchInterconnectAttachment(String interconnectAttachment,
InterconnectAttachment interconnectAttachmentResource,
List<String> fieldMask)
Updates the specified interconnect attachment with the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<PatchInterconnectAttachmentHttpRequest,Operation> |
patchInterconnectAttachmentCallable()
Updates the specified interconnect attachment with the data included in the request.
|
void |
shutdown() |
void |
shutdownNow() |
protected InterconnectAttachmentClient(InterconnectAttachmentSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected InterconnectAttachmentClient(InterconnectAttachmentStub stub)
public static final InterconnectAttachmentClient create() throws IOException
IOException
public static final InterconnectAttachmentClient create(InterconnectAttachmentSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final InterconnectAttachmentClient create(InterconnectAttachmentStub stub)
public final InterconnectAttachmentSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public InterconnectAttachmentStub getStub()
@BetaApi public final InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse aggregatedListInterconnectAttachments(ProjectName project)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (InterconnectAttachmentsScopedList element : interconnectAttachmentClient.aggregatedListInterconnectAttachments(project).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse aggregatedListInterconnectAttachments(String project)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (InterconnectAttachmentsScopedList element : interconnectAttachmentClient.aggregatedListInterconnectAttachments(project.toString()).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse aggregatedListInterconnectAttachments(AggregatedListInterconnectAttachmentsHttpRequest request)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListInterconnectAttachmentsHttpRequest request = AggregatedListInterconnectAttachmentsHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
for (InterconnectAttachmentsScopedList element : interconnectAttachmentClient.aggregatedListInterconnectAttachments(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 fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<AggregatedListInterconnectAttachmentsHttpRequest,InterconnectAttachmentClient.AggregatedListInterconnectAttachmentsPagedResponse> aggregatedListInterconnectAttachmentsPagedCallable()
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListInterconnectAttachmentsHttpRequest request = AggregatedListInterconnectAttachmentsHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
ApiFuture<AggregatedListInterconnectAttachmentsPagedResponse> future = interconnectAttachmentClient.aggregatedListInterconnectAttachmentsPagedCallable().futureCall(request);
// Do something
for (InterconnectAttachmentsScopedList element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<AggregatedListInterconnectAttachmentsHttpRequest,InterconnectAttachmentAggregatedList> aggregatedListInterconnectAttachmentsCallable()
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListInterconnectAttachmentsHttpRequest request = AggregatedListInterconnectAttachmentsHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
while (true) {
InterconnectAttachmentAggregatedList response = interconnectAttachmentClient.aggregatedListInterconnectAttachmentsCallable().call(request);
for (InterconnectAttachmentsScopedList element : response.getItemsMap()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final Operation deleteInterconnectAttachment(ProjectRegionInterconnectAttachmentName interconnectAttachment)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(interconnectAttachment);
}
interconnectAttachment
- Name of the interconnect attachment to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteInterconnectAttachment(String interconnectAttachment)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(interconnectAttachment.toString());
}
interconnectAttachment
- Name of the interconnect attachment to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteInterconnectAttachment(DeleteInterconnectAttachmentHttpRequest request)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedInterconnectAttachment = ProjectRegionInterconnectAttachmentName.format("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder()
.setInterconnectAttachment(formattedInterconnectAttachment)
.build();
Operation response = interconnectAttachmentClient.deleteInterconnectAttachment(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<DeleteInterconnectAttachmentHttpRequest,Operation> deleteInterconnectAttachmentCallable()
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedInterconnectAttachment = ProjectRegionInterconnectAttachmentName.format("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
DeleteInterconnectAttachmentHttpRequest request = DeleteInterconnectAttachmentHttpRequest.newBuilder()
.setInterconnectAttachment(formattedInterconnectAttachment)
.build();
ApiFuture<Operation> future = interconnectAttachmentClient.deleteInterconnectAttachmentCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final InterconnectAttachment getInterconnectAttachment(ProjectRegionInterconnectAttachmentName interconnectAttachment)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
InterconnectAttachment response = interconnectAttachmentClient.getInterconnectAttachment(interconnectAttachment);
}
interconnectAttachment
- Name of the interconnect attachment to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final InterconnectAttachment getInterconnectAttachment(String interconnectAttachment)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
InterconnectAttachment response = interconnectAttachmentClient.getInterconnectAttachment(interconnectAttachment.toString());
}
interconnectAttachment
- Name of the interconnect attachment to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final InterconnectAttachment getInterconnectAttachment(GetInterconnectAttachmentHttpRequest request)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedInterconnectAttachment = ProjectRegionInterconnectAttachmentName.format("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
GetInterconnectAttachmentHttpRequest request = GetInterconnectAttachmentHttpRequest.newBuilder()
.setInterconnectAttachment(formattedInterconnectAttachment)
.build();
InterconnectAttachment response = interconnectAttachmentClient.getInterconnectAttachment(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<GetInterconnectAttachmentHttpRequest,InterconnectAttachment> getInterconnectAttachmentCallable()
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedInterconnectAttachment = ProjectRegionInterconnectAttachmentName.format("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
GetInterconnectAttachmentHttpRequest request = GetInterconnectAttachmentHttpRequest.newBuilder()
.setInterconnectAttachment(formattedInterconnectAttachment)
.build();
ApiFuture<InterconnectAttachment> future = interconnectAttachmentClient.getInterconnectAttachmentCallable().futureCall(request);
// Do something
InterconnectAttachment response = future.get();
}
@BetaApi public final Operation insertInterconnectAttachment(ProjectRegionName region, InterconnectAttachment interconnectAttachmentResource)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
Operation response = interconnectAttachmentClient.insertInterconnectAttachment(region, interconnectAttachmentResource);
}
region
- Name of the region for this request.interconnectAttachmentResource
- Represents an Interconnect Attachment (VLAN) resource.
You can use Interconnect attachments (VLANS) to connect your Virtual Private Cloud networks to your on-premises networks through an Interconnect. For more information, read Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==)
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertInterconnectAttachment(String region, InterconnectAttachment interconnectAttachmentResource)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
Operation response = interconnectAttachmentClient.insertInterconnectAttachment(region.toString(), interconnectAttachmentResource);
}
region
- Name of the region for this request.interconnectAttachmentResource
- Represents an Interconnect Attachment (VLAN) resource.
You can use Interconnect attachments (VLANS) to connect your Virtual Private Cloud networks to your on-premises networks through an Interconnect. For more information, read Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==)
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertInterconnectAttachment(InsertInterconnectAttachmentHttpRequest request)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder()
.setRegion(formattedRegion)
.setInterconnectAttachmentResource(interconnectAttachmentResource)
.build();
Operation response = interconnectAttachmentClient.insertInterconnectAttachment(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<InsertInterconnectAttachmentHttpRequest,Operation> insertInterconnectAttachmentCallable()
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
InsertInterconnectAttachmentHttpRequest request = InsertInterconnectAttachmentHttpRequest.newBuilder()
.setRegion(formattedRegion)
.setInterconnectAttachmentResource(interconnectAttachmentResource)
.build();
ApiFuture<Operation> future = interconnectAttachmentClient.insertInterconnectAttachmentCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(ProjectRegionName region)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (InterconnectAttachment element : interconnectAttachmentClient.listInterconnectAttachments(region).iterateAll()) {
// doThingsWith(element);
}
}
region
- Name of the region for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(String region)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionName region = ProjectRegionName.of("[PROJECT]", "[REGION]");
for (InterconnectAttachment element : interconnectAttachmentClient.listInterconnectAttachments(region.toString()).iterateAll()) {
// doThingsWith(element);
}
}
region
- Name of the region for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse listInterconnectAttachments(ListInterconnectAttachmentsHttpRequest request)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListInterconnectAttachmentsHttpRequest request = ListInterconnectAttachmentsHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
for (InterconnectAttachment element : interconnectAttachmentClient.listInterconnectAttachments(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 fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListInterconnectAttachmentsHttpRequest,InterconnectAttachmentClient.ListInterconnectAttachmentsPagedResponse> listInterconnectAttachmentsPagedCallable()
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListInterconnectAttachmentsHttpRequest request = ListInterconnectAttachmentsHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
ApiFuture<ListInterconnectAttachmentsPagedResponse> future = interconnectAttachmentClient.listInterconnectAttachmentsPagedCallable().futureCall(request);
// Do something
for (InterconnectAttachment element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListInterconnectAttachmentsHttpRequest,InterconnectAttachmentList> listInterconnectAttachmentsCallable()
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedRegion = ProjectRegionName.format("[PROJECT]", "[REGION]");
ListInterconnectAttachmentsHttpRequest request = ListInterconnectAttachmentsHttpRequest.newBuilder()
.setRegion(formattedRegion)
.build();
while (true) {
InterconnectAttachmentList response = interconnectAttachmentClient.listInterconnectAttachmentsCallable().call(request);
for (InterconnectAttachment element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final Operation patchInterconnectAttachment(ProjectRegionInterconnectAttachmentName interconnectAttachment, InterconnectAttachment interconnectAttachmentResource, List<String> fieldMask)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = interconnectAttachmentClient.patchInterconnectAttachment(interconnectAttachment, interconnectAttachmentResource, fieldMask);
}
interconnectAttachment
- Name of the interconnect attachment to patch.interconnectAttachmentResource
- Represents an Interconnect Attachment (VLAN) resource.
You can use Interconnect attachments (VLANS) to connect your Virtual Private Cloud networks to your on-premises networks through an Interconnect. For more information, read Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==)
fieldMask
- The fields that should be serialized (even if they have empty values). If the
containing message object has a non-null fieldmask, then all the fields in the field mask
(and only those fields in the field mask) will be serialized. If the containing object does
not have a fieldmask, then only non-empty fields will be serialized.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation patchInterconnectAttachment(String interconnectAttachment, InterconnectAttachment interconnectAttachmentResource, List<String> fieldMask)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
ProjectRegionInterconnectAttachmentName interconnectAttachment = ProjectRegionInterconnectAttachmentName.of("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
Operation response = interconnectAttachmentClient.patchInterconnectAttachment(interconnectAttachment.toString(), interconnectAttachmentResource, fieldMask);
}
interconnectAttachment
- Name of the interconnect attachment to patch.interconnectAttachmentResource
- Represents an Interconnect Attachment (VLAN) resource.
You can use Interconnect attachments (VLANS) to connect your Virtual Private Cloud networks to your on-premises networks through an Interconnect. For more information, read Creating VLAN Attachments. (== resource_for beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments ==)
fieldMask
- The fields that should be serialized (even if they have empty values). If the
containing message object has a non-null fieldmask, then all the fields in the field mask
(and only those fields in the field mask) will be serialized. If the containing object does
not have a fieldmask, then only non-empty fields will be serialized.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation patchInterconnectAttachment(PatchInterconnectAttachmentHttpRequest request)
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedInterconnectAttachment = ProjectRegionInterconnectAttachmentName.format("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
PatchInterconnectAttachmentHttpRequest request = PatchInterconnectAttachmentHttpRequest.newBuilder()
.setInterconnectAttachment(formattedInterconnectAttachment)
.setInterconnectAttachmentResource(interconnectAttachmentResource)
.addAllFieldMask(fieldMask)
.build();
Operation response = interconnectAttachmentClient.patchInterconnectAttachment(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<PatchInterconnectAttachmentHttpRequest,Operation> patchInterconnectAttachmentCallable()
Sample code:
try (InterconnectAttachmentClient interconnectAttachmentClient = InterconnectAttachmentClient.create()) {
String formattedInterconnectAttachment = ProjectRegionInterconnectAttachmentName.format("[PROJECT]", "[REGION]", "[INTERCONNECT_ATTACHMENT]");
InterconnectAttachment interconnectAttachmentResource = InterconnectAttachment.newBuilder().build();
List<String> fieldMask = new ArrayList<>();
PatchInterconnectAttachmentHttpRequest request = PatchInterconnectAttachmentHttpRequest.newBuilder()
.setInterconnectAttachment(formattedInterconnectAttachment)
.setInterconnectAttachmentResource(interconnectAttachmentResource)
.addAllFieldMask(fieldMask)
.build();
ApiFuture<Operation> future = interconnectAttachmentClient.patchInterconnectAttachmentCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.