Class NetworkServicesClient (0.12.0)

GitHub RepositoryProduct 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().

Methods
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.

  • listEndpointPolicies(ListEndpointPoliciesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listEndpointPolicies(LocationName parent)

  • listEndpointPolicies(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listEndpointPoliciesPagedCallable()

  • listEndpointPoliciesCallable()

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.

  • getEndpointPolicy(GetEndpointPolicyRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getEndpointPolicy(EndpointPolicyName name)

  • getEndpointPolicy(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getEndpointPolicyCallable()

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.

  • createEndpointPolicyAsync(CreateEndpointPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createEndpointPolicyAsync(LocationName parent, EndpointPolicy endpointPolicy, String endpointPolicyId)

  • createEndpointPolicyAsync(String parent, EndpointPolicy endpointPolicy, String endpointPolicyId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createEndpointPolicyOperationCallable()

  • createEndpointPolicyCallable()

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.

  • updateEndpointPolicyAsync(UpdateEndpointPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateEndpointPolicyAsync(EndpointPolicy endpointPolicy, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateEndpointPolicyOperationCallable()

  • updateEndpointPolicyCallable()

DeleteEndpointPolicy

Deletes a single EndpointPolicy.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteEndpointPolicyAsync(DeleteEndpointPolicyRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteEndpointPolicyAsync(EndpointPolicyName name)

  • deleteEndpointPolicyAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteEndpointPolicyOperationCallable()

  • deleteEndpointPolicyCallable()

ListGateways

Lists Gateways in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listGateways(ListGatewaysRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listGateways(LocationName parent)

  • listGateways(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listGatewaysPagedCallable()

  • listGatewaysCallable()

GetGateway

Gets details of a single Gateway.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getGateway(GetGatewayRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getGateway(GatewayName name)

  • getGateway(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getGatewayCallable()

CreateGateway

Creates a new Gateway in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createGatewayAsync(CreateGatewayRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createGatewayAsync(LocationName parent, Gateway gateway, String gatewayId)

  • createGatewayAsync(String parent, Gateway gateway, String gatewayId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createGatewayOperationCallable()

  • createGatewayCallable()

UpdateGateway

Updates the parameters of a single Gateway.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateGatewayAsync(UpdateGatewayRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateGatewayAsync(Gateway gateway, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateGatewayOperationCallable()

  • updateGatewayCallable()

DeleteGateway

Deletes a single Gateway.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteGatewayAsync(DeleteGatewayRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteGatewayAsync(GatewayName name)

  • deleteGatewayAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteGatewayOperationCallable()

  • deleteGatewayCallable()

ListGrpcRoutes

Lists GrpcRoutes in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listGrpcRoutes(ListGrpcRoutesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listGrpcRoutes(LocationName parent)

  • listGrpcRoutes(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listGrpcRoutesPagedCallable()

  • listGrpcRoutesCallable()

GetGrpcRoute

Gets details of a single GrpcRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getGrpcRoute(GetGrpcRouteRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getGrpcRoute(GrpcRouteName name)

  • getGrpcRoute(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getGrpcRouteCallable()

CreateGrpcRoute

Creates a new GrpcRoute in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createGrpcRouteAsync(CreateGrpcRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createGrpcRouteAsync(LocationName parent, GrpcRoute grpcRoute, String grpcRouteId)

  • createGrpcRouteAsync(String parent, GrpcRoute grpcRoute, String grpcRouteId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createGrpcRouteOperationCallable()

  • createGrpcRouteCallable()

UpdateGrpcRoute

Updates the parameters of a single GrpcRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateGrpcRouteAsync(UpdateGrpcRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateGrpcRouteAsync(GrpcRoute grpcRoute, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateGrpcRouteOperationCallable()

  • updateGrpcRouteCallable()

DeleteGrpcRoute

Deletes a single GrpcRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteGrpcRouteAsync(DeleteGrpcRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteGrpcRouteAsync(GrpcRouteName name)

  • deleteGrpcRouteAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteGrpcRouteOperationCallable()

  • deleteGrpcRouteCallable()

ListHttpRoutes

Lists HttpRoute in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listHttpRoutes(ListHttpRoutesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listHttpRoutes(LocationName parent)

  • listHttpRoutes(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listHttpRoutesPagedCallable()

  • listHttpRoutesCallable()

GetHttpRoute

Gets details of a single HttpRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getHttpRoute(GetHttpRouteRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getHttpRoute(HttpRouteName name)

  • getHttpRoute(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getHttpRouteCallable()

CreateHttpRoute

Creates a new HttpRoute in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createHttpRouteAsync(CreateHttpRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createHttpRouteAsync(LocationName parent, HttpRoute httpRoute, String httpRouteId)

  • createHttpRouteAsync(String parent, HttpRoute httpRoute, String httpRouteId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createHttpRouteOperationCallable()

  • createHttpRouteCallable()

UpdateHttpRoute

Updates the parameters of a single HttpRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateHttpRouteAsync(UpdateHttpRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateHttpRouteAsync(HttpRoute httpRoute, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateHttpRouteOperationCallable()

  • updateHttpRouteCallable()

DeleteHttpRoute

Deletes a single HttpRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteHttpRouteAsync(DeleteHttpRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteHttpRouteAsync(HttpRouteName name)

  • deleteHttpRouteAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteHttpRouteOperationCallable()

  • deleteHttpRouteCallable()

ListTcpRoutes

Lists TcpRoute in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listTcpRoutes(ListTcpRoutesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listTcpRoutes(LocationName parent)

  • listTcpRoutes(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listTcpRoutesPagedCallable()

  • listTcpRoutesCallable()

GetTcpRoute

Gets details of a single TcpRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getTcpRoute(GetTcpRouteRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getTcpRoute(TcpRouteName name)

  • getTcpRoute(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getTcpRouteCallable()

CreateTcpRoute

Creates a new TcpRoute in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createTcpRouteAsync(CreateTcpRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createTcpRouteAsync(LocationName parent, TcpRoute tcpRoute, String tcpRouteId)

  • createTcpRouteAsync(String parent, TcpRoute tcpRoute, String tcpRouteId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createTcpRouteOperationCallable()

  • createTcpRouteCallable()

UpdateTcpRoute

Updates the parameters of a single TcpRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateTcpRouteAsync(UpdateTcpRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateTcpRouteAsync(TcpRoute tcpRoute, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateTcpRouteOperationCallable()

  • updateTcpRouteCallable()

DeleteTcpRoute

Deletes a single TcpRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteTcpRouteAsync(DeleteTcpRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteTcpRouteAsync(TcpRouteName name)

  • deleteTcpRouteAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteTcpRouteOperationCallable()

  • deleteTcpRouteCallable()

ListTlsRoutes

Lists TlsRoute in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listTlsRoutes(ListTlsRoutesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listTlsRoutes(LocationName parent)

  • listTlsRoutes(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listTlsRoutesPagedCallable()

  • listTlsRoutesCallable()

GetTlsRoute

Gets details of a single TlsRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getTlsRoute(GetTlsRouteRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getTlsRoute(TlsRouteName name)

  • getTlsRoute(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getTlsRouteCallable()

CreateTlsRoute

Creates a new TlsRoute in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createTlsRouteAsync(CreateTlsRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createTlsRouteAsync(LocationName parent, TlsRoute tlsRoute, String tlsRouteId)

  • createTlsRouteAsync(String parent, TlsRoute tlsRoute, String tlsRouteId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createTlsRouteOperationCallable()

  • createTlsRouteCallable()

UpdateTlsRoute

Updates the parameters of a single TlsRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateTlsRouteAsync(UpdateTlsRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateTlsRouteAsync(TlsRoute tlsRoute, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateTlsRouteOperationCallable()

  • updateTlsRouteCallable()

DeleteTlsRoute

Deletes a single TlsRoute.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteTlsRouteAsync(DeleteTlsRouteRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteTlsRouteAsync(TlsRouteName name)

  • deleteTlsRouteAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteTlsRouteOperationCallable()

  • deleteTlsRouteCallable()

ListServiceBindings

Lists ServiceBinding in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listServiceBindings(ListServiceBindingsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listServiceBindings(LocationName parent)

  • listServiceBindings(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listServiceBindingsPagedCallable()

  • listServiceBindingsCallable()

GetServiceBinding

Gets details of a single ServiceBinding.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getServiceBinding(GetServiceBindingRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getServiceBinding(ServiceBindingName name)

  • getServiceBinding(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getServiceBindingCallable()

CreateServiceBinding

Creates a new ServiceBinding in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createServiceBindingAsync(CreateServiceBindingRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createServiceBindingAsync(LocationName parent, ServiceBinding serviceBinding, String serviceBindingId)

  • createServiceBindingAsync(String parent, ServiceBinding serviceBinding, String serviceBindingId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createServiceBindingOperationCallable()

  • createServiceBindingCallable()

DeleteServiceBinding

Deletes a single ServiceBinding.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteServiceBindingAsync(DeleteServiceBindingRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteServiceBindingAsync(ServiceBindingName name)

  • deleteServiceBindingAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteServiceBindingOperationCallable()

  • deleteServiceBindingCallable()

ListMeshes

Lists Meshes in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listMeshes(ListMeshesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listMeshes(LocationName parent)

  • listMeshes(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listMeshesPagedCallable()

  • listMeshesCallable()

GetMesh

Gets details of a single Mesh.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getMesh(GetMeshRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getMesh(MeshName name)

  • getMesh(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getMeshCallable()

CreateMesh

Creates a new Mesh in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createMeshAsync(CreateMeshRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createMeshAsync(LocationName parent, Mesh mesh, String meshId)

  • createMeshAsync(String parent, Mesh mesh, String meshId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createMeshOperationCallable()

  • createMeshCallable()

UpdateMesh

Updates the parameters of a single Mesh.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateMeshAsync(UpdateMeshRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • updateMeshAsync(Mesh mesh, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateMeshOperationCallable()

  • updateMeshCallable()

DeleteMesh

Deletes a single Mesh.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteMeshAsync(DeleteMeshRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteMeshAsync(MeshName name)

  • deleteMeshAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteMeshOperationCallable()

  • deleteMeshCallable()

ListLocations

Lists information about the supported locations for this service.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

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.

  • getIamPolicy(GetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

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 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.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • testIamPermissions(TestIamPermissionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

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.

Inheritance

java.lang.Object > NetworkServicesClient

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(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 CreateEndpointPolicyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<EndpointPolicy,OperationMetadata>

createEndpointPolicyAsync(LocationName parent, EndpointPolicy endpointPolicy, String endpointPolicyId)

public final OperationFuture<EndpointPolicy,OperationMetadata> createEndpointPolicyAsync(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 LocationName

Required. The parent resource of the EndpointPolicy. Must be in the format projects/*/locations/global.

endpointPolicy EndpointPolicy

Required. EndpointPolicy resource to be created.

endpointPolicyId String

Required. Short name of the EndpointPolicy resource to be created. E.g. "CustomECS".

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 String

Required. The parent resource of the EndpointPolicy. Must be in the format projects/*/locations/global.

endpointPolicy EndpointPolicy

Required. EndpointPolicy resource to be created.

endpointPolicyId String

Required. 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>

createGatewayAsync(CreateGatewayRequest request)

public final OperationFuture<Gateway,OperationMetadata> createGatewayAsync(CreateGatewayRequest request)

Creates a new Gateway 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()) {
   CreateGatewayRequest request =
       CreateGatewayRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setGatewayId("gatewayId-1354641793")
           .setGateway(Gateway.newBuilder().build())
           .build();
   Gateway response = networkServicesClient.createGatewayAsync(request).get();
 }
 
Parameter
Name Description
request CreateGatewayRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Gateway,OperationMetadata>

createGatewayAsync(LocationName parent, Gateway gateway, String gatewayId)

public final OperationFuture<Gateway,OperationMetadata> createGatewayAsync(LocationName parent, Gateway gateway, String gatewayId)

Creates a new Gateway 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]");
   Gateway gateway = Gateway.newBuilder().build();
   String gatewayId = "gatewayId-1354641793";
   Gateway response = networkServicesClient.createGatewayAsync(parent, gateway, gatewayId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The parent resource of the Gateway. Must be in the format projects/*/locations/*.

gateway Gateway

Required. Gateway resource to be created.

gatewayId String

Required. Short name of the Gateway resource to be created.

Returns
Type Description
OperationFuture<Gateway,OperationMetadata>

createGatewayAsync(String parent, Gateway gateway, String gatewayId)

public final OperationFuture<Gateway,OperationMetadata> createGatewayAsync(String parent, Gateway gateway, String gatewayId)

Creates a new Gateway 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();
   Gateway gateway = Gateway.newBuilder().build();
   String gatewayId = "gatewayId-1354641793";
   Gateway response = networkServicesClient.createGatewayAsync(parent, gateway, gatewayId).get();
 }
 
Parameters
Name Description
parent String

Required. The parent resource of the Gateway. Must be in the format projects/*/locations/*.

gateway Gateway

Required. Gateway resource to be created.

gatewayId String

Required. Short name of the Gateway resource to be created.

Returns
Type Description
OperationFuture<Gateway,OperationMetadata>

createGatewayCallable()

public final UnaryCallable<CreateGatewayRequest,Operation> createGatewayCallable()

Creates a new Gateway 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()) {
   CreateGatewayRequest request =
       CreateGatewayRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setGatewayId("gatewayId-1354641793")
           .setGateway(Gateway.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       networkServicesClient.createGatewayCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateGatewayRequest,Operation>

createGatewayOperationCallable()

public final OperationCallable<CreateGatewayRequest,Gateway,OperationMetadata> createGatewayOperationCallable()

Creates a new Gateway 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()) {
   CreateGatewayRequest request =
       CreateGatewayRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setGatewayId("gatewayId-1354641793")
           .setGateway(Gateway.newBuilder().build())
           .build();
   OperationFuture<Gateway, OperationMetadata> future =
       networkServicesClient.createGatewayOperationCallable().futureCall(request);
   // Do something.
   Gateway response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateGatewayRequest,Gateway,OperationMetadata>

createGrpcRouteAsync(CreateGrpcRouteRequest request)

public final OperationFuture<GrpcRoute,OperationMetadata> createGrpcRouteAsync(CreateGrpcRouteRequest request)

Creates a new GrpcRoute 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()) {
   CreateGrpcRouteRequest request =
       CreateGrpcRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setGrpcRouteId("grpcRouteId1888295750")
           .setGrpcRoute(GrpcRoute.newBuilder().build())
           .build();
   GrpcRoute response = networkServicesClient.createGrpcRouteAsync(request).get();
 }
 
Parameter
Name Description
request CreateGrpcRouteRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<GrpcRoute,OperationMetadata>

createGrpcRouteAsync(LocationName parent, GrpcRoute grpcRoute, String grpcRouteId)

public final OperationFuture<GrpcRoute,OperationMetadata> createGrpcRouteAsync(LocationName parent, GrpcRoute grpcRoute, String grpcRouteId)

Creates a new GrpcRoute 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]");
   GrpcRoute grpcRoute = GrpcRoute.newBuilder().build();
   String grpcRouteId = "grpcRouteId1888295750";
   GrpcRoute response =
       networkServicesClient.createGrpcRouteAsync(parent, grpcRoute, grpcRouteId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The parent resource of the GrpcRoute. Must be in the format projects/*/locations/global.

grpcRoute GrpcRoute

Required. GrpcRoute resource to be created.

grpcRouteId String

Required. Short name of the GrpcRoute resource to be created.

Returns
Type Description
OperationFuture<GrpcRoute,OperationMetadata>

createGrpcRouteAsync(String parent, GrpcRoute grpcRoute, String grpcRouteId)

public final OperationFuture<GrpcRoute,OperationMetadata> createGrpcRouteAsync(String parent, GrpcRoute grpcRoute, String grpcRouteId)

Creates a new GrpcRoute 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();
   GrpcRoute grpcRoute = GrpcRoute.newBuilder().build();
   String grpcRouteId = "grpcRouteId1888295750";
   GrpcRoute response =
       networkServicesClient.createGrpcRouteAsync(parent, grpcRoute, grpcRouteId).get();
 }
 
Parameters
Name Description
parent String

Required. The parent resource of the GrpcRoute. Must be in the format projects/*/locations/global.

grpcRoute GrpcRoute

Required. GrpcRoute resource to be created.

grpcRouteId String

Required. Short name of the GrpcRoute resource to be created.

Returns
Type Description
OperationFuture<GrpcRoute,OperationMetadata>

createGrpcRouteCallable()

public final UnaryCallable<CreateGrpcRouteRequest,Operation> createGrpcRouteCallable()

Creates a new GrpcRoute 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()) {
   CreateGrpcRouteRequest request =
       CreateGrpcRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setGrpcRouteId("grpcRouteId1888295750")
           .setGrpcRoute(GrpcRoute.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       networkServicesClient.createGrpcRouteCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateGrpcRouteRequest,Operation>

createGrpcRouteOperationCallable()

public final OperationCallable<CreateGrpcRouteRequest,GrpcRoute,OperationMetadata> createGrpcRouteOperationCallable()

Creates a new GrpcRoute 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()) {
   CreateGrpcRouteRequest request =
       CreateGrpcRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setGrpcRouteId("grpcRouteId1888295750")
           .setGrpcRoute(GrpcRoute.newBuilder().build())
           .build();
   OperationFuture<GrpcRoute, OperationMetadata> future =
       networkServicesClient.createGrpcRouteOperationCallable().futureCall(request);
   // Do something.
   GrpcRoute response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateGrpcRouteRequest,GrpcRoute,OperationMetadata>

createHttpRouteAsync(CreateHttpRouteRequest request)

public final OperationFuture<HttpRoute,OperationMetadata> createHttpRouteAsync(CreateHttpRouteRequest request)

Creates a new HttpRoute 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()) {
   CreateHttpRouteRequest request =
       CreateHttpRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setHttpRouteId("httpRouteId-2054835300")
           .setHttpRoute(HttpRoute.newBuilder().build())
           .build();
   HttpRoute response = networkServicesClient.createHttpRouteAsync(request).get();
 }
 
Parameter
Name Description
request CreateHttpRouteRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<HttpRoute,OperationMetadata>

createHttpRouteAsync(LocationName parent, HttpRoute httpRoute, String httpRouteId)

public final OperationFuture<HttpRoute,OperationMetadata> createHttpRouteAsync(LocationName parent, HttpRoute httpRoute, String httpRouteId)

Creates a new HttpRoute 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]");
   HttpRoute httpRoute = HttpRoute.newBuilder().build();
   String httpRouteId = "httpRouteId-2054835300";
   HttpRoute response =
       networkServicesClient.createHttpRouteAsync(parent, httpRoute, httpRouteId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The parent resource of the HttpRoute. Must be in the format projects/*/locations/global.

httpRoute HttpRoute

Required. HttpRoute resource to be created.

httpRouteId String

Required. Short name of the HttpRoute resource to be created.

Returns
Type Description
OperationFuture<HttpRoute,OperationMetadata>

createHttpRouteAsync(String parent, HttpRoute httpRoute, String httpRouteId)

public final OperationFuture<HttpRoute,OperationMetadata> createHttpRouteAsync(String parent, HttpRoute httpRoute, String httpRouteId)

Creates a new HttpRoute 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();
   HttpRoute httpRoute = HttpRoute.newBuilder().build();
   String httpRouteId = "httpRouteId-2054835300";
   HttpRoute response =
       networkServicesClient.createHttpRouteAsync(parent, httpRoute, httpRouteId).get();
 }
 
Parameters
Name Description
parent String

Required. The parent resource of the HttpRoute. Must be in the format projects/*/locations/global.

httpRoute HttpRoute

Required. HttpRoute resource to be created.

httpRouteId String

Required. Short name of the HttpRoute resource to be created.

Returns
Type Description
OperationFuture<HttpRoute,OperationMetadata>

createHttpRouteCallable()

public final UnaryCallable<CreateHttpRouteRequest,Operation> createHttpRouteCallable()

Creates a new HttpRoute 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()) {
   CreateHttpRouteRequest request =
       CreateHttpRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setHttpRouteId("httpRouteId-2054835300")
           .setHttpRoute(HttpRoute.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       networkServicesClient.createHttpRouteCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateHttpRouteRequest,Operation>

createHttpRouteOperationCallable()

public final OperationCallable<CreateHttpRouteRequest,HttpRoute,OperationMetadata> createHttpRouteOperationCallable()

Creates a new HttpRoute 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()) {
   CreateHttpRouteRequest request =
       CreateHttpRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setHttpRouteId("httpRouteId-2054835300")
           .setHttpRoute(HttpRoute.newBuilder().build())
           .build();
   OperationFuture<HttpRoute, OperationMetadata> future =
       networkServicesClient.createHttpRouteOperationCallable().futureCall(request);
   // Do something.
   HttpRoute response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateHttpRouteRequest,HttpRoute,OperationMetadata>

createMeshAsync(CreateMeshRequest request)

public final OperationFuture<Mesh,OperationMetadata> createMeshAsync(CreateMeshRequest request)

Creates a new Mesh 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()) {
   CreateMeshRequest request =
       CreateMeshRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setMeshId("meshId-1077585944")
           .setMesh(Mesh.newBuilder().build())
           .build();
   Mesh response = networkServicesClient.createMeshAsync(request).get();
 }
 
Parameter
Name Description
request CreateMeshRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Mesh,OperationMetadata>

createMeshAsync(LocationName parent, Mesh mesh, String meshId)

public final OperationFuture<Mesh,OperationMetadata> createMeshAsync(LocationName parent, Mesh mesh, String meshId)

Creates a new Mesh 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]");
   Mesh mesh = Mesh.newBuilder().build();
   String meshId = "meshId-1077585944";
   Mesh response = networkServicesClient.createMeshAsync(parent, mesh, meshId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The parent resource of the Mesh. Must be in the format projects/*/locations/global.

mesh Mesh

Required. Mesh resource to be created.

meshId String

Required. Short name of the Mesh resource to be created.

Returns
Type Description
OperationFuture<Mesh,OperationMetadata>

createMeshAsync(String parent, Mesh mesh, String meshId)

public final OperationFuture<Mesh,OperationMetadata> createMeshAsync(String parent, Mesh mesh, String meshId)

Creates a new Mesh 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();
   Mesh mesh = Mesh.newBuilder().build();
   String meshId = "meshId-1077585944";
   Mesh response = networkServicesClient.createMeshAsync(parent, mesh, meshId).get();
 }
 
Parameters
Name Description
parent String

Required. The parent resource of the Mesh. Must be in the format projects/*/locations/global.

mesh Mesh

Required. Mesh resource to be created.

meshId String

Required. Short name of the Mesh resource to be created.

Returns
Type Description
OperationFuture<Mesh,OperationMetadata>

createMeshCallable()

public final UnaryCallable<CreateMeshRequest,Operation> createMeshCallable()

Creates a new Mesh 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()) {
   CreateMeshRequest request =
       CreateMeshRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setMeshId("meshId-1077585944")
           .setMesh(Mesh.newBuilder().build())
           .build();
   ApiFuture<Operation> future = networkServicesClient.createMeshCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateMeshRequest,Operation>

createMeshOperationCallable()

public final OperationCallable<CreateMeshRequest,Mesh,OperationMetadata> createMeshOperationCallable()

Creates a new Mesh 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()) {
   CreateMeshRequest request =
       CreateMeshRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setMeshId("meshId-1077585944")
           .setMesh(Mesh.newBuilder().build())
           .build();
   OperationFuture<Mesh, OperationMetadata> future =
       networkServicesClient.createMeshOperationCallable().futureCall(request);
   // Do something.
   Mesh response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateMeshRequest,Mesh,OperationMetadata>

createServiceBindingAsync(CreateServiceBindingRequest request)

public final OperationFuture<ServiceBinding,OperationMetadata> createServiceBindingAsync(CreateServiceBindingRequest request)

Creates a new ServiceBinding 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()) {
   CreateServiceBindingRequest request =
       CreateServiceBindingRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setServiceBindingId("serviceBindingId-1424670901")
           .setServiceBinding(ServiceBinding.newBuilder().build())
           .build();
   ServiceBinding response = networkServicesClient.createServiceBindingAsync(request).get();
 }
 
Parameter
Name Description
request CreateServiceBindingRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<ServiceBinding,OperationMetadata>

createServiceBindingAsync(LocationName parent, ServiceBinding serviceBinding, String serviceBindingId)

public final OperationFuture<ServiceBinding,OperationMetadata> createServiceBindingAsync(LocationName parent, ServiceBinding serviceBinding, String serviceBindingId)

Creates a new ServiceBinding 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]");
   ServiceBinding serviceBinding = ServiceBinding.newBuilder().build();
   String serviceBindingId = "serviceBindingId-1424670901";
   ServiceBinding response =
       networkServicesClient
           .createServiceBindingAsync(parent, serviceBinding, serviceBindingId)
           .get();
 }
 
Parameters
Name Description
parent LocationName

Required. The parent resource of the ServiceBinding. Must be in the format projects/*/locations/global.

serviceBinding ServiceBinding

Required. ServiceBinding resource to be created.

serviceBindingId String

Required. Short name of the ServiceBinding resource to be created.

Returns
Type Description
OperationFuture<ServiceBinding,OperationMetadata>

createServiceBindingAsync(String parent, ServiceBinding serviceBinding, String serviceBindingId)

public final OperationFuture<ServiceBinding,OperationMetadata> createServiceBindingAsync(String parent, ServiceBinding serviceBinding, String serviceBindingId)

Creates a new ServiceBinding 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();
   ServiceBinding serviceBinding = ServiceBinding.newBuilder().build();
   String serviceBindingId = "serviceBindingId-1424670901";
   ServiceBinding response =
       networkServicesClient
           .createServiceBindingAsync(parent, serviceBinding, serviceBindingId)
           .get();
 }
 
Parameters
Name Description
parent String

Required. The parent resource of the ServiceBinding. Must be in the format projects/*/locations/global.

serviceBinding ServiceBinding

Required. ServiceBinding resource to be created.

serviceBindingId String

Required. Short name of the ServiceBinding resource to be created.

Returns
Type Description
OperationFuture<ServiceBinding,OperationMetadata>

createServiceBindingCallable()

public final UnaryCallable<CreateServiceBindingRequest,Operation> createServiceBindingCallable()

Creates a new ServiceBinding 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()) {
   CreateServiceBindingRequest request =
       CreateServiceBindingRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setServiceBindingId("serviceBindingId-1424670901")
           .setServiceBinding(ServiceBinding.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       networkServicesClient.createServiceBindingCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateServiceBindingRequest,Operation>

createServiceBindingOperationCallable()

public final OperationCallable<CreateServiceBindingRequest,ServiceBinding,OperationMetadata> createServiceBindingOperationCallable()

Creates a new ServiceBinding 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()) {
   CreateServiceBindingRequest request =
       CreateServiceBindingRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setServiceBindingId("serviceBindingId-1424670901")
           .setServiceBinding(ServiceBinding.newBuilder().build())
           .build();
   OperationFuture<ServiceBinding, OperationMetadata> future =
       networkServicesClient.createServiceBindingOperationCallable().futureCall(request);
   // Do something.
   ServiceBinding response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateServiceBindingRequest,ServiceBinding,OperationMetadata>

createTcpRouteAsync(CreateTcpRouteRequest request)

public final OperationFuture<TcpRoute,OperationMetadata> createTcpRouteAsync(CreateTcpRouteRequest request)

Creates a new TcpRoute 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()) {
   CreateTcpRouteRequest request =
       CreateTcpRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTcpRouteId("tcpRouteId806467107")
           .setTcpRoute(TcpRoute.newBuilder().build())
           .build();
   TcpRoute response = networkServicesClient.createTcpRouteAsync(request).get();
 }
 
Parameter
Name Description
request CreateTcpRouteRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<TcpRoute,OperationMetadata>

createTcpRouteAsync(LocationName parent, TcpRoute tcpRoute, String tcpRouteId)

public final OperationFuture<TcpRoute,OperationMetadata> createTcpRouteAsync(LocationName parent, TcpRoute tcpRoute, String tcpRouteId)

Creates a new TcpRoute 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]");
   TcpRoute tcpRoute = TcpRoute.newBuilder().build();
   String tcpRouteId = "tcpRouteId806467107";
   TcpRoute response =
       networkServicesClient.createTcpRouteAsync(parent, tcpRoute, tcpRouteId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The parent resource of the TcpRoute. Must be in the format projects/*/locations/global.

tcpRoute TcpRoute

Required. TcpRoute resource to be created.

tcpRouteId String

Required. Short name of the TcpRoute resource to be created.

Returns
Type Description
OperationFuture<TcpRoute,OperationMetadata>

createTcpRouteAsync(String parent, TcpRoute tcpRoute, String tcpRouteId)

public final OperationFuture<TcpRoute,OperationMetadata> createTcpRouteAsync(String parent, TcpRoute tcpRoute, String tcpRouteId)

Creates a new TcpRoute 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();
   TcpRoute tcpRoute = TcpRoute.newBuilder().build();
   String tcpRouteId = "tcpRouteId806467107";
   TcpRoute response =
       networkServicesClient.createTcpRouteAsync(parent, tcpRoute, tcpRouteId).get();
 }
 
Parameters
Name Description
parent String

Required. The parent resource of the TcpRoute. Must be in the format projects/*/locations/global.

tcpRoute TcpRoute

Required. TcpRoute resource to be created.

tcpRouteId String

Required. Short name of the TcpRoute resource to be created.

Returns
Type Description
OperationFuture<TcpRoute,OperationMetadata>

createTcpRouteCallable()

public final UnaryCallable<CreateTcpRouteRequest,Operation> createTcpRouteCallable()

Creates a new TcpRoute 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()) {
   CreateTcpRouteRequest request =
       CreateTcpRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTcpRouteId("tcpRouteId806467107")
           .setTcpRoute(TcpRoute.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       networkServicesClient.createTcpRouteCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateTcpRouteRequest,Operation>

createTcpRouteOperationCallable()

public final OperationCallable<CreateTcpRouteRequest,TcpRoute,OperationMetadata> createTcpRouteOperationCallable()

Creates a new TcpRoute 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()) {
   CreateTcpRouteRequest request =
       CreateTcpRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTcpRouteId("tcpRouteId806467107")
           .setTcpRoute(TcpRoute.newBuilder().build())
           .build();
   OperationFuture<TcpRoute, OperationMetadata> future =
       networkServicesClient.createTcpRouteOperationCallable().futureCall(request);
   // Do something.
   TcpRoute response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateTcpRouteRequest,TcpRoute,OperationMetadata>

createTlsRouteAsync(CreateTlsRouteRequest request)

public final OperationFuture<TlsRoute,OperationMetadata> createTlsRouteAsync(CreateTlsRouteRequest request)

Creates a new TlsRoute 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()) {
   CreateTlsRouteRequest request =
       CreateTlsRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTlsRouteId("tlsRouteId-1642257463")
           .setTlsRoute(TlsRoute.newBuilder().build())
           .build();
   TlsRoute response = networkServicesClient.createTlsRouteAsync(request).get();
 }
 
Parameter
Name Description
request CreateTlsRouteRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<TlsRoute,OperationMetadata>

createTlsRouteAsync(LocationName parent, TlsRoute tlsRoute, String tlsRouteId)

public final OperationFuture<TlsRoute,OperationMetadata> createTlsRouteAsync(LocationName parent, TlsRoute tlsRoute, String tlsRouteId)

Creates a new TlsRoute 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]");
   TlsRoute tlsRoute = TlsRoute.newBuilder().build();
   String tlsRouteId = "tlsRouteId-1642257463";
   TlsRoute response =
       networkServicesClient.createTlsRouteAsync(parent, tlsRoute, tlsRouteId).get();
 }
 
Parameters
Name Description
parent LocationName

Required. The parent resource of the TlsRoute. Must be in the format projects/*/locations/global.

tlsRoute TlsRoute

Required. TlsRoute resource to be created.

tlsRouteId String

Required. Short name of the TlsRoute resource to be created.

Returns
Type Description
OperationFuture<TlsRoute,OperationMetadata>

createTlsRouteAsync(String parent, TlsRoute tlsRoute, String tlsRouteId)

public final OperationFuture<TlsRoute,OperationMetadata> createTlsRouteAsync(String parent, TlsRoute tlsRoute, String tlsRouteId)

Creates a new TlsRoute 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();
   TlsRoute tlsRoute = TlsRoute.newBuilder().build();
   String tlsRouteId = "tlsRouteId-1642257463";
   TlsRoute response =
       networkServicesClient.createTlsRouteAsync(parent, tlsRoute, tlsRouteId).get();
 }
 
Parameters
Name Description
parent String

Required. The parent resource of the TlsRoute. Must be in the format projects/*/locations/global.

tlsRoute TlsRoute

Required. TlsRoute resource to be created.

tlsRouteId String

Required. Short name of the TlsRoute resource to be created.

Returns
Type Description
OperationFuture<TlsRoute,OperationMetadata>

createTlsRouteCallable()

public final UnaryCallable<CreateTlsRouteRequest,Operation> createTlsRouteCallable()

Creates a new TlsRoute 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()) {
   CreateTlsRouteRequest request =
       CreateTlsRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTlsRouteId("tlsRouteId-1642257463")
           .setTlsRoute(TlsRoute.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       networkServicesClient.createTlsRouteCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateTlsRouteRequest,Operation>

createTlsRouteOperationCallable()

public final OperationCallable<CreateTlsRouteRequest,TlsRoute,OperationMetadata> createTlsRouteOperationCallable()

Creates a new TlsRoute 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()) {
   CreateTlsRouteRequest request =
       CreateTlsRouteRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setTlsRouteId("tlsRouteId-1642257463")
           .setTlsRoute(TlsRoute.newBuilder().build())
           .build();
   OperationFuture<TlsRoute, OperationMetadata> future =
       networkServicesClient.createTlsRouteOperationCallable().futureCall(request);
   // Do something.
   TlsRoute response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateTlsRouteRequest,TlsRoute,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 DeleteEndpointPolicyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteEndpointPolicyAsync(EndpointPolicyName name)

public final OperationFuture<Empty,OperationMetadata> deleteEndpointPolicyAsync(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 EndpointPolicyName

Required. A name of the EndpointPolicy to delete. Must be in the format projects/*/locations/global/endpointPolicies/*.

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 String

Required. A name of the EndpointPolicy to delete. Must be in the format projects/*/locations/global/endpointPolicies/*.

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>

deleteGatewayAsync(DeleteGatewayRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteGatewayAsync(DeleteGatewayRequest request)

Deletes a single Gateway.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   DeleteGatewayRequest request =
       DeleteGatewayRequest.newBuilder()
           .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString())
           .build();
   networkServicesClient.deleteGatewayAsync(request).get();
 }
 
Parameter
Name Description
request DeleteGatewayRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteGatewayAsync(GatewayName name)

public final OperationFuture<Empty,OperationMetadata> deleteGatewayAsync(GatewayName name)

Deletes a single Gateway.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   GatewayName name = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]");
   networkServicesClient.deleteGatewayAsync(name).get();
 }
 
Parameter
Name Description
name GatewayName

Required. A name of the Gateway to delete. Must be in the format projects/*/locations/*/gateways/*.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteGatewayAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteGatewayAsync(String name)

Deletes a single Gateway.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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 = GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString();
   networkServicesClient.deleteGatewayAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. A name of the Gateway to delete. Must be in the format projects/*/locations/*/gateways/*.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteGatewayCallable()

public final UnaryCallable<DeleteGatewayRequest,Operation> deleteGatewayCallable()

Deletes a single Gateway.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   DeleteGatewayRequest request =
       DeleteGatewayRequest.newBuilder()
           .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString())
           .build();
   ApiFuture<Operation> future =
       networkServicesClient.deleteGatewayCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteGatewayRequest,Operation>

deleteGatewayOperationCallable()

public final OperationCallable<DeleteGatewayRequest,Empty,OperationMetadata> deleteGatewayOperationCallable()

Deletes a single Gateway.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   DeleteGatewayRequest request =
       DeleteGatewayRequest.newBuilder()
           .setName(GatewayName.of("[PROJECT]", "[LOCATION]", "[GATEWAY]").toString())
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       networkServicesClient.deleteGatewayOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteGatewayRequest,Empty,OperationMetadata>

deleteGrpcRouteAsync(DeleteGrpcRouteRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteGrpcRouteAsync(DeleteGrpcRouteRequest request)

Deletes a single GrpcRoute.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   DeleteGrpcRouteRequest request =
       DeleteGrpcRouteRequest.newBuilder()
           .setName(GrpcRouteName.of("[PROJECT]", "[LOCATION]", "[GRPC_ROUTE]").toString())
           .build();
   networkServicesClient.deleteGrpcRouteAsync(request).get();
 }
 
Parameter
Name Description
request DeleteGrpcRouteRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteGrpcRouteAsync(GrpcRouteName name)

public final OperationFuture<Empty,OperationMetadata> deleteGrpcRouteAsync(GrpcRouteName name)

Deletes a single GrpcRoute.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   GrpcRouteName name = GrpcRouteName.of("[PROJECT]", "[LOCATION]", "[GRPC_ROUTE]");
   networkServicesClient.deleteGrpcRouteAsync(name).get();
 }
 
Parameter
Name Description
name GrpcRouteName

Required. A name of the GrpcRoute to delete. Must be in the format projects/*/locations/global/grpcRoutes/*.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteGrpcRouteAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteGrpcRouteAsync(String name)

Deletes a single GrpcRoute.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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 = GrpcRouteName.of("[PROJECT]", "[LOCATION]", "[GRPC_ROUTE]").toString();
   networkServicesClient.deleteGrpcRouteAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. A name of the GrpcRoute to delete. Must be in the format projects/*/locations/global/grpcRoutes/*.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteGrpcRouteCallable()

public final UnaryCallable<DeleteGrpcRouteRequest,Operation> deleteGrpcRouteCallable()

Deletes a single GrpcRoute.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   DeleteGrpcRouteRequest request =
       DeleteGrpcRouteRequest.newBuilder()
           .setName(GrpcRouteName.of("[PROJECT]", "[LOCATION]", "[GRPC_ROUTE]").toString())
           .build();
   ApiFuture<Operation> future =
       networkServicesClient.deleteGrpcRouteCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteGrpcRouteRequest,Operation>

deleteGrpcRouteOperationCallable()

public final OperationCallable<DeleteGrpcRouteRequest,Empty,OperationMetadata> deleteGrpcRouteOperationCallable()

Deletes a single GrpcRoute.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   DeleteGrpcRouteRequest request =
       DeleteGrpcRouteRequest.newBuilder()
           .setName(GrpcRouteName.of("[PROJECT]", "[LOCATION]", "[GRPC_ROUTE]").toString())
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       networkServicesClient.deleteGrpcRouteOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteGrpcRouteRequest,Empty,OperationMetadata>

deleteHttpRouteAsync(DeleteHttpRouteRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteHttpRouteAsync(DeleteHttpRouteRequest request)

Deletes a single HttpRoute.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   DeleteHttpRouteRequest request =
       DeleteHttpRouteRequest.newBuilder()
           .setName(HttpRouteName.of("[PROJECT]", "[LOCATION]", "[HTTP_ROUTE]").toString())
           .build();
   networkServicesClient.deleteHttpRouteAsync(request).get();
 }
 
Parameter
Name Description
request DeleteHttpRouteRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteHttpRouteAsync(HttpRouteName name)

public final OperationFuture<Empty,OperationMetadata> deleteHttpRouteAsync(HttpRouteName name)

Deletes a single HttpRoute.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   HttpRouteName name = HttpRouteName.of("[PROJECT]", "[LOCATION]", "[HTTP_ROUTE]");
   networkServicesClient.deleteHttpRouteAsync(name).get();
 }
 
Parameter
Name Description
name HttpRouteName

Required. A name of the HttpRoute to delete. Must be in the format projects/*/locations/global/httpRoutes/*.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteHttpRouteAsync(String name)

public final OperationFuture<Empty,OperationMetadata> deleteHttpRouteAsync(String name)

Deletes a single HttpRoute.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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 = HttpRouteName.of("[PROJECT]", "[LOCATION]", "[HTTP_ROUTE]").toString();
   networkServicesClient.deleteHttpRouteAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. A name of the HttpRoute to delete. Must be in the format projects/*/locations/global/httpRoutes/*.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteHttpRouteCallable()

public final UnaryCallable<DeleteHttpRouteRequest,Operation> deleteHttpRouteCallable()

Deletes a single HttpRoute.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying 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()) {
   DeleteHttpRouteRequest request =
       DeleteHttpRouteRequest.newBuilder()
           .setName(HttpRouteName.of("[PROJECT]", "[LOCATION]", "[HTTP_ROUTE]").toString())
           .build