| GitHub Repository | Product Reference |
Service Description: Service describing handlers for resources.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
EndpointPolicyName name =
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]");
EndpointPolicy response = networkServicesClient.getEndpointPolicy(name);
}
Note: close() needs to be called on the NetworkServicesClient 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 |
|---|---|---|
ListEndpointPolicies |
Lists EndpointPolicies in a given 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.
|
GetEndpointPolicy |
Gets details of a single EndpointPolicy. |
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.
|
CreateEndpointPolicy |
Creates a new EndpointPolicy in a given project and location. |
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.
|
UpdateEndpointPolicy |
Updates the parameters of a single EndpointPolicy. |
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.
|
DeleteEndpointPolicy |
Deletes a single EndpointPolicy. |
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 NetworkServicesSettings 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
NetworkServicesSettings networkServicesSettings =
NetworkServicesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
NetworkServicesClient networkServicesClient =
NetworkServicesClient.create(networkServicesSettings);
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
NetworkServicesSettings networkServicesSettings =
NetworkServicesSettings.newBuilder().setEndpoint(myEndpoint).build();
NetworkServicesClient networkServicesClient =
NetworkServicesClient.create(networkServicesSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
NetworkServicesSettings networkServicesSettings =
NetworkServicesSettings.newHttpJsonBuilder().build();
NetworkServicesClient networkServicesClient =
NetworkServicesClient.create(networkServicesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final NetworkServicesClient create()Constructs an instance of NetworkServicesClient with default settings.
| Returns | |
|---|---|
| Type | Description |
NetworkServicesClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(NetworkServicesSettings settings)
public static final NetworkServicesClient create(NetworkServicesSettings settings)Constructs an instance of NetworkServicesClient, 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 |
NetworkServicesSettings |
| Returns | |
|---|---|
| Type | Description |
NetworkServicesClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(NetworkServicesStub stub)
public static final NetworkServicesClient create(NetworkServicesStub stub)Constructs an instance of NetworkServicesClient, using the given stub for making calls. This is for advanced usage - prefer using create(NetworkServicesSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
NetworkServicesStub |
| Returns | |
|---|---|
| Type | Description |
NetworkServicesClient |
|
Constructors
NetworkServicesClient(NetworkServicesSettings settings)
protected NetworkServicesClient(NetworkServicesSettings settings)Constructs an instance of NetworkServicesClient, 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 |
NetworkServicesSettings |
NetworkServicesClient(NetworkServicesStub stub)
protected NetworkServicesClient(NetworkServicesStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
NetworkServicesStub |
Methods
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()createEndpointPolicyAsync(@Nullable LocationName parent, EndpointPolicy endpointPolicy, String endpointPolicyId)
public final OperationFuture<EndpointPolicy,OperationMetadata> createEndpointPolicyAsync(@Nullable LocationName parent, EndpointPolicy endpointPolicy, String endpointPolicyId)Creates a new EndpointPolicy in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
EndpointPolicy endpointPolicy = EndpointPolicy.newBuilder().build();
String endpointPolicyId = "endpointPolicyId-509458782";
EndpointPolicy response =
networkServicesClient
.createEndpointPolicyAsync(parent, endpointPolicy, endpointPolicyId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkservices.v1beta1.LocationNameRequired. The parent resource of the EndpointPolicy. Must be in the format
|
endpointPolicy |
EndpointPolicyRequired. EndpointPolicy resource to be created. |
endpointPolicyId |
StringRequired. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<EndpointPolicy,OperationMetadata> |
|
createEndpointPolicyAsync(CreateEndpointPolicyRequest request)
public final OperationFuture<EndpointPolicy,OperationMetadata> createEndpointPolicyAsync(CreateEndpointPolicyRequest request)Creates a new EndpointPolicy in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
CreateEndpointPolicyRequest request =
CreateEndpointPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setEndpointPolicyId("endpointPolicyId-509458782")
.setEndpointPolicy(EndpointPolicy.newBuilder().build())
.build();
EndpointPolicy response = networkServicesClient.createEndpointPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateEndpointPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<EndpointPolicy,OperationMetadata> |
|
createEndpointPolicyAsync(String parent, EndpointPolicy endpointPolicy, String endpointPolicyId)
public final OperationFuture<EndpointPolicy,OperationMetadata> createEndpointPolicyAsync(String parent, EndpointPolicy endpointPolicy, String endpointPolicyId)Creates a new EndpointPolicy in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
EndpointPolicy endpointPolicy = EndpointPolicy.newBuilder().build();
String endpointPolicyId = "endpointPolicyId-509458782";
EndpointPolicy response =
networkServicesClient
.createEndpointPolicyAsync(parent, endpointPolicy, endpointPolicyId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
StringRequired. The parent resource of the EndpointPolicy. Must be in the format
|
endpointPolicy |
EndpointPolicyRequired. EndpointPolicy resource to be created. |
endpointPolicyId |
StringRequired. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<EndpointPolicy,OperationMetadata> |
|
createEndpointPolicyCallable()
public final UnaryCallable<CreateEndpointPolicyRequest,Operation> createEndpointPolicyCallable()Creates a new EndpointPolicy in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
CreateEndpointPolicyRequest request =
CreateEndpointPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setEndpointPolicyId("endpointPolicyId-509458782")
.setEndpointPolicy(EndpointPolicy.newBuilder().build())
.build();
ApiFuture<Operation> future =
networkServicesClient.createEndpointPolicyCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateEndpointPolicyRequest,Operation> |
|
createEndpointPolicyOperationCallable()
public final OperationCallable<CreateEndpointPolicyRequest,EndpointPolicy,OperationMetadata> createEndpointPolicyOperationCallable()Creates a new EndpointPolicy in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
CreateEndpointPolicyRequest request =
CreateEndpointPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setEndpointPolicyId("endpointPolicyId-509458782")
.setEndpointPolicy(EndpointPolicy.newBuilder().build())
.build();
OperationFuture<EndpointPolicy, OperationMetadata> future =
networkServicesClient.createEndpointPolicyOperationCallable().futureCall(request);
// Do something.
EndpointPolicy response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateEndpointPolicyRequest,EndpointPolicy,OperationMetadata> |
|
deleteEndpointPolicyAsync(@Nullable EndpointPolicyName name)
public final OperationFuture<Empty,OperationMetadata> deleteEndpointPolicyAsync(@Nullable EndpointPolicyName name)Deletes a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
EndpointPolicyName name =
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]");
networkServicesClient.deleteEndpointPolicyAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkservices.v1beta1.EndpointPolicyNameRequired. A name of the EndpointPolicy to delete. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteEndpointPolicyAsync(DeleteEndpointPolicyRequest request)
public final OperationFuture<Empty,OperationMetadata> deleteEndpointPolicyAsync(DeleteEndpointPolicyRequest request)Deletes a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
DeleteEndpointPolicyRequest request =
DeleteEndpointPolicyRequest.newBuilder()
.setName(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.build();
networkServicesClient.deleteEndpointPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteEndpointPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteEndpointPolicyAsync(String name)
public final OperationFuture<Empty,OperationMetadata> deleteEndpointPolicyAsync(String name)Deletes a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
String name =
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString();
networkServicesClient.deleteEndpointPolicyAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. A name of the EndpointPolicy to delete. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteEndpointPolicyCallable()
public final UnaryCallable<DeleteEndpointPolicyRequest,Operation> deleteEndpointPolicyCallable()Deletes a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
DeleteEndpointPolicyRequest request =
DeleteEndpointPolicyRequest.newBuilder()
.setName(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.build();
ApiFuture<Operation> future =
networkServicesClient.deleteEndpointPolicyCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteEndpointPolicyRequest,Operation> |
|
deleteEndpointPolicyOperationCallable()
public final OperationCallable<DeleteEndpointPolicyRequest,Empty,OperationMetadata> deleteEndpointPolicyOperationCallable()Deletes a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
DeleteEndpointPolicyRequest request =
DeleteEndpointPolicyRequest.newBuilder()
.setName(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.build();
OperationFuture<Empty, OperationMetadata> future =
networkServicesClient.deleteEndpointPolicyOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteEndpointPolicyRequest,Empty,OperationMetadata> |
|
getEndpointPolicy(@Nullable EndpointPolicyName name)
public final EndpointPolicy getEndpointPolicy(@Nullable EndpointPolicyName name)Gets details of a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
EndpointPolicyName name =
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]");
EndpointPolicy response = networkServicesClient.getEndpointPolicy(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
@org.jspecify.annotations.Nullable com.google.cloud.networkservices.v1beta1.EndpointPolicyNameRequired. A name of the EndpointPolicy to get. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
EndpointPolicy |
|
getEndpointPolicy(GetEndpointPolicyRequest request)
public final EndpointPolicy getEndpointPolicy(GetEndpointPolicyRequest request)Gets details of a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
GetEndpointPolicyRequest request =
GetEndpointPolicyRequest.newBuilder()
.setName(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.build();
EndpointPolicy response = networkServicesClient.getEndpointPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetEndpointPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
EndpointPolicy |
|
getEndpointPolicy(String name)
public final EndpointPolicy getEndpointPolicy(String name)Gets details of a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
String name =
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString();
EndpointPolicy response = networkServicesClient.getEndpointPolicy(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
StringRequired. A name of the EndpointPolicy to get. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
EndpointPolicy |
|
getEndpointPolicyCallable()
public final UnaryCallable<GetEndpointPolicyRequest,EndpointPolicy> getEndpointPolicyCallable()Gets details of a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
GetEndpointPolicyRequest request =
GetEndpointPolicyRequest.newBuilder()
.setName(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.build();
ApiFuture<EndpointPolicy> future =
networkServicesClient.getEndpointPolicyCallable().futureCall(request);
// Do something.
EndpointPolicy response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetEndpointPolicyRequest,EndpointPolicy> |
|
getHttpJsonOperationsClient()
public final OperationsClient getHttpJsonOperationsClient()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 |
|
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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = networkServicesClient.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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = networkServicesClient.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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = networkServicesClient.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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = networkServicesClient.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 |
|
getSettings()
public final @Nullable NetworkServicesSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.cloud.networkservices.v1beta1.NetworkServicesSettings |
|
getStub()
public NetworkServicesStub getStub()| Returns | |
|---|---|
| Type | Description |
NetworkServicesStub |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listEndpointPolicies(@Nullable LocationName parent)
public final NetworkServicesClient.ListEndpointPoliciesPagedResponse listEndpointPolicies(@Nullable LocationName parent)Lists EndpointPolicies in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (EndpointPolicy element :
networkServicesClient.listEndpointPolicies(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
@org.jspecify.annotations.Nullable com.google.cloud.networkservices.v1beta1.LocationNameRequired. The project and location from which the EndpointPolicies should be
listed, specified in the format |
| Returns | |
|---|---|
| Type | Description |
NetworkServicesClient.ListEndpointPoliciesPagedResponse |
|
listEndpointPolicies(ListEndpointPoliciesRequest request)
public final NetworkServicesClient.ListEndpointPoliciesPagedResponse listEndpointPolicies(ListEndpointPoliciesRequest request)Lists EndpointPolicies in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
ListEndpointPoliciesRequest request =
ListEndpointPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (EndpointPolicy element :
networkServicesClient.listEndpointPolicies(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListEndpointPoliciesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
NetworkServicesClient.ListEndpointPoliciesPagedResponse |
|
listEndpointPolicies(String parent)
public final NetworkServicesClient.ListEndpointPoliciesPagedResponse listEndpointPolicies(String parent)Lists EndpointPolicies in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (EndpointPolicy element :
networkServicesClient.listEndpointPolicies(parent).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
StringRequired. The project and location from which the EndpointPolicies should be
listed, specified in the format |
| Returns | |
|---|---|
| Type | Description |
NetworkServicesClient.ListEndpointPoliciesPagedResponse |
|
listEndpointPoliciesCallable()
public final UnaryCallable<ListEndpointPoliciesRequest,ListEndpointPoliciesResponse> listEndpointPoliciesCallable()Lists EndpointPolicies in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
ListEndpointPoliciesRequest request =
ListEndpointPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListEndpointPoliciesResponse response =
networkServicesClient.listEndpointPoliciesCallable().call(request);
for (EndpointPolicy element : response.getEndpointPoliciesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListEndpointPoliciesRequest,ListEndpointPoliciesResponse> |
|
listEndpointPoliciesPagedCallable()
public final UnaryCallable<ListEndpointPoliciesRequest,NetworkServicesClient.ListEndpointPoliciesPagedResponse> listEndpointPoliciesPagedCallable()Lists EndpointPolicies in a given project and location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
ListEndpointPoliciesRequest request =
ListEndpointPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<EndpointPolicy> future =
networkServicesClient.listEndpointPoliciesPagedCallable().futureCall(request);
// Do something.
for (EndpointPolicy element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListEndpointPoliciesRequest,ListEndpointPoliciesPagedResponse> |
|
listLocations(ListLocationsRequest request)
public final NetworkServicesClient.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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : networkServicesClient.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 |
NetworkServicesClient.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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
networkServicesClient.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,NetworkServicesClient.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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
networkServicesClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
|
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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = networkServicesClient.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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future = networkServicesClient.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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = networkServicesClient.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 (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
EndpointPolicyName.of("[PROJECT]", "[LOCATION]", "[ENDPOINT_POLICY]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
networkServicesClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
|
updateEndpointPolicyAsync(EndpointPolicy endpointPolicy, FieldMask updateMask)
public final OperationFuture<EndpointPolicy,OperationMetadata> updateEndpointPolicyAsync(EndpointPolicy endpointPolicy, FieldMask updateMask)Updates the parameters of a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
EndpointPolicy endpointPolicy = EndpointPolicy.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
EndpointPolicy response =
networkServicesClient.updateEndpointPolicyAsync(endpointPolicy, updateMask).get();
}
| Parameters | |
|---|---|
| Name | Description |
endpointPolicy |
EndpointPolicyRequired. Updated EndpointPolicy resource. |
updateMask |
FieldMaskOptional. Field mask is used to specify the fields to be overwritten in the EndpointPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<EndpointPolicy,OperationMetadata> |
|
updateEndpointPolicyAsync(UpdateEndpointPolicyRequest request)
public final OperationFuture<EndpointPolicy,OperationMetadata> updateEndpointPolicyAsync(UpdateEndpointPolicyRequest request)Updates the parameters of a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
UpdateEndpointPolicyRequest request =
UpdateEndpointPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setEndpointPolicy(EndpointPolicy.newBuilder().build())
.build();
EndpointPolicy response = networkServicesClient.updateEndpointPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateEndpointPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<EndpointPolicy,OperationMetadata> |
|
updateEndpointPolicyCallable()
public final UnaryCallable<UpdateEndpointPolicyRequest,Operation> updateEndpointPolicyCallable()Updates the parameters of a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
UpdateEndpointPolicyRequest request =
UpdateEndpointPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setEndpointPolicy(EndpointPolicy.newBuilder().build())
.build();
ApiFuture<Operation> future =
networkServicesClient.updateEndpointPolicyCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateEndpointPolicyRequest,Operation> |
|
updateEndpointPolicyOperationCallable()
public final OperationCallable<UpdateEndpointPolicyRequest,EndpointPolicy,OperationMetadata> updateEndpointPolicyOperationCallable()Updates the parameters of a single EndpointPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkServicesClient networkServicesClient = NetworkServicesClient.create()) {
UpdateEndpointPolicyRequest request =
UpdateEndpointPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setEndpointPolicy(EndpointPolicy.newBuilder().build())
.build();
OperationFuture<EndpointPolicy, OperationMetadata> future =
networkServicesClient.updateEndpointPolicyOperationCallable().futureCall(request);
// Do something.
EndpointPolicy response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateEndpointPolicyRequest,EndpointPolicy,OperationMetadata> |
|