| GitHub Repository | Product Reference |
Service Description: Network Connectivity Center is a hub-and-spoke abstraction for network connectivity management in Google Cloud. It reduces operational complexity through a simple, centralized connectivity management model.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
Hub response = hubServiceClient.getHub(name);
}
Note: close() needs to be called on the HubServiceClient 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 |
|---|---|---|
ListHubs |
Lists the Network Connectivity Center hubs associated with a given 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.
|
GetHub |
Gets details about a Network Connectivity Center hub. |
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.
|
CreateHub |
Creates a new Network Connectivity Center hub in the specified project. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateHub |
Updates the description and/or labels of a Network Connectivity Center hub. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteHub |
Deletes a Network Connectivity Center hub. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListHubSpokes |
Lists the Network Connectivity Center spokes associated with a specified hub and location. The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted. |
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.
|
QueryHubStatus |
Query the Private Service Connect propagation status of a Network Connectivity Center hub. |
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.
|
ListSpokes |
Lists the Network Connectivity Center spokes in a specified project and location. |
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.
|
GetSpoke |
Gets details about a Network Connectivity Center spoke. |
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.
|
CreateSpoke |
Creates a Network Connectivity Center spoke. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateSpoke |
Updates the parameters of a Network Connectivity Center spoke. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RejectHubSpoke |
Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was previously in the |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AcceptHubSpoke |
Accepts a proposal to attach a Network Connectivity Center spoke to a hub. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AcceptSpokeUpdate |
Accepts a proposal to update a Network Connectivity Center spoke in a hub. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RejectSpokeUpdate |
Rejects a proposal to update a Network Connectivity Center spoke in a hub. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteSpoke |
Deletes a Network Connectivity Center spoke. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRouteTable |
Gets details about a Network Connectivity Center route table. |
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.
|
GetRoute |
Gets details about the specified route. |
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.
|
ListRoutes |
Lists routes in a given route table. |
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.
|
ListRouteTables |
Lists route tables in a given hub. |
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.
|
GetGroup |
Gets details about a Network Connectivity Center group. |
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.
|
ListGroups |
Lists groups in a given hub. |
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.
|
UpdateGroup |
Updates the parameters of a Network Connectivity Center group. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateGatewayAdvertisedRoute |
Create a GatewayAdvertisedRoute |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetGatewayAdvertisedRoute |
Get a GatewayAdvertisedRoute |
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.
|
ListGatewayAdvertisedRoutes |
List GatewayAdvertisedRoutes |
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.
|
UpdateGatewayAdvertisedRoute |
Update a GatewayAdvertisedRoute |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteGatewayAdvertisedRoute |
Delete a GatewayAdvertisedRoute |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. This method lists locations based on the resource scope provided inthe ListLocationsRequest.name field: ***Global locations**: If For gRPC and client library implementations, the resource name ispassed as the |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
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 HubServiceSettings 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
HubServiceSettings hubServiceSettings =
HubServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
HubServiceClient hubServiceClient = HubServiceClient.create(hubServiceSettings);
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
HubServiceSettings hubServiceSettings =
HubServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
HubServiceClient hubServiceClient = HubServiceClient.create(hubServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final HubServiceClient create()Constructs an instance of HubServiceClient with default settings.
| Returns | |
|---|---|
| Type | Description |
HubServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(HubServiceSettings settings)
public static final HubServiceClient create(HubServiceSettings settings)Constructs an instance of HubServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
| Parameter | |
|---|---|
| Name | Description |
settings |
HubServiceSettings |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(HubServiceStub stub)
public static final HubServiceClient create(HubServiceStub stub)Constructs an instance of HubServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(HubServiceSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
HubServiceStub |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient |
|
Constructors
HubServiceClient(HubServiceSettings settings)
protected HubServiceClient(HubServiceSettings settings)Constructs an instance of HubServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
| Parameter | |
|---|---|
| Name | Description |
settings |
HubServiceSettings |
HubServiceClient(HubServiceStub stub)
protected HubServiceClient(HubServiceStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
HubServiceStub |
Methods
acceptHubSpokeAsync(@Nullable HubName name, @Nullable SpokeName spokeUri)
public final OperationFuture<AcceptHubSpokeResponse,OperationMetadata> acceptHubSpokeAsync(@Nullable HubName name, @Nullable SpokeName spokeUri)Accepts a proposal to attach a Network Connectivity Center spoke to a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
SpokeName spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
AcceptHubSpokeResponse response = hubServiceClient.acceptHubSpokeAsync(name, spokeUri).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub into which to accept the spoke. |
spokeUri |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The URI of the spoke to accept into the hub. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AcceptHubSpokeResponse,OperationMetadata> |
|
acceptHubSpokeAsync(@Nullable HubName name, String spokeUri)
public final OperationFuture<AcceptHubSpokeResponse,OperationMetadata> acceptHubSpokeAsync(@Nullable HubName name, String spokeUri)Accepts a proposal to attach a Network Connectivity Center spoke to a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
String spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
AcceptHubSpokeResponse response = hubServiceClient.acceptHubSpokeAsync(name, spokeUri).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub into which to accept the spoke. |
spokeUri |
StringRequired. The URI of the spoke to accept into the hub. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AcceptHubSpokeResponse,OperationMetadata> |
|
acceptHubSpokeAsync(AcceptHubSpokeRequest request)
public final OperationFuture<AcceptHubSpokeResponse,OperationMetadata> acceptHubSpokeAsync(AcceptHubSpokeRequest request)Accepts a proposal to attach a Network Connectivity Center spoke to a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
AcceptHubSpokeRequest request =
AcceptHubSpokeRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setRequestId("requestId693933066")
.build();
AcceptHubSpokeResponse response = hubServiceClient.acceptHubSpokeAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
AcceptHubSpokeRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AcceptHubSpokeResponse,OperationMetadata> |
|
acceptHubSpokeAsync(String name, @Nullable SpokeName spokeUri)
public final OperationFuture<AcceptHubSpokeResponse,OperationMetadata> acceptHubSpokeAsync(String name, @Nullable SpokeName spokeUri)Accepts a proposal to attach a Network Connectivity Center spoke to a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
SpokeName spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
AcceptHubSpokeResponse response = hubServiceClient.acceptHubSpokeAsync(name, spokeUri).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub into which to accept the spoke. |
spokeUri |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The URI of the spoke to accept into the hub. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AcceptHubSpokeResponse,OperationMetadata> |
|
acceptHubSpokeAsync(String name, String spokeUri)
public final OperationFuture<AcceptHubSpokeResponse,OperationMetadata> acceptHubSpokeAsync(String name, String spokeUri)Accepts a proposal to attach a Network Connectivity Center spoke to a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
String spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
AcceptHubSpokeResponse response = hubServiceClient.acceptHubSpokeAsync(name, spokeUri).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub into which to accept the spoke. |
spokeUri |
StringRequired. The URI of the spoke to accept into the hub. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AcceptHubSpokeResponse,OperationMetadata> |
|
acceptHubSpokeCallable()
public final UnaryCallable<AcceptHubSpokeRequest,Operation> acceptHubSpokeCallable()Accepts a proposal to attach a Network Connectivity Center spoke to a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
AcceptHubSpokeRequest request =
AcceptHubSpokeRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = hubServiceClient.acceptHubSpokeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<AcceptHubSpokeRequest,Operation> |
|
acceptHubSpokeOperationCallable()
public final OperationCallable<AcceptHubSpokeRequest,AcceptHubSpokeResponse,OperationMetadata> acceptHubSpokeOperationCallable()Accepts a proposal to attach a Network Connectivity Center spoke to a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
AcceptHubSpokeRequest request =
AcceptHubSpokeRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<AcceptHubSpokeResponse, OperationMetadata> future =
hubServiceClient.acceptHubSpokeOperationCallable().futureCall(request);
// Do something.
AcceptHubSpokeResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<AcceptHubSpokeRequest,AcceptHubSpokeResponse,OperationMetadata> |
|
acceptSpokeUpdateAsync(@Nullable HubName name, @Nullable SpokeName spokeUri, String spokeEtag)
public final OperationFuture<AcceptSpokeUpdateResponse,OperationMetadata> acceptSpokeUpdateAsync(@Nullable HubName name, @Nullable SpokeName spokeUri, String spokeEtag)Accepts a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
SpokeName spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
String spokeEtag = "spokeEtag-1185145407";
AcceptSpokeUpdateResponse response =
hubServiceClient.acceptSpokeUpdateAsync(name, spokeUri, spokeEtag).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub to accept spoke update. |
spokeUri |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The URI of the spoke to accept update. |
spokeEtag |
StringRequired. The etag of the spoke to accept update. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AcceptSpokeUpdateResponse,OperationMetadata> |
|
acceptSpokeUpdateAsync(@Nullable HubName name, String spokeUri, String spokeEtag)
public final OperationFuture<AcceptSpokeUpdateResponse,OperationMetadata> acceptSpokeUpdateAsync(@Nullable HubName name, String spokeUri, String spokeEtag)Accepts a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
String spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
String spokeEtag = "spokeEtag-1185145407";
AcceptSpokeUpdateResponse response =
hubServiceClient.acceptSpokeUpdateAsync(name, spokeUri, spokeEtag).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub to accept spoke update. |
spokeUri |
StringRequired. The URI of the spoke to accept update. |
spokeEtag |
StringRequired. The etag of the spoke to accept update. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AcceptSpokeUpdateResponse,OperationMetadata> |
|
acceptSpokeUpdateAsync(AcceptSpokeUpdateRequest request)
public final OperationFuture<AcceptSpokeUpdateResponse,OperationMetadata> acceptSpokeUpdateAsync(AcceptSpokeUpdateRequest request)Accepts a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
AcceptSpokeUpdateRequest request =
AcceptSpokeUpdateRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setSpokeEtag("spokeEtag-1185145407")
.setRequestId("requestId693933066")
.build();
AcceptSpokeUpdateResponse response = hubServiceClient.acceptSpokeUpdateAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
AcceptSpokeUpdateRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AcceptSpokeUpdateResponse,OperationMetadata> |
|
acceptSpokeUpdateAsync(String name, @Nullable SpokeName spokeUri, String spokeEtag)
public final OperationFuture<AcceptSpokeUpdateResponse,OperationMetadata> acceptSpokeUpdateAsync(String name, @Nullable SpokeName spokeUri, String spokeEtag)Accepts a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
SpokeName spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
String spokeEtag = "spokeEtag-1185145407";
AcceptSpokeUpdateResponse response =
hubServiceClient.acceptSpokeUpdateAsync(name, spokeUri, spokeEtag).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub to accept spoke update. |
spokeUri |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The URI of the spoke to accept update. |
spokeEtag |
StringRequired. The etag of the spoke to accept update. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AcceptSpokeUpdateResponse,OperationMetadata> |
|
acceptSpokeUpdateAsync(String name, String spokeUri, String spokeEtag)
public final OperationFuture<AcceptSpokeUpdateResponse,OperationMetadata> acceptSpokeUpdateAsync(String name, String spokeUri, String spokeEtag)Accepts a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
String spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
String spokeEtag = "spokeEtag-1185145407";
AcceptSpokeUpdateResponse response =
hubServiceClient.acceptSpokeUpdateAsync(name, spokeUri, spokeEtag).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub to accept spoke update. |
spokeUri |
StringRequired. The URI of the spoke to accept update. |
spokeEtag |
StringRequired. The etag of the spoke to accept update. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AcceptSpokeUpdateResponse,OperationMetadata> |
|
acceptSpokeUpdateCallable()
public final UnaryCallable<AcceptSpokeUpdateRequest,Operation> acceptSpokeUpdateCallable()Accepts a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
AcceptSpokeUpdateRequest request =
AcceptSpokeUpdateRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setSpokeEtag("spokeEtag-1185145407")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
hubServiceClient.acceptSpokeUpdateCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<AcceptSpokeUpdateRequest,Operation> |
|
acceptSpokeUpdateOperationCallable()
public final OperationCallable<AcceptSpokeUpdateRequest,AcceptSpokeUpdateResponse,OperationMetadata> acceptSpokeUpdateOperationCallable()Accepts a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
AcceptSpokeUpdateRequest request =
AcceptSpokeUpdateRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setSpokeEtag("spokeEtag-1185145407")
.setRequestId("requestId693933066")
.build();
OperationFuture<AcceptSpokeUpdateResponse, OperationMetadata> future =
hubServiceClient.acceptSpokeUpdateOperationCallable().futureCall(request);
// Do something.
AcceptSpokeUpdateResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<AcceptSpokeUpdateRequest,AcceptSpokeUpdateResponse,OperationMetadata> |
|
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
public final void close()createGatewayAdvertisedRouteAsync(@Nullable SpokeName parent, GatewayAdvertisedRoute gatewayAdvertisedRoute, String gatewayAdvertisedRouteId)
public final OperationFuture<GatewayAdvertisedRoute,OperationMetadata> createGatewayAdvertisedRouteAsync(@Nullable SpokeName parent, GatewayAdvertisedRoute gatewayAdvertisedRoute, String gatewayAdvertisedRouteId)Create a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
SpokeName parent = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
GatewayAdvertisedRoute gatewayAdvertisedRoute = GatewayAdvertisedRoute.newBuilder().build();
String gatewayAdvertisedRouteId = "gatewayAdvertisedRouteId1531070339";
GatewayAdvertisedRoute response =
hubServiceClient
.createGatewayAdvertisedRouteAsync(
parent, gatewayAdvertisedRoute, gatewayAdvertisedRouteId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The parent resource. |
gatewayAdvertisedRoute |
GatewayAdvertisedRouteRequired. Initial values for the new gateway advertised route. |
gatewayAdvertisedRouteId |
StringRequired. Unique id for the route to create. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<GatewayAdvertisedRoute,OperationMetadata> |
|
createGatewayAdvertisedRouteAsync(CreateGatewayAdvertisedRouteRequest request)
public final OperationFuture<GatewayAdvertisedRoute,OperationMetadata> createGatewayAdvertisedRouteAsync(CreateGatewayAdvertisedRouteRequest request)Create a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
CreateGatewayAdvertisedRouteRequest request =
CreateGatewayAdvertisedRouteRequest.newBuilder()
.setParent(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setGatewayAdvertisedRouteId("gatewayAdvertisedRouteId1531070339")
.setGatewayAdvertisedRoute(GatewayAdvertisedRoute.newBuilder().build())
.setRequestId("requestId693933066")
.build();
GatewayAdvertisedRoute response =
hubServiceClient.createGatewayAdvertisedRouteAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateGatewayAdvertisedRouteRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<GatewayAdvertisedRoute,OperationMetadata> |
|
createGatewayAdvertisedRouteAsync(String parent, GatewayAdvertisedRoute gatewayAdvertisedRoute, String gatewayAdvertisedRouteId)
public final OperationFuture<GatewayAdvertisedRoute,OperationMetadata> createGatewayAdvertisedRouteAsync(String parent, GatewayAdvertisedRoute gatewayAdvertisedRoute, String gatewayAdvertisedRouteId)Create a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String parent = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
GatewayAdvertisedRoute gatewayAdvertisedRoute = GatewayAdvertisedRoute.newBuilder().build();
String gatewayAdvertisedRouteId = "gatewayAdvertisedRouteId1531070339";
GatewayAdvertisedRoute response =
hubServiceClient
.createGatewayAdvertisedRouteAsync(
parent, gatewayAdvertisedRoute, gatewayAdvertisedRouteId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource. |
gatewayAdvertisedRoute |
GatewayAdvertisedRouteRequired. Initial values for the new gateway advertised route. |
gatewayAdvertisedRouteId |
StringRequired. Unique id for the route to create. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<GatewayAdvertisedRoute,OperationMetadata> |
|
createGatewayAdvertisedRouteCallable()
public final UnaryCallable<CreateGatewayAdvertisedRouteRequest,Operation> createGatewayAdvertisedRouteCallable()Create a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
CreateGatewayAdvertisedRouteRequest request =
CreateGatewayAdvertisedRouteRequest.newBuilder()
.setParent(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setGatewayAdvertisedRouteId("gatewayAdvertisedRouteId1531070339")
.setGatewayAdvertisedRoute(GatewayAdvertisedRoute.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
hubServiceClient.createGatewayAdvertisedRouteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateGatewayAdvertisedRouteRequest,Operation> |
|
createGatewayAdvertisedRouteOperationCallable()
public final OperationCallable<CreateGatewayAdvertisedRouteRequest,GatewayAdvertisedRoute,OperationMetadata> createGatewayAdvertisedRouteOperationCallable()Create a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
CreateGatewayAdvertisedRouteRequest request =
CreateGatewayAdvertisedRouteRequest.newBuilder()
.setParent(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setGatewayAdvertisedRouteId("gatewayAdvertisedRouteId1531070339")
.setGatewayAdvertisedRoute(GatewayAdvertisedRoute.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<GatewayAdvertisedRoute, OperationMetadata> future =
hubServiceClient.createGatewayAdvertisedRouteOperationCallable().futureCall(request);
// Do something.
GatewayAdvertisedRoute response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateGatewayAdvertisedRouteRequest,GatewayAdvertisedRoute,OperationMetadata> |
|
createHubAsync(@Nullable LocationName parent, Hub hub, String hubId)
public final OperationFuture<Hub,OperationMetadata> createHubAsync(@Nullable LocationName parent, Hub hub, String hubId)Creates a new Network Connectivity Center hub in the specified 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Hub hub = Hub.newBuilder().build();
String hubId = "hubId99628272";
Hub response = hubServiceClient.createHubAsync(parent, hub, hubId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.LocationNameRequired. The parent resource. |
hub |
HubRequired. The initial values for a new hub. |
hubId |
StringRequired. A unique identifier for the hub. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Hub,OperationMetadata> |
|
createHubAsync(CreateHubRequest request)
public final OperationFuture<Hub,OperationMetadata> createHubAsync(CreateHubRequest request)Creates a new Network Connectivity Center hub in the specified 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
CreateHubRequest request =
CreateHubRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setHubId("hubId99628272")
.setHub(Hub.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Hub response = hubServiceClient.createHubAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateHubRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Hub,OperationMetadata> |
|
createHubAsync(String parent, Hub hub, String hubId)
public final OperationFuture<Hub,OperationMetadata> createHubAsync(String parent, Hub hub, String hubId)Creates a new Network Connectivity Center hub in the specified 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Hub hub = Hub.newBuilder().build();
String hubId = "hubId99628272";
Hub response = hubServiceClient.createHubAsync(parent, hub, hubId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource. |
hub |
HubRequired. The initial values for a new hub. |
hubId |
StringRequired. A unique identifier for the hub. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Hub,OperationMetadata> |
|
createHubCallable()
public final UnaryCallable<CreateHubRequest,Operation> createHubCallable()Creates a new Network Connectivity Center hub in the specified 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
CreateHubRequest request =
CreateHubRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setHubId("hubId99628272")
.setHub(Hub.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = hubServiceClient.createHubCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateHubRequest,Operation> |
|
createHubOperationCallable()
public final OperationCallable<CreateHubRequest,Hub,OperationMetadata> createHubOperationCallable()Creates a new Network Connectivity Center hub in the specified 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
CreateHubRequest request =
CreateHubRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setHubId("hubId99628272")
.setHub(Hub.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Hub, OperationMetadata> future =
hubServiceClient.createHubOperationCallable().futureCall(request);
// Do something.
Hub response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateHubRequest,Hub,OperationMetadata> |
|
createSpokeAsync(@Nullable LocationName parent, Spoke spoke, String spokeId)
public final OperationFuture<Spoke,OperationMetadata> createSpokeAsync(@Nullable LocationName parent, Spoke spoke, String spokeId)Creates a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Spoke spoke = Spoke.newBuilder().build();
String spokeId = "spokeId-1998996281";
Spoke response = hubServiceClient.createSpokeAsync(parent, spoke, spokeId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.LocationNameRequired. The parent resource. |
spoke |
SpokeRequired. The initial values for a new spoke. |
spokeId |
StringRequired. Unique id for the spoke to create. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Spoke,OperationMetadata> |
|
createSpokeAsync(CreateSpokeRequest request)
public final OperationFuture<Spoke,OperationMetadata> createSpokeAsync(CreateSpokeRequest request)Creates a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
CreateSpokeRequest request =
CreateSpokeRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setSpokeId("spokeId-1998996281")
.setSpoke(Spoke.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Spoke response = hubServiceClient.createSpokeAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateSpokeRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Spoke,OperationMetadata> |
|
createSpokeAsync(String parent, Spoke spoke, String spokeId)
public final OperationFuture<Spoke,OperationMetadata> createSpokeAsync(String parent, Spoke spoke, String spokeId)Creates a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Spoke spoke = Spoke.newBuilder().build();
String spokeId = "spokeId-1998996281";
Spoke response = hubServiceClient.createSpokeAsync(parent, spoke, spokeId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource. |
spoke |
SpokeRequired. The initial values for a new spoke. |
spokeId |
StringRequired. Unique id for the spoke to create. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Spoke,OperationMetadata> |
|
createSpokeCallable()
public final UnaryCallable<CreateSpokeRequest,Operation> createSpokeCallable()Creates a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
CreateSpokeRequest request =
CreateSpokeRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setSpokeId("spokeId-1998996281")
.setSpoke(Spoke.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = hubServiceClient.createSpokeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateSpokeRequest,Operation> |
|
createSpokeOperationCallable()
public final OperationCallable<CreateSpokeRequest,Spoke,OperationMetadata> createSpokeOperationCallable()Creates a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
CreateSpokeRequest request =
CreateSpokeRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setSpokeId("spokeId-1998996281")
.setSpoke(Spoke.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Spoke, OperationMetadata> future =
hubServiceClient.createSpokeOperationCallable().futureCall(request);
// Do something.
Spoke response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateSpokeRequest,Spoke,OperationMetadata> |
|
deleteGatewayAdvertisedRouteAsync(@Nullable GatewayAdvertisedRouteName name)
public final OperationFuture<Empty,OperationMetadata> deleteGatewayAdvertisedRouteAsync(@Nullable GatewayAdvertisedRouteName name)Delete a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GatewayAdvertisedRouteName name =
GatewayAdvertisedRouteName.of(
"[PROJECT]", "[LOCATION]", "[SPOKE]", "[GATEWAY_ADVERTISED_ROUTE]");
hubServiceClient.deleteGatewayAdvertisedRouteAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.GatewayAdvertisedRouteNameRequired. The name of the gateway advertised route to delete. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteGatewayAdvertisedRouteAsync(DeleteGatewayAdvertisedRouteRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteGatewayAdvertisedRouteAsync(DeleteGatewayAdvertisedRouteRequest request)Delete a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
DeleteGatewayAdvertisedRouteRequest request =
DeleteGatewayAdvertisedRouteRequest.newBuilder()
.setName(
GatewayAdvertisedRouteName.of(
"[PROJECT]", "[LOCATION]", "[SPOKE]", "[GATEWAY_ADVERTISED_ROUTE]")
.toString())
.setRequestId("requestId693933066")
.build();
hubServiceClient.deleteGatewayAdvertisedRouteAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteGatewayAdvertisedRouteRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteGatewayAdvertisedRouteAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deleteGatewayAdvertisedRouteAsync(String name)Delete a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name =
GatewayAdvertisedRouteName.of(
"[PROJECT]", "[LOCATION]", "[SPOKE]", "[GATEWAY_ADVERTISED_ROUTE]")
.toString();
hubServiceClient.deleteGatewayAdvertisedRouteAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the gateway advertised route to delete. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteGatewayAdvertisedRouteCallable()
public final UnaryCallable<DeleteGatewayAdvertisedRouteRequest,Operation> deleteGatewayAdvertisedRouteCallable()Delete a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
DeleteGatewayAdvertisedRouteRequest request =
DeleteGatewayAdvertisedRouteRequest.newBuilder()
.setName(
GatewayAdvertisedRouteName.of(
"[PROJECT]", "[LOCATION]", "[SPOKE]", "[GATEWAY_ADVERTISED_ROUTE]")
.toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
hubServiceClient.deleteGatewayAdvertisedRouteCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteGatewayAdvertisedRouteRequest,Operation> |
|
deleteGatewayAdvertisedRouteOperationCallable()
public final OperationCallable<DeleteGatewayAdvertisedRouteRequest,Empty,OperationMetadata> deleteGatewayAdvertisedRouteOperationCallable()Delete a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
DeleteGatewayAdvertisedRouteRequest request =
DeleteGatewayAdvertisedRouteRequest.newBuilder()
.setName(
GatewayAdvertisedRouteName.of(
"[PROJECT]", "[LOCATION]", "[SPOKE]", "[GATEWAY_ADVERTISED_ROUTE]")
.toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
hubServiceClient.deleteGatewayAdvertisedRouteOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteGatewayAdvertisedRouteRequest,Empty,OperationMetadata> |
|
deleteHubAsync(@Nullable HubName name)
public final OperationFuture<Empty,OperationMetadata> deleteHubAsync(@Nullable HubName name)Deletes a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
hubServiceClient.deleteHubAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub to delete. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteHubAsync(DeleteHubRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteHubAsync(DeleteHubRequest request)Deletes a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
DeleteHubRequest request =
DeleteHubRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setRequestId("requestId693933066")
.build();
hubServiceClient.deleteHubAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteHubRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteHubAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deleteHubAsync(String name)Deletes a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
hubServiceClient.deleteHubAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub to delete. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteHubCallable()
public final UnaryCallable<DeleteHubRequest,Operation> deleteHubCallable()Deletes a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
DeleteHubRequest request =
DeleteHubRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = hubServiceClient.deleteHubCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteHubRequest,Operation> |
|
deleteHubOperationCallable()
public final OperationCallable<DeleteHubRequest,Empty,OperationMetadata> deleteHubOperationCallable()Deletes a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
DeleteHubRequest request =
DeleteHubRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
hubServiceClient.deleteHubOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteHubRequest,Empty,OperationMetadata> |
|
deleteSpokeAsync(@Nullable SpokeName name)
public final OperationFuture<Empty,OperationMetadata> deleteSpokeAsync(@Nullable SpokeName name)Deletes a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
hubServiceClient.deleteSpokeAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The name of the spoke to delete. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteSpokeAsync(DeleteSpokeRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteSpokeAsync(DeleteSpokeRequest request)Deletes a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
DeleteSpokeRequest request =
DeleteSpokeRequest.newBuilder()
.setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setRequestId("requestId693933066")
.build();
hubServiceClient.deleteSpokeAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteSpokeRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteSpokeAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deleteSpokeAsync(String name)Deletes a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
hubServiceClient.deleteSpokeAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the spoke to delete. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteSpokeCallable()
public final UnaryCallable<DeleteSpokeRequest,Operation> deleteSpokeCallable()Deletes a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
DeleteSpokeRequest request =
DeleteSpokeRequest.newBuilder()
.setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = hubServiceClient.deleteSpokeCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteSpokeRequest,Operation> |
|
deleteSpokeOperationCallable()
public final OperationCallable<DeleteSpokeRequest,Empty,OperationMetadata> deleteSpokeOperationCallable()Deletes a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
DeleteSpokeRequest request =
DeleteSpokeRequest.newBuilder()
.setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setRequestId("requestId693933066")
.build();
OperationFuture<Empty, OperationMetadata> future =
hubServiceClient.deleteSpokeOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteSpokeRequest,Empty,OperationMetadata> |
|
getGatewayAdvertisedRoute(@Nullable GatewayAdvertisedRouteName name)
public final GatewayAdvertisedRoute getGatewayAdvertisedRoute(@Nullable GatewayAdvertisedRouteName name)Get a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GatewayAdvertisedRouteName name =
GatewayAdvertisedRouteName.of(
"[PROJECT]", "[LOCATION]", "[SPOKE]", "[GATEWAY_ADVERTISED_ROUTE]");
GatewayAdvertisedRoute response = hubServiceClient.getGatewayAdvertisedRoute(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.GatewayAdvertisedRouteNameRequired. The name of the gateway advertised route to get. |
| Returns | |
|---|---|
| Type | Description |
GatewayAdvertisedRoute |
|
getGatewayAdvertisedRoute(GetGatewayAdvertisedRouteRequest request)
public final GatewayAdvertisedRoute getGatewayAdvertisedRoute(GetGatewayAdvertisedRouteRequest request)Get a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetGatewayAdvertisedRouteRequest request =
GetGatewayAdvertisedRouteRequest.newBuilder()
.setName(
GatewayAdvertisedRouteName.of(
"[PROJECT]", "[LOCATION]", "[SPOKE]", "[GATEWAY_ADVERTISED_ROUTE]")
.toString())
.build();
GatewayAdvertisedRoute response = hubServiceClient.getGatewayAdvertisedRoute(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetGatewayAdvertisedRouteRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
GatewayAdvertisedRoute |
|
getGatewayAdvertisedRoute(String name)
public final GatewayAdvertisedRoute getGatewayAdvertisedRoute(String name)Get a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name =
GatewayAdvertisedRouteName.of(
"[PROJECT]", "[LOCATION]", "[SPOKE]", "[GATEWAY_ADVERTISED_ROUTE]")
.toString();
GatewayAdvertisedRoute response = hubServiceClient.getGatewayAdvertisedRoute(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the gateway advertised route to get. |
| Returns | |
|---|---|
| Type | Description |
GatewayAdvertisedRoute |
|
getGatewayAdvertisedRouteCallable()
public final UnaryCallable<GetGatewayAdvertisedRouteRequest,GatewayAdvertisedRoute> getGatewayAdvertisedRouteCallable()Get a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetGatewayAdvertisedRouteRequest request =
GetGatewayAdvertisedRouteRequest.newBuilder()
.setName(
GatewayAdvertisedRouteName.of(
"[PROJECT]", "[LOCATION]", "[SPOKE]", "[GATEWAY_ADVERTISED_ROUTE]")
.toString())
.build();
ApiFuture<GatewayAdvertisedRoute> future =
hubServiceClient.getGatewayAdvertisedRouteCallable().futureCall(request);
// Do something.
GatewayAdvertisedRoute response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetGatewayAdvertisedRouteRequest,GatewayAdvertisedRoute> |
|
getGroup(@Nullable GroupName name)
public final Group getGroup(@Nullable GroupName name)Gets details about a Network Connectivity Center group.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GroupName name = GroupName.of("[PROJECT]", "[HUB]", "[GROUP]");
Group response = hubServiceClient.getGroup(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.GroupNameRequired. The name of the route table resource. |
| Returns | |
|---|---|
| Type | Description |
Group |
|
getGroup(GetGroupRequest request)
public final Group getGroup(GetGroupRequest request)Gets details about a Network Connectivity Center group.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetGroupRequest request =
GetGroupRequest.newBuilder()
.setName(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
.build();
Group response = hubServiceClient.getGroup(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Group |
|
getGroup(String name)
public final Group getGroup(String name)Gets details about a Network Connectivity Center group.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString();
Group response = hubServiceClient.getGroup(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the route table resource. |
| Returns | |
|---|---|
| Type | Description |
Group |
|
getGroupCallable()
public final UnaryCallable<GetGroupRequest,Group> getGroupCallable()Gets details about a Network Connectivity Center group.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetGroupRequest request =
GetGroupRequest.newBuilder()
.setName(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
.build();
ApiFuture<Group> future = hubServiceClient.getGroupCallable().futureCall(request);
// Do something.
Group response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetGroupRequest,Group> |
|
getHub(@Nullable HubName name)
public final Hub getHub(@Nullable HubName name)Gets details about a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
Hub response = hubServiceClient.getHub(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub resource to get. |
| Returns | |
|---|---|
| Type | Description |
Hub |
|
getHub(GetHubRequest request)
public final Hub getHub(GetHubRequest request)Gets details about a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetHubRequest request =
GetHubRequest.newBuilder().setName(HubName.of("[PROJECT]", "[HUB]").toString()).build();
Hub response = hubServiceClient.getHub(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetHubRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Hub |
|
getHub(String name)
public final Hub getHub(String name)Gets details about a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
Hub response = hubServiceClient.getHub(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub resource to get. |
| Returns | |
|---|---|
| Type | Description |
Hub |
|
getHubCallable()
public final UnaryCallable<GetHubRequest,Hub> getHubCallable()Gets details about a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetHubRequest request =
GetHubRequest.newBuilder().setName(HubName.of("[PROJECT]", "[HUB]").toString()).build();
ApiFuture<Hub> future = hubServiceClient.getHubCallable().futureCall(request);
// Do something.
Hub response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetHubRequest,Hub> |
|
getIamPolicy(GetIamPolicyRequest request)
public final Policy getIamPolicy(GetIamPolicyRequest request)Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = hubServiceClient.getIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.GetIamPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.Policy |
|
getIamPolicyCallable()
public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = hubServiceClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
|
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = hubServiceClient.getLocation(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.GetLocationRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.cloud.location.Location |
|
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = hubServiceClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
|
getOperationsClient()
public final OperationsClient getOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
| Returns | |
|---|---|
| Type | Description |
OperationsClient |
|
getRoute(@Nullable HubRouteName name)
public final Route getRoute(@Nullable HubRouteName name)Gets details about the specified route.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubRouteName name = HubRouteName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]", "[ROUTE]");
Route response = hubServiceClient.getRoute(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubRouteNameRequired. The name of the route resource. |
| Returns | |
|---|---|
| Type | Description |
Route |
|
getRoute(GetRouteRequest request)
public final Route getRoute(GetRouteRequest request)Gets details about the specified route.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetRouteRequest request =
GetRouteRequest.newBuilder()
.setName(HubRouteName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]", "[ROUTE]").toString())
.build();
Route response = hubServiceClient.getRoute(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetRouteRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Route |
|
getRoute(String name)
public final Route getRoute(String name)Gets details about the specified route.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubRouteName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]", "[ROUTE]").toString();
Route response = hubServiceClient.getRoute(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the route resource. |
| Returns | |
|---|---|
| Type | Description |
Route |
|
getRouteCallable()
public final UnaryCallable<GetRouteRequest,Route> getRouteCallable()Gets details about the specified route.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetRouteRequest request =
GetRouteRequest.newBuilder()
.setName(HubRouteName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]", "[ROUTE]").toString())
.build();
ApiFuture<Route> future = hubServiceClient.getRouteCallable().futureCall(request);
// Do something.
Route response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetRouteRequest,Route> |
|
getRouteTable(@Nullable RouteTableName name)
public final RouteTable getRouteTable(@Nullable RouteTableName name)Gets details about a Network Connectivity Center route table.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
RouteTableName name = RouteTableName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]");
RouteTable response = hubServiceClient.getRouteTable(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.RouteTableNameRequired. The name of the route table resource. |
| Returns | |
|---|---|
| Type | Description |
RouteTable |
|
getRouteTable(GetRouteTableRequest request)
public final RouteTable getRouteTable(GetRouteTableRequest request)Gets details about a Network Connectivity Center route table.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetRouteTableRequest request =
GetRouteTableRequest.newBuilder()
.setName(RouteTableName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]").toString())
.build();
RouteTable response = hubServiceClient.getRouteTable(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetRouteTableRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
RouteTable |
|
getRouteTable(String name)
public final RouteTable getRouteTable(String name)Gets details about a Network Connectivity Center route table.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = RouteTableName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]").toString();
RouteTable response = hubServiceClient.getRouteTable(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the route table resource. |
| Returns | |
|---|---|
| Type | Description |
RouteTable |
|
getRouteTableCallable()
public final UnaryCallable<GetRouteTableRequest,RouteTable> getRouteTableCallable()Gets details about a Network Connectivity Center route table.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetRouteTableRequest request =
GetRouteTableRequest.newBuilder()
.setName(RouteTableName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]").toString())
.build();
ApiFuture<RouteTable> future = hubServiceClient.getRouteTableCallable().futureCall(request);
// Do something.
RouteTable response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetRouteTableRequest,RouteTable> |
|
getSettings()
public final @Nullable HubServiceSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubServiceSettings |
|
getSpoke(@Nullable SpokeName name)
public final Spoke getSpoke(@Nullable SpokeName name)Gets details about a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
SpokeName name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
Spoke response = hubServiceClient.getSpoke(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The name of the spoke resource. |
| Returns | |
|---|---|
| Type | Description |
Spoke |
|
getSpoke(GetSpokeRequest request)
public final Spoke getSpoke(GetSpokeRequest request)Gets details about a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetSpokeRequest request =
GetSpokeRequest.newBuilder()
.setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.build();
Spoke response = hubServiceClient.getSpoke(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetSpokeRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Spoke |
|
getSpoke(String name)
public final Spoke getSpoke(String name)Gets details about a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
Spoke response = hubServiceClient.getSpoke(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the spoke resource. |
| Returns | |
|---|---|
| Type | Description |
Spoke |
|
getSpokeCallable()
public final UnaryCallable<GetSpokeRequest,Spoke> getSpokeCallable()Gets details about a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GetSpokeRequest request =
GetSpokeRequest.newBuilder()
.setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.build();
ApiFuture<Spoke> future = hubServiceClient.getSpokeCallable().futureCall(request);
// Do something.
Spoke response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetSpokeRequest,Spoke> |
|
getStub()
public HubServiceStub getStub()| Returns | |
|---|---|
| Type | Description |
HubServiceStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listGatewayAdvertisedRoutes(@Nullable SpokeName parent)
public final HubServiceClient.ListGatewayAdvertisedRoutesPagedResponse listGatewayAdvertisedRoutes(@Nullable SpokeName parent)List GatewayAdvertisedRoutes
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
SpokeName parent = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
for (GatewayAdvertisedRoute element :
hubServiceClient.listGatewayAdvertisedRoutes(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The parent resource's name. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListGatewayAdvertisedRoutesPagedResponse |
|
listGatewayAdvertisedRoutes(ListGatewayAdvertisedRoutesRequest request)
public final HubServiceClient.ListGatewayAdvertisedRoutesPagedResponse listGatewayAdvertisedRoutes(ListGatewayAdvertisedRoutesRequest request)List GatewayAdvertisedRoutes
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListGatewayAdvertisedRoutesRequest request =
ListGatewayAdvertisedRoutesRequest.newBuilder()
.setParent(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (GatewayAdvertisedRoute element :
hubServiceClient.listGatewayAdvertisedRoutes(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListGatewayAdvertisedRoutesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListGatewayAdvertisedRoutesPagedResponse |
|
listGatewayAdvertisedRoutes(String parent)
public final HubServiceClient.ListGatewayAdvertisedRoutesPagedResponse listGatewayAdvertisedRoutes(String parent)List GatewayAdvertisedRoutes
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String parent = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
for (GatewayAdvertisedRoute element :
hubServiceClient.listGatewayAdvertisedRoutes(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource's name. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListGatewayAdvertisedRoutesPagedResponse |
|
listGatewayAdvertisedRoutesCallable()
public final UnaryCallable<ListGatewayAdvertisedRoutesRequest,ListGatewayAdvertisedRoutesResponse> listGatewayAdvertisedRoutesCallable()List GatewayAdvertisedRoutes
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListGatewayAdvertisedRoutesRequest request =
ListGatewayAdvertisedRoutesRequest.newBuilder()
.setParent(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListGatewayAdvertisedRoutesResponse response =
hubServiceClient.listGatewayAdvertisedRoutesCallable().call(request);
for (GatewayAdvertisedRoute element : response.getGatewayAdvertisedRoutesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListGatewayAdvertisedRoutesRequest,ListGatewayAdvertisedRoutesResponse> |
|
listGatewayAdvertisedRoutesPagedCallable()
public final UnaryCallable<ListGatewayAdvertisedRoutesRequest,HubServiceClient.ListGatewayAdvertisedRoutesPagedResponse> listGatewayAdvertisedRoutesPagedCallable()List GatewayAdvertisedRoutes
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListGatewayAdvertisedRoutesRequest request =
ListGatewayAdvertisedRoutesRequest.newBuilder()
.setParent(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<GatewayAdvertisedRoute> future =
hubServiceClient.listGatewayAdvertisedRoutesPagedCallable().futureCall(request);
// Do something.
for (GatewayAdvertisedRoute element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListGatewayAdvertisedRoutesRequest,ListGatewayAdvertisedRoutesPagedResponse> |
|
listGroups(@Nullable HubName parent)
public final HubServiceClient.ListGroupsPagedResponse listGroups(@Nullable HubName parent)Lists groups in a given hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName parent = HubName.of("[PROJECT]", "[HUB]");
for (Group element : hubServiceClient.listGroups(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The parent resource's name. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListGroupsPagedResponse |
|
listGroups(ListGroupsRequest request)
public final HubServiceClient.ListGroupsPagedResponse listGroups(ListGroupsRequest request)Lists groups in a given hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListGroupsRequest request =
ListGroupsRequest.newBuilder()
.setParent(HubName.of("[PROJECT]", "[HUB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Group element : hubServiceClient.listGroups(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListGroupsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListGroupsPagedResponse |
|
listGroups(String parent)
public final HubServiceClient.ListGroupsPagedResponse listGroups(String parent)Lists groups in a given hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String parent = HubName.of("[PROJECT]", "[HUB]").toString();
for (Group element : hubServiceClient.listGroups(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource's name. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListGroupsPagedResponse |
|
listGroupsCallable()
public final UnaryCallable<ListGroupsRequest,ListGroupsResponse> listGroupsCallable()Lists groups in a given hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListGroupsRequest request =
ListGroupsRequest.newBuilder()
.setParent(HubName.of("[PROJECT]", "[HUB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListGroupsResponse response = hubServiceClient.listGroupsCallable().call(request);
for (Group element : response.getGroupsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListGroupsRequest,ListGroupsResponse> |
|
listGroupsPagedCallable()
public final UnaryCallable<ListGroupsRequest,HubServiceClient.ListGroupsPagedResponse> listGroupsPagedCallable()Lists groups in a given hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListGroupsRequest request =
ListGroupsRequest.newBuilder()
.setParent(HubName.of("[PROJECT]", "[HUB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Group> future = hubServiceClient.listGroupsPagedCallable().futureCall(request);
// Do something.
for (Group element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListGroupsRequest,ListGroupsPagedResponse> |
|
listHubSpokes(@Nullable HubName name)
public final HubServiceClient.ListHubSpokesPagedResponse listHubSpokes(@Nullable HubName name)Lists the Network Connectivity Center spokes associated with a specified hub and location. The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
for (Spoke element : hubServiceClient.listHubSpokes(name).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListHubSpokesPagedResponse |
|
listHubSpokes(ListHubSpokesRequest request)
public final HubServiceClient.ListHubSpokesPagedResponse listHubSpokes(ListHubSpokesRequest request)Lists the Network Connectivity Center spokes associated with a specified hub and location. The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListHubSpokesRequest request =
ListHubSpokesRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.addAllSpokeLocations(new ArrayList<String>())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Spoke element : hubServiceClient.listHubSpokes(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListHubSpokesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListHubSpokesPagedResponse |
|
listHubSpokes(String name)
public final HubServiceClient.ListHubSpokesPagedResponse listHubSpokes(String name)Lists the Network Connectivity Center spokes associated with a specified hub and location. The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
for (Spoke element : hubServiceClient.listHubSpokes(name).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListHubSpokesPagedResponse |
|
listHubSpokesCallable()
public final UnaryCallable<ListHubSpokesRequest,ListHubSpokesResponse> listHubSpokesCallable()Lists the Network Connectivity Center spokes associated with a specified hub and location. The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListHubSpokesRequest request =
ListHubSpokesRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.addAllSpokeLocations(new ArrayList<String>())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListHubSpokesResponse response = hubServiceClient.listHubSpokesCallable().call(request);
for (Spoke element : response.getSpokesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListHubSpokesRequest,ListHubSpokesResponse> |
|
listHubSpokesPagedCallable()
public final UnaryCallable<ListHubSpokesRequest,HubServiceClient.ListHubSpokesPagedResponse> listHubSpokesPagedCallable()Lists the Network Connectivity Center spokes associated with a specified hub and location. The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListHubSpokesRequest request =
ListHubSpokesRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.addAllSpokeLocations(new ArrayList<String>())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Spoke> future = hubServiceClient.listHubSpokesPagedCallable().futureCall(request);
// Do something.
for (Spoke element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListHubSpokesRequest,ListHubSpokesPagedResponse> |
|
listHubs(@Nullable LocationName parent)
public final HubServiceClient.ListHubsPagedResponse listHubs(@Nullable LocationName parent)Lists the Network Connectivity Center hubs associated with a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Hub element : hubServiceClient.listHubs(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.LocationNameRequired. The parent resource's name. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListHubsPagedResponse |
|
listHubs(ListHubsRequest request)
public final HubServiceClient.ListHubsPagedResponse listHubs(ListHubsRequest request)Lists the Network Connectivity Center hubs associated with a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListHubsRequest request =
ListHubsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Hub element : hubServiceClient.listHubs(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListHubsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListHubsPagedResponse |
|
listHubs(String parent)
public final HubServiceClient.ListHubsPagedResponse listHubs(String parent)Lists the Network Connectivity Center hubs associated with a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Hub element : hubServiceClient.listHubs(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource's name. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListHubsPagedResponse |
|
listHubsCallable()
public final UnaryCallable<ListHubsRequest,ListHubsResponse> listHubsCallable()Lists the Network Connectivity Center hubs associated with a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListHubsRequest request =
ListHubsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListHubsResponse response = hubServiceClient.listHubsCallable().call(request);
for (Hub element : response.getHubsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListHubsRequest,ListHubsResponse> |
|
listHubsPagedCallable()
public final UnaryCallable<ListHubsRequest,HubServiceClient.ListHubsPagedResponse> listHubsPagedCallable()Lists the Network Connectivity Center hubs associated with a given 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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListHubsRequest request =
ListHubsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Hub> future = hubServiceClient.listHubsPagedCallable().futureCall(request);
// Do something.
for (Hub element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListHubsRequest,ListHubsPagedResponse> |
|
listLocations(ListLocationsRequest request)
public final HubServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)Lists information about the supported locations for this service.
This method lists locations based on the resource scope provided inthe
ListLocationsRequest.name field:
***Global locations**: If name is empty, the method lists thepublic
locations available to all projects. * **Project-specificlocations**: If
name follows the formatprojects/{project}, the method lists locations visible to
thatspecific project. This includes public, private, or otherproject-specific locations enabled
for the project.
For gRPC and client library implementations, the resource name ispassed as the name field.
For direct service calls, the resourcename isincorporated into the request path based on the
specific serviceimplementation and version.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : hubServiceClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.ListLocationsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListLocationsPagedResponse |
|
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()Lists information about the supported locations for this service.
This method lists locations based on the resource scope provided inthe
ListLocationsRequest.name field:
***Global locations**: If name is empty, the method lists thepublic
locations available to all projects. * **Project-specificlocations**: If
name follows the formatprojects/{project}, the method lists locations visible to
thatspecific project. This includes public, private, or otherproject-specific locations enabled
for the project.
For gRPC and client library implementations, the resource name ispassed as the name field.
For direct service calls, the resourcename isincorporated into the request path based on the
specific serviceimplementation and version.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response = hubServiceClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
|
listLocationsPagedCallable()
public final UnaryCallable<ListLocationsRequest,HubServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.
This method lists locations based on the resource scope provided inthe
ListLocationsRequest.name field:
***Global locations**: If name is empty, the method lists thepublic
locations available to all projects. * **Project-specificlocations**: If
name follows the formatprojects/{project}, the method lists locations visible to
thatspecific project. This includes public, private, or otherproject-specific locations enabled
for the project.
For gRPC and client library implementations, the resource name ispassed as the name field.
For direct service calls, the resourcename isincorporated into the request path based on the
specific serviceimplementation and version.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
hubServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
|
listRouteTables(@Nullable HubName parent)
public final HubServiceClient.ListRouteTablesPagedResponse listRouteTables(@Nullable HubName parent)Lists route tables in a given hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName parent = HubName.of("[PROJECT]", "[HUB]");
for (RouteTable element : hubServiceClient.listRouteTables(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The parent resource's name. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListRouteTablesPagedResponse |
|
listRouteTables(ListRouteTablesRequest request)
public final HubServiceClient.ListRouteTablesPagedResponse listRouteTables(ListRouteTablesRequest request)Lists route tables in a given hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListRouteTablesRequest request =
ListRouteTablesRequest.newBuilder()
.setParent(HubName.of("[PROJECT]", "[HUB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (RouteTable element : hubServiceClient.listRouteTables(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListRouteTablesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListRouteTablesPagedResponse |
|
listRouteTables(String parent)
public final HubServiceClient.ListRouteTablesPagedResponse listRouteTables(String parent)Lists route tables in a given hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String parent = HubName.of("[PROJECT]", "[HUB]").toString();
for (RouteTable element : hubServiceClient.listRouteTables(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource's name. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListRouteTablesPagedResponse |
|
listRouteTablesCallable()
public final UnaryCallable<ListRouteTablesRequest,ListRouteTablesResponse> listRouteTablesCallable()Lists route tables in a given hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListRouteTablesRequest request =
ListRouteTablesRequest.newBuilder()
.setParent(HubName.of("[PROJECT]", "[HUB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListRouteTablesResponse response = hubServiceClient.listRouteTablesCallable().call(request);
for (RouteTable element : response.getRouteTablesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListRouteTablesRequest,ListRouteTablesResponse> |
|
listRouteTablesPagedCallable()
public final UnaryCallable<ListRouteTablesRequest,HubServiceClient.ListRouteTablesPagedResponse> listRouteTablesPagedCallable()Lists route tables in a given hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListRouteTablesRequest request =
ListRouteTablesRequest.newBuilder()
.setParent(HubName.of("[PROJECT]", "[HUB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<RouteTable> future =
hubServiceClient.listRouteTablesPagedCallable().futureCall(request);
// Do something.
for (RouteTable element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListRouteTablesRequest,ListRouteTablesPagedResponse> |
|
listRoutes(@Nullable RouteTableName parent)
public final HubServiceClient.ListRoutesPagedResponse listRoutes(@Nullable RouteTableName parent)Lists routes in a given route table.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
RouteTableName parent = RouteTableName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]");
for (Route element : hubServiceClient.listRoutes(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.RouteTableNameRequired. The parent resource's name. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListRoutesPagedResponse |
|
listRoutes(ListRoutesRequest request)
public final HubServiceClient.ListRoutesPagedResponse listRoutes(ListRoutesRequest request)Lists routes in a given route table.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListRoutesRequest request =
ListRoutesRequest.newBuilder()
.setParent(RouteTableName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Route element : hubServiceClient.listRoutes(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListRoutesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListRoutesPagedResponse |
|
listRoutes(String parent)
public final HubServiceClient.ListRoutesPagedResponse listRoutes(String parent)Lists routes in a given route table.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String parent = RouteTableName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]").toString();
for (Route element : hubServiceClient.listRoutes(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource's name. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListRoutesPagedResponse |
|
listRoutesCallable()
public final UnaryCallable<ListRoutesRequest,ListRoutesResponse> listRoutesCallable()Lists routes in a given route table.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListRoutesRequest request =
ListRoutesRequest.newBuilder()
.setParent(RouteTableName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListRoutesResponse response = hubServiceClient.listRoutesCallable().call(request);
for (Route element : response.getRoutesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListRoutesRequest,ListRoutesResponse> |
|
listRoutesPagedCallable()
public final UnaryCallable<ListRoutesRequest,HubServiceClient.ListRoutesPagedResponse> listRoutesPagedCallable()Lists routes in a given route table.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListRoutesRequest request =
ListRoutesRequest.newBuilder()
.setParent(RouteTableName.of("[PROJECT]", "[HUB]", "[ROUTE_TABLE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Route> future = hubServiceClient.listRoutesPagedCallable().futureCall(request);
// Do something.
for (Route element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListRoutesRequest,ListRoutesPagedResponse> |
|
listSpokes(@Nullable LocationName parent)
public final HubServiceClient.ListSpokesPagedResponse listSpokes(@Nullable LocationName parent)Lists the Network Connectivity Center spokes in a specified project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Spoke element : hubServiceClient.listSpokes(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.LocationNameRequired. The parent resource. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListSpokesPagedResponse |
|
listSpokes(ListSpokesRequest request)
public final HubServiceClient.ListSpokesPagedResponse listSpokes(ListSpokesRequest request)Lists the Network Connectivity Center spokes in a specified project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListSpokesRequest request =
ListSpokesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Spoke element : hubServiceClient.listSpokes(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListSpokesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListSpokesPagedResponse |
|
listSpokes(String parent)
public final HubServiceClient.ListSpokesPagedResponse listSpokes(String parent)Lists the Network Connectivity Center spokes in a specified project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Spoke element : hubServiceClient.listSpokes(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.ListSpokesPagedResponse |
|
listSpokesCallable()
public final UnaryCallable<ListSpokesRequest,ListSpokesResponse> listSpokesCallable()Lists the Network Connectivity Center spokes in a specified project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListSpokesRequest request =
ListSpokesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListSpokesResponse response = hubServiceClient.listSpokesCallable().call(request);
for (Spoke element : response.getSpokesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListSpokesRequest,ListSpokesResponse> |
|
listSpokesPagedCallable()
public final UnaryCallable<ListSpokesRequest,HubServiceClient.ListSpokesPagedResponse> listSpokesPagedCallable()Lists the Network Connectivity Center spokes in a specified project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
ListSpokesRequest request =
ListSpokesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Spoke> future = hubServiceClient.listSpokesPagedCallable().futureCall(request);
// Do something.
for (Spoke element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListSpokesRequest,ListSpokesPagedResponse> |
|
queryHubStatus(@Nullable HubName name)
public final HubServiceClient.QueryHubStatusPagedResponse queryHubStatus(@Nullable HubName name)Query the Private Service Connect propagation status of a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
for (HubStatusEntry element : hubServiceClient.queryHubStatus(name).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.QueryHubStatusPagedResponse |
|
queryHubStatus(QueryHubStatusRequest request)
public final HubServiceClient.QueryHubStatusPagedResponse queryHubStatus(QueryHubStatusRequest request)Query the Private Service Connect propagation status of a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
QueryHubStatusRequest request =
QueryHubStatusRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setGroupBy("groupBy293428022")
.build();
for (HubStatusEntry element : hubServiceClient.queryHubStatus(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
QueryHubStatusRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.QueryHubStatusPagedResponse |
|
queryHubStatus(String name)
public final HubServiceClient.QueryHubStatusPagedResponse queryHubStatus(String name)Query the Private Service Connect propagation status of a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
for (HubStatusEntry element : hubServiceClient.queryHubStatus(name).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub. |
| Returns | |
|---|---|
| Type | Description |
HubServiceClient.QueryHubStatusPagedResponse |
|
queryHubStatusCallable()
public final UnaryCallable<QueryHubStatusRequest,QueryHubStatusResponse> queryHubStatusCallable()Query the Private Service Connect propagation status of a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
QueryHubStatusRequest request =
QueryHubStatusRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setGroupBy("groupBy293428022")
.build();
while (true) {
QueryHubStatusResponse response = hubServiceClient.queryHubStatusCallable().call(request);
for (HubStatusEntry element : response.getHubStatusEntriesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<QueryHubStatusRequest,QueryHubStatusResponse> |
|
queryHubStatusPagedCallable()
public final UnaryCallable<QueryHubStatusRequest,HubServiceClient.QueryHubStatusPagedResponse> queryHubStatusPagedCallable()Query the Private Service Connect propagation status of a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
QueryHubStatusRequest request =
QueryHubStatusRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.setGroupBy("groupBy293428022")
.build();
ApiFuture<HubStatusEntry> future =
hubServiceClient.queryHubStatusPagedCallable().futureCall(request);
// Do something.
for (HubStatusEntry element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<QueryHubStatusRequest,QueryHubStatusPagedResponse> |
|
rejectHubSpokeAsync(@Nullable HubName name, @Nullable SpokeName spokeUri)
public final OperationFuture<RejectHubSpokeResponse,OperationMetadata> rejectHubSpokeAsync(@Nullable HubName name, @Nullable SpokeName spokeUri)Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was
previously in the ACTIVE state, it transitions to the INACTIVE state and is no longer able
to connect to other spokes that are attached to the hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
SpokeName spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
RejectHubSpokeResponse response = hubServiceClient.rejectHubSpokeAsync(name, spokeUri).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub from which to reject the spoke. |
spokeUri |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The URI of the spoke to reject from the hub. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<RejectHubSpokeResponse,OperationMetadata> |
|
rejectHubSpokeAsync(@Nullable HubName name, String spokeUri)
public final OperationFuture<RejectHubSpokeResponse,OperationMetadata> rejectHubSpokeAsync(@Nullable HubName name, String spokeUri)Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was
previously in the ACTIVE state, it transitions to the INACTIVE state and is no longer able
to connect to other spokes that are attached to the hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
String spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
RejectHubSpokeResponse response = hubServiceClient.rejectHubSpokeAsync(name, spokeUri).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub from which to reject the spoke. |
spokeUri |
StringRequired. The URI of the spoke to reject from the hub. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<RejectHubSpokeResponse,OperationMetadata> |
|
rejectHubSpokeAsync(RejectHubSpokeRequest request)
public final OperationFuture<RejectHubSpokeResponse,OperationMetadata> rejectHubSpokeAsync(RejectHubSpokeRequest request)Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was
previously in the ACTIVE state, it transitions to the INACTIVE state and is no longer able
to connect to other spokes that are attached to the hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
RejectHubSpokeRequest request =
RejectHubSpokeRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setRequestId("requestId693933066")
.setDetails("details1557721666")
.build();
RejectHubSpokeResponse response = hubServiceClient.rejectHubSpokeAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
RejectHubSpokeRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<RejectHubSpokeResponse,OperationMetadata> |
|
rejectHubSpokeAsync(String name, @Nullable SpokeName spokeUri)
public final OperationFuture<RejectHubSpokeResponse,OperationMetadata> rejectHubSpokeAsync(String name, @Nullable SpokeName spokeUri)Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was
previously in the ACTIVE state, it transitions to the INACTIVE state and is no longer able
to connect to other spokes that are attached to the hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
SpokeName spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
RejectHubSpokeResponse response = hubServiceClient.rejectHubSpokeAsync(name, spokeUri).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub from which to reject the spoke. |
spokeUri |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The URI of the spoke to reject from the hub. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<RejectHubSpokeResponse,OperationMetadata> |
|
rejectHubSpokeAsync(String name, String spokeUri)
public final OperationFuture<RejectHubSpokeResponse,OperationMetadata> rejectHubSpokeAsync(String name, String spokeUri)Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was
previously in the ACTIVE state, it transitions to the INACTIVE state and is no longer able
to connect to other spokes that are attached to the hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
String spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
RejectHubSpokeResponse response = hubServiceClient.rejectHubSpokeAsync(name, spokeUri).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub from which to reject the spoke. |
spokeUri |
StringRequired. The URI of the spoke to reject from the hub. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<RejectHubSpokeResponse,OperationMetadata> |
|
rejectHubSpokeCallable()
public final UnaryCallable<RejectHubSpokeRequest,Operation> rejectHubSpokeCallable()Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was
previously in the ACTIVE state, it transitions to the INACTIVE state and is no longer able
to connect to other spokes that are attached to the hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
RejectHubSpokeRequest request =
RejectHubSpokeRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setRequestId("requestId693933066")
.setDetails("details1557721666")
.build();
ApiFuture<Operation> future = hubServiceClient.rejectHubSpokeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<RejectHubSpokeRequest,Operation> |
|
rejectHubSpokeOperationCallable()
public final OperationCallable<RejectHubSpokeRequest,RejectHubSpokeResponse,OperationMetadata> rejectHubSpokeOperationCallable()Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was
previously in the ACTIVE state, it transitions to the INACTIVE state and is no longer able
to connect to other spokes that are attached to the hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
RejectHubSpokeRequest request =
RejectHubSpokeRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setRequestId("requestId693933066")
.setDetails("details1557721666")
.build();
OperationFuture<RejectHubSpokeResponse, OperationMetadata> future =
hubServiceClient.rejectHubSpokeOperationCallable().futureCall(request);
// Do something.
RejectHubSpokeResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<RejectHubSpokeRequest,RejectHubSpokeResponse,OperationMetadata> |
|
rejectSpokeUpdateAsync(@Nullable HubName name, @Nullable SpokeName spokeUri, String spokeEtag)
public final OperationFuture<RejectSpokeUpdateResponse,OperationMetadata> rejectSpokeUpdateAsync(@Nullable HubName name, @Nullable SpokeName spokeUri, String spokeEtag)Rejects a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
SpokeName spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
String spokeEtag = "spokeEtag-1185145407";
RejectSpokeUpdateResponse response =
hubServiceClient.rejectSpokeUpdateAsync(name, spokeUri, spokeEtag).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub to reject spoke update. |
spokeUri |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The URI of the spoke to reject update. |
spokeEtag |
StringRequired. The etag of the spoke to reject update. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<RejectSpokeUpdateResponse,OperationMetadata> |
|
rejectSpokeUpdateAsync(@Nullable HubName name, String spokeUri, String spokeEtag)
public final OperationFuture<RejectSpokeUpdateResponse,OperationMetadata> rejectSpokeUpdateAsync(@Nullable HubName name, String spokeUri, String spokeEtag)Rejects a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
HubName name = HubName.of("[PROJECT]", "[HUB]");
String spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
String spokeEtag = "spokeEtag-1185145407";
RejectSpokeUpdateResponse response =
hubServiceClient.rejectSpokeUpdateAsync(name, spokeUri, spokeEtag).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.HubNameRequired. The name of the hub to reject spoke update. |
spokeUri |
StringRequired. The URI of the spoke to reject update. |
spokeEtag |
StringRequired. The etag of the spoke to reject update. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<RejectSpokeUpdateResponse,OperationMetadata> |
|
rejectSpokeUpdateAsync(RejectSpokeUpdateRequest request)
public final OperationFuture<RejectSpokeUpdateResponse,OperationMetadata> rejectSpokeUpdateAsync(RejectSpokeUpdateRequest request)Rejects a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
RejectSpokeUpdateRequest request =
RejectSpokeUpdateRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setSpokeEtag("spokeEtag-1185145407")
.setDetails("details1557721666")
.setRequestId("requestId693933066")
.build();
RejectSpokeUpdateResponse response = hubServiceClient.rejectSpokeUpdateAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
RejectSpokeUpdateRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<RejectSpokeUpdateResponse,OperationMetadata> |
|
rejectSpokeUpdateAsync(String name, @Nullable SpokeName spokeUri, String spokeEtag)
public final OperationFuture<RejectSpokeUpdateResponse,OperationMetadata> rejectSpokeUpdateAsync(String name, @Nullable SpokeName spokeUri, String spokeEtag)Rejects a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
SpokeName spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]");
String spokeEtag = "spokeEtag-1185145407";
RejectSpokeUpdateResponse response =
hubServiceClient.rejectSpokeUpdateAsync(name, spokeUri, spokeEtag).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub to reject spoke update. |
spokeUri |
@org.jspecify.annotations.Nullable com.google.cloud.networkconnectivity.v1beta.SpokeNameRequired. The URI of the spoke to reject update. |
spokeEtag |
StringRequired. The etag of the spoke to reject update. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<RejectSpokeUpdateResponse,OperationMetadata> |
|
rejectSpokeUpdateAsync(String name, String spokeUri, String spokeEtag)
public final OperationFuture<RejectSpokeUpdateResponse,OperationMetadata> rejectSpokeUpdateAsync(String name, String spokeUri, String spokeEtag)Rejects a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
String name = HubName.of("[PROJECT]", "[HUB]").toString();
String spokeUri = SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString();
String spokeEtag = "spokeEtag-1185145407";
RejectSpokeUpdateResponse response =
hubServiceClient.rejectSpokeUpdateAsync(name, spokeUri, spokeEtag).get();
}
| Parameters | |
|---|---|
| Name | Description |
name |
StringRequired. The name of the hub to reject spoke update. |
spokeUri |
StringRequired. The URI of the spoke to reject update. |
spokeEtag |
StringRequired. The etag of the spoke to reject update. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<RejectSpokeUpdateResponse,OperationMetadata> |
|
rejectSpokeUpdateCallable()
public final UnaryCallable<RejectSpokeUpdateRequest,Operation> rejectSpokeUpdateCallable()Rejects a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
RejectSpokeUpdateRequest request =
RejectSpokeUpdateRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setSpokeEtag("spokeEtag-1185145407")
.setDetails("details1557721666")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
hubServiceClient.rejectSpokeUpdateCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<RejectSpokeUpdateRequest,Operation> |
|
rejectSpokeUpdateOperationCallable()
public final OperationCallable<RejectSpokeUpdateRequest,RejectSpokeUpdateResponse,OperationMetadata> rejectSpokeUpdateOperationCallable()Rejects a proposal to update a Network Connectivity Center spoke in a hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
RejectSpokeUpdateRequest request =
RejectSpokeUpdateRequest.newBuilder()
.setName(HubName.of("[PROJECT]", "[HUB]").toString())
.setSpokeUri(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
.setSpokeEtag("spokeEtag-1185145407")
.setDetails("details1557721666")
.setRequestId("requestId693933066")
.build();
OperationFuture<RejectSpokeUpdateResponse, OperationMetadata> future =
hubServiceClient.rejectSpokeUpdateOperationCallable().futureCall(request);
// Do something.
RejectSpokeUpdateResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<RejectSpokeUpdateRequest,RejectSpokeUpdateResponse,OperationMetadata> |
|
setIamPolicy(SetIamPolicyRequest request)
public final Policy setIamPolicy(SetIamPolicyRequest request)Sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = hubServiceClient.setIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.SetIamPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.Policy |
|
setIamPolicyCallable()
public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()Sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future = hubServiceClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()testIamPermissions(TestIamPermissionsRequest request)
public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)Returns permissions that a caller has on the specified resource. If theresource does not exist,
this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = hubServiceClient.testIamPermissions(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.TestIamPermissionsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.TestIamPermissionsResponse |
|
testIamPermissionsCallable()
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()Returns permissions that a caller has on the specified resource. If theresource does not exist,
this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(GroupName.of("[PROJECT]", "[HUB]", "[GROUP]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
hubServiceClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
|
updateGatewayAdvertisedRouteAsync(GatewayAdvertisedRoute gatewayAdvertisedRoute, FieldMask updateMask)
public final OperationFuture<GatewayAdvertisedRoute,OperationMetadata> updateGatewayAdvertisedRouteAsync(GatewayAdvertisedRoute gatewayAdvertisedRoute, FieldMask updateMask)Update a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
GatewayAdvertisedRoute gatewayAdvertisedRoute = GatewayAdvertisedRoute.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
GatewayAdvertisedRoute response =
hubServiceClient
.updateGatewayAdvertisedRouteAsync(gatewayAdvertisedRoute, updateMask)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
gatewayAdvertisedRoute |
GatewayAdvertisedRouteRequired. The gateway advertised route to update. The gateway advertised route's |
updateMask |
FieldMaskOptional. In the case of an update to an existing group, field mask is used to specify the fields to be overwritten. The fields specified in the update_mask are relative to the resource, not the full request. A field is overwritten if it is in the mask. If the user does not provide a mask, then all fields are overwritten. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<GatewayAdvertisedRoute,OperationMetadata> |
|
updateGatewayAdvertisedRouteAsync(UpdateGatewayAdvertisedRouteRequest request)
public final OperationFuture<GatewayAdvertisedRoute,OperationMetadata> updateGatewayAdvertisedRouteAsync(UpdateGatewayAdvertisedRouteRequest request)Update a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateGatewayAdvertisedRouteRequest request =
UpdateGatewayAdvertisedRouteRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setGatewayAdvertisedRoute(GatewayAdvertisedRoute.newBuilder().build())
.setRequestId("requestId693933066")
.build();
GatewayAdvertisedRoute response =
hubServiceClient.updateGatewayAdvertisedRouteAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateGatewayAdvertisedRouteRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<GatewayAdvertisedRoute,OperationMetadata> |
|
updateGatewayAdvertisedRouteCallable()
public final UnaryCallable<UpdateGatewayAdvertisedRouteRequest,Operation> updateGatewayAdvertisedRouteCallable()Update a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateGatewayAdvertisedRouteRequest request =
UpdateGatewayAdvertisedRouteRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setGatewayAdvertisedRoute(GatewayAdvertisedRoute.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
hubServiceClient.updateGatewayAdvertisedRouteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateGatewayAdvertisedRouteRequest,Operation> |
|
updateGatewayAdvertisedRouteOperationCallable()
public final OperationCallable<UpdateGatewayAdvertisedRouteRequest,GatewayAdvertisedRoute,OperationMetadata> updateGatewayAdvertisedRouteOperationCallable()Update a GatewayAdvertisedRoute
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateGatewayAdvertisedRouteRequest request =
UpdateGatewayAdvertisedRouteRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setGatewayAdvertisedRoute(GatewayAdvertisedRoute.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<GatewayAdvertisedRoute, OperationMetadata> future =
hubServiceClient.updateGatewayAdvertisedRouteOperationCallable().futureCall(request);
// Do something.
GatewayAdvertisedRoute response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateGatewayAdvertisedRouteRequest,GatewayAdvertisedRoute,OperationMetadata> |
|
updateGroupAsync(Group group, FieldMask updateMask)
public final OperationFuture<Group,OperationMetadata> updateGroupAsync(Group group, FieldMask updateMask)Updates the parameters of a Network Connectivity Center group.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
Group group = Group.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Group response = hubServiceClient.updateGroupAsync(group, updateMask).get();
}
| Parameters | |
|---|---|
| Name | Description |
group |
GroupRequired. The state that the group should be in after the update. |
updateMask |
FieldMaskOptional. In the case of an update to an existing group, field mask is used to specify the fields to be overwritten. The fields specified in the update_mask are relative to the resource, not the full request. A field is overwritten if it is in the mask. If the user does not provide a mask, then all fields are overwritten. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Group,OperationMetadata> |
|
updateGroupAsync(UpdateGroupRequest request)
public final OperationFuture<Group,OperationMetadata> updateGroupAsync(UpdateGroupRequest request)Updates the parameters of a Network Connectivity Center group.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateGroupRequest request =
UpdateGroupRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setGroup(Group.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Group response = hubServiceClient.updateGroupAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateGroupRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Group,OperationMetadata> |
|
updateGroupCallable()
public final UnaryCallable<UpdateGroupRequest,Operation> updateGroupCallable()Updates the parameters of a Network Connectivity Center group.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateGroupRequest request =
UpdateGroupRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setGroup(Group.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = hubServiceClient.updateGroupCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateGroupRequest,Operation> |
|
updateGroupOperationCallable()
public final OperationCallable<UpdateGroupRequest,Group,OperationMetadata> updateGroupOperationCallable()Updates the parameters of a Network Connectivity Center group.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateGroupRequest request =
UpdateGroupRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setGroup(Group.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Group, OperationMetadata> future =
hubServiceClient.updateGroupOperationCallable().futureCall(request);
// Do something.
Group response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateGroupRequest,Group,OperationMetadata> |
|
updateHubAsync(Hub hub, FieldMask updateMask)
public final OperationFuture<Hub,OperationMetadata> updateHubAsync(Hub hub, FieldMask updateMask)Updates the description and/or labels of a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
Hub hub = Hub.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Hub response = hubServiceClient.updateHubAsync(hub, updateMask).get();
}
| Parameters | |
|---|---|
| Name | Description |
hub |
HubRequired. The state that the hub should be in after the update. |
updateMask |
FieldMaskOptional. In the case of an update to an existing hub, field mask is used to specify the fields to be overwritten. The fields specified in the update_mask are relative to the resource, not the full request. A field is overwritten if it is in the mask. If the user does not provide a mask, then all fields are overwritten. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Hub,OperationMetadata> |
|
updateHubAsync(UpdateHubRequest request)
public final OperationFuture<Hub,OperationMetadata> updateHubAsync(UpdateHubRequest request)Updates the description and/or labels of a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateHubRequest request =
UpdateHubRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setHub(Hub.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Hub response = hubServiceClient.updateHubAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateHubRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Hub,OperationMetadata> |
|
updateHubCallable()
public final UnaryCallable<UpdateHubRequest,Operation> updateHubCallable()Updates the description and/or labels of a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateHubRequest request =
UpdateHubRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setHub(Hub.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = hubServiceClient.updateHubCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateHubRequest,Operation> |
|
updateHubOperationCallable()
public final OperationCallable<UpdateHubRequest,Hub,OperationMetadata> updateHubOperationCallable()Updates the description and/or labels of a Network Connectivity Center hub.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateHubRequest request =
UpdateHubRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setHub(Hub.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Hub, OperationMetadata> future =
hubServiceClient.updateHubOperationCallable().futureCall(request);
// Do something.
Hub response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateHubRequest,Hub,OperationMetadata> |
|
updateSpokeAsync(Spoke spoke, FieldMask updateMask)
public final OperationFuture<Spoke,OperationMetadata> updateSpokeAsync(Spoke spoke, FieldMask updateMask)Updates the parameters of a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
Spoke spoke = Spoke.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Spoke response = hubServiceClient.updateSpokeAsync(spoke, updateMask).get();
}
| Parameters | |
|---|---|
| Name | Description |
spoke |
SpokeRequired. The state that the spoke should be in after the update. |
updateMask |
FieldMaskOptional. In the case of an update to an existing spoke, field mask is used to specify the fields to be overwritten. The fields specified in the update_mask are relative to the resource, not the full request. A field is overwritten if it is in the mask. If the user does not provide a mask, then all fields are overwritten. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Spoke,OperationMetadata> |
|
updateSpokeAsync(UpdateSpokeRequest request)
public final OperationFuture<Spoke,OperationMetadata> updateSpokeAsync(UpdateSpokeRequest request)Updates the parameters of a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateSpokeRequest request =
UpdateSpokeRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setSpoke(Spoke.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Spoke response = hubServiceClient.updateSpokeAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateSpokeRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Spoke,OperationMetadata> |
|
updateSpokeCallable()
public final UnaryCallable<UpdateSpokeRequest,Operation> updateSpokeCallable()Updates the parameters of a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateSpokeRequest request =
UpdateSpokeRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setSpoke(Spoke.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = hubServiceClient.updateSpokeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateSpokeRequest,Operation> |
|
updateSpokeOperationCallable()
public final OperationCallable<UpdateSpokeRequest,Spoke,OperationMetadata> updateSpokeOperationCallable()Updates the parameters of a Network Connectivity Center spoke.
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 (HubServiceClient hubServiceClient = HubServiceClient.create()) {
UpdateSpokeRequest request =
UpdateSpokeRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setSpoke(Spoke.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Spoke, OperationMetadata> future =
hubServiceClient.updateSpokeOperationCallable().futureCall(request);
// Do something.
Spoke response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateSpokeRequest,Spoke,OperationMetadata> |
|