Class NetworkSecurityClient (0.55.0)
Stay organized with collections
Save and categorize content based on your preferences.
- 0.81.0 (latest)
- 0.79.0
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.0
- 0.73.0
- 0.71.0
- 0.70.0
- 0.67.0
- 0.66.0
- 0.65.0
- 0.63.0
- 0.62.0
- 0.61.0
- 0.60.0
- 0.59.0
- 0.58.0
- 0.57.0
- 0.56.0
- 0.55.0
- 0.54.0
- 0.52.0
- 0.51.0
- 0.50.0
- 0.49.0
- 0.48.0
- 0.47.0
- 0.46.0
- 0.45.0
- 0.44.0
- 0.43.0
- 0.42.0
- 0.40.0
- 0.39.0
- 0.38.0
- 0.37.0
- 0.36.0
- 0.35.0
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.21.0
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.4
- 0.5.1
- 0.4.4
Service Description: Network Security API provides resources to configure authentication and authorization policies. Refer to per API resource documentation for more information.
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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
AuthorizationPolicyNamename=
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]");
AuthorizationPolicyresponse=networkSecurityClient.getAuthorizationPolicy(name);
}
Note: close() needs to be called on the NetworkSecurityClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListAuthorizationPolicies |
Lists AuthorizationPolicies in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetAuthorizationPolicy |
Gets details of a single AuthorizationPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateAuthorizationPolicy |
Creates a new AuthorizationPolicy in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateAuthorizationPolicy |
Updates the parameters of a single AuthorizationPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteAuthorizationPolicy |
Deletes a single AuthorizationPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListServerTlsPolicies |
Lists ServerTlsPolicies in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetServerTlsPolicy |
Gets details of a single ServerTlsPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateServerTlsPolicy |
Creates a new ServerTlsPolicy in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateServerTlsPolicy |
Updates the parameters of a single ServerTlsPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteServerTlsPolicy |
Deletes a single ServerTlsPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListClientTlsPolicies |
Lists ClientTlsPolicies in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetClientTlsPolicy |
Gets details of a single ClientTlsPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateClientTlsPolicy |
Creates a new ClientTlsPolicy in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateClientTlsPolicy |
Updates the parameters of a single ClientTlsPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteClientTlsPolicy |
Deletes a single ClientTlsPolicy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of NetworkSecuritySettings 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
NetworkSecuritySettingsnetworkSecuritySettings=
NetworkSecuritySettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
NetworkSecurityClientnetworkSecurityClient=
NetworkSecurityClient.create(networkSecuritySettings);
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
NetworkSecuritySettingsnetworkSecuritySettings=
NetworkSecuritySettings.newBuilder().setEndpoint(myEndpoint).build();
NetworkSecurityClientnetworkSecurityClient=
NetworkSecurityClient.create(networkSecuritySettings);
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
NetworkSecuritySettingsnetworkSecuritySettings=
NetworkSecuritySettings.newHttpJsonBuilder().build();
NetworkSecurityClientnetworkSecurityClient=
NetworkSecurityClient.create(networkSecuritySettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
publicstaticfinalNetworkSecurityClientcreate()Constructs an instance of NetworkSecurityClient with default settings.
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(NetworkSecuritySettings settings)
publicstaticfinalNetworkSecurityClientcreate(NetworkSecuritySettingssettings)Constructs an instance of NetworkSecurityClient, 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 |
NetworkSecuritySettings |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(NetworkSecurityStub stub)
publicstaticfinalNetworkSecurityClientcreate(NetworkSecurityStubstub)Constructs an instance of NetworkSecurityClient, using the given stub for making calls. This is for advanced usage - prefer using create(NetworkSecuritySettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
NetworkSecurityStub |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient |
|
Constructors
NetworkSecurityClient(NetworkSecuritySettings settings)
protectedNetworkSecurityClient(NetworkSecuritySettingssettings)Constructs an instance of NetworkSecurityClient, 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 |
NetworkSecuritySettings |
NetworkSecurityClient(NetworkSecurityStub stub)
protectedNetworkSecurityClient(NetworkSecurityStubstub)| Parameter | |
|---|---|
| Name | Description |
stub |
NetworkSecurityStub |
Methods
awaitTermination(long duration, TimeUnit unit)
publicbooleanawaitTermination(longduration,TimeUnitunit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
publicfinalvoidclose()createAuthorizationPolicyAsync(CreateAuthorizationPolicyRequest request)
publicfinalOperationFuture<AuthorizationPolicy,OperationMetadata>createAuthorizationPolicyAsync(CreateAuthorizationPolicyRequestrequest)Creates a new AuthorizationPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
CreateAuthorizationPolicyRequestrequest=
CreateAuthorizationPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setAuthorizationPolicyId("authorizationPolicyId1314252166")
.setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
.build();
AuthorizationPolicyresponse=
networkSecurityClient.createAuthorizationPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateAuthorizationPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AuthorizationPolicy,OperationMetadata> |
|
createAuthorizationPolicyAsync(LocationName parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId)
publicfinalOperationFuture<AuthorizationPolicy,OperationMetadata>createAuthorizationPolicyAsync(LocationNameparent,AuthorizationPolicyauthorizationPolicy,StringauthorizationPolicyId)Creates a new AuthorizationPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
AuthorizationPolicyauthorizationPolicy=AuthorizationPolicy.newBuilder().build();
StringauthorizationPolicyId="authorizationPolicyId1314252166";
AuthorizationPolicyresponse=
networkSecurityClient
.createAuthorizationPolicyAsync(parent,authorizationPolicy,authorizationPolicyId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationName Required. The parent resource of the AuthorizationPolicy. Must be in the format
|
authorizationPolicy |
AuthorizationPolicy Required. AuthorizationPolicy resource to be created. |
authorizationPolicyId |
String Required. Short name of the AuthorizationPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AuthorizationPolicy,OperationMetadata> |
|
createAuthorizationPolicyAsync(String parent, AuthorizationPolicy authorizationPolicy, String authorizationPolicyId)
publicfinalOperationFuture<AuthorizationPolicy,OperationMetadata>createAuthorizationPolicyAsync(Stringparent,AuthorizationPolicyauthorizationPolicy,StringauthorizationPolicyId)Creates a new AuthorizationPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
AuthorizationPolicyauthorizationPolicy=AuthorizationPolicy.newBuilder().build();
StringauthorizationPolicyId="authorizationPolicyId1314252166";
AuthorizationPolicyresponse=
networkSecurityClient
.createAuthorizationPolicyAsync(parent,authorizationPolicy,authorizationPolicyId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
String Required. The parent resource of the AuthorizationPolicy. Must be in the format
|
authorizationPolicy |
AuthorizationPolicy Required. AuthorizationPolicy resource to be created. |
authorizationPolicyId |
String Required. Short name of the AuthorizationPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "authz_policy". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AuthorizationPolicy,OperationMetadata> |
|
createAuthorizationPolicyCallable()
publicfinalUnaryCallable<CreateAuthorizationPolicyRequest,Operation>createAuthorizationPolicyCallable()Creates a new AuthorizationPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
CreateAuthorizationPolicyRequestrequest=
CreateAuthorizationPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setAuthorizationPolicyId("authorizationPolicyId1314252166")
.setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
.build();
ApiFuture<Operation>future=
networkSecurityClient.createAuthorizationPolicyCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateAuthorizationPolicyRequest,Operation> |
|
createAuthorizationPolicyOperationCallable()
publicfinalOperationCallable<CreateAuthorizationPolicyRequest,AuthorizationPolicy,OperationMetadata>createAuthorizationPolicyOperationCallable()Creates a new AuthorizationPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
CreateAuthorizationPolicyRequestrequest=
CreateAuthorizationPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setAuthorizationPolicyId("authorizationPolicyId1314252166")
.setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
.build();
OperationFuture<AuthorizationPolicy,OperationMetadata>future=
networkSecurityClient.createAuthorizationPolicyOperationCallable().futureCall(request);
// Do something.
AuthorizationPolicyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateAuthorizationPolicyRequest,AuthorizationPolicy,OperationMetadata> |
|
createClientTlsPolicyAsync(CreateClientTlsPolicyRequest request)
publicfinalOperationFuture<ClientTlsPolicy,OperationMetadata>createClientTlsPolicyAsync(CreateClientTlsPolicyRequestrequest)Creates a new ClientTlsPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
CreateClientTlsPolicyRequestrequest=
CreateClientTlsPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setClientTlsPolicyId("clientTlsPolicyId-188933315")
.setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
.build();
ClientTlsPolicyresponse=networkSecurityClient.createClientTlsPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateClientTlsPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ClientTlsPolicy,OperationMetadata> |
|
createClientTlsPolicyAsync(LocationName parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId)
publicfinalOperationFuture<ClientTlsPolicy,OperationMetadata>createClientTlsPolicyAsync(LocationNameparent,ClientTlsPolicyclientTlsPolicy,StringclientTlsPolicyId)Creates a new ClientTlsPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
ClientTlsPolicyclientTlsPolicy=ClientTlsPolicy.newBuilder().build();
StringclientTlsPolicyId="clientTlsPolicyId-188933315";
ClientTlsPolicyresponse=
networkSecurityClient
.createClientTlsPolicyAsync(parent,clientTlsPolicy,clientTlsPolicyId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationName Required. The parent resource of the ClientTlsPolicy. Must be in the format
|
clientTlsPolicy |
ClientTlsPolicy Required. ClientTlsPolicy resource to be created. |
clientTlsPolicyId |
String Required. Short name of the ClientTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "client_mtls_policy". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ClientTlsPolicy,OperationMetadata> |
|
createClientTlsPolicyAsync(String parent, ClientTlsPolicy clientTlsPolicy, String clientTlsPolicyId)
publicfinalOperationFuture<ClientTlsPolicy,OperationMetadata>createClientTlsPolicyAsync(Stringparent,ClientTlsPolicyclientTlsPolicy,StringclientTlsPolicyId)Creates a new ClientTlsPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
ClientTlsPolicyclientTlsPolicy=ClientTlsPolicy.newBuilder().build();
StringclientTlsPolicyId="clientTlsPolicyId-188933315";
ClientTlsPolicyresponse=
networkSecurityClient
.createClientTlsPolicyAsync(parent,clientTlsPolicy,clientTlsPolicyId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
String Required. The parent resource of the ClientTlsPolicy. Must be in the format
|
clientTlsPolicy |
ClientTlsPolicy Required. ClientTlsPolicy resource to be created. |
clientTlsPolicyId |
String Required. Short name of the ClientTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "client_mtls_policy". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ClientTlsPolicy,OperationMetadata> |
|
createClientTlsPolicyCallable()
publicfinalUnaryCallable<CreateClientTlsPolicyRequest,Operation>createClientTlsPolicyCallable()Creates a new ClientTlsPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
CreateClientTlsPolicyRequestrequest=
CreateClientTlsPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setClientTlsPolicyId("clientTlsPolicyId-188933315")
.setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
.build();
ApiFuture<Operation>future=
networkSecurityClient.createClientTlsPolicyCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateClientTlsPolicyRequest,Operation> |
|
createClientTlsPolicyOperationCallable()
publicfinalOperationCallable<CreateClientTlsPolicyRequest,ClientTlsPolicy,OperationMetadata>createClientTlsPolicyOperationCallable()Creates a new ClientTlsPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
CreateClientTlsPolicyRequestrequest=
CreateClientTlsPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setClientTlsPolicyId("clientTlsPolicyId-188933315")
.setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
.build();
OperationFuture<ClientTlsPolicy,OperationMetadata>future=
networkSecurityClient.createClientTlsPolicyOperationCallable().futureCall(request);
// Do something.
ClientTlsPolicyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateClientTlsPolicyRequest,ClientTlsPolicy,OperationMetadata> |
|
createServerTlsPolicyAsync(CreateServerTlsPolicyRequest request)
publicfinalOperationFuture<ServerTlsPolicy,OperationMetadata>createServerTlsPolicyAsync(CreateServerTlsPolicyRequestrequest)Creates a new ServerTlsPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
CreateServerTlsPolicyRequestrequest=
CreateServerTlsPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setServerTlsPolicyId("serverTlsPolicyId-1966046011")
.setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
.build();
ServerTlsPolicyresponse=networkSecurityClient.createServerTlsPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateServerTlsPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ServerTlsPolicy,OperationMetadata> |
|
createServerTlsPolicyAsync(LocationName parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId)
publicfinalOperationFuture<ServerTlsPolicy,OperationMetadata>createServerTlsPolicyAsync(LocationNameparent,ServerTlsPolicyserverTlsPolicy,StringserverTlsPolicyId)Creates a new ServerTlsPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
ServerTlsPolicyserverTlsPolicy=ServerTlsPolicy.newBuilder().build();
StringserverTlsPolicyId="serverTlsPolicyId-1966046011";
ServerTlsPolicyresponse=
networkSecurityClient
.createServerTlsPolicyAsync(parent,serverTlsPolicy,serverTlsPolicyId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationName Required. The parent resource of the ServerTlsPolicy. Must be in the format
|
serverTlsPolicy |
ServerTlsPolicy Required. ServerTlsPolicy resource to be created. |
serverTlsPolicyId |
String Required. Short name of the ServerTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "server_mtls_policy". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ServerTlsPolicy,OperationMetadata> |
|
createServerTlsPolicyAsync(String parent, ServerTlsPolicy serverTlsPolicy, String serverTlsPolicyId)
publicfinalOperationFuture<ServerTlsPolicy,OperationMetadata>createServerTlsPolicyAsync(Stringparent,ServerTlsPolicyserverTlsPolicy,StringserverTlsPolicyId)Creates a new ServerTlsPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
ServerTlsPolicyserverTlsPolicy=ServerTlsPolicy.newBuilder().build();
StringserverTlsPolicyId="serverTlsPolicyId-1966046011";
ServerTlsPolicyresponse=
networkSecurityClient
.createServerTlsPolicyAsync(parent,serverTlsPolicy,serverTlsPolicyId)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
String Required. The parent resource of the ServerTlsPolicy. Must be in the format
|
serverTlsPolicy |
ServerTlsPolicy Required. ServerTlsPolicy resource to be created. |
serverTlsPolicyId |
String Required. Short name of the ServerTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "server_mtls_policy". |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ServerTlsPolicy,OperationMetadata> |
|
createServerTlsPolicyCallable()
publicfinalUnaryCallable<CreateServerTlsPolicyRequest,Operation>createServerTlsPolicyCallable()Creates a new ServerTlsPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
CreateServerTlsPolicyRequestrequest=
CreateServerTlsPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setServerTlsPolicyId("serverTlsPolicyId-1966046011")
.setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
.build();
ApiFuture<Operation>future=
networkSecurityClient.createServerTlsPolicyCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateServerTlsPolicyRequest,Operation> |
|
createServerTlsPolicyOperationCallable()
publicfinalOperationCallable<CreateServerTlsPolicyRequest,ServerTlsPolicy,OperationMetadata>createServerTlsPolicyOperationCallable()Creates a new ServerTlsPolicy 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
CreateServerTlsPolicyRequestrequest=
CreateServerTlsPolicyRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setServerTlsPolicyId("serverTlsPolicyId-1966046011")
.setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
.build();
OperationFuture<ServerTlsPolicy,OperationMetadata>future=
networkSecurityClient.createServerTlsPolicyOperationCallable().futureCall(request);
// Do something.
ServerTlsPolicyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateServerTlsPolicyRequest,ServerTlsPolicy,OperationMetadata> |
|
deleteAuthorizationPolicyAsync(AuthorizationPolicyName name)
publicfinalOperationFuture<Empty,OperationMetadata>deleteAuthorizationPolicyAsync(AuthorizationPolicyNamename)Deletes a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
AuthorizationPolicyNamename=
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]");
networkSecurityClient.deleteAuthorizationPolicyAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
AuthorizationPolicyName Required. A name of the AuthorizationPolicy to delete. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteAuthorizationPolicyAsync(DeleteAuthorizationPolicyRequest request)
publicfinalOperationFuture<Empty,OperationMetadata>deleteAuthorizationPolicyAsync(DeleteAuthorizationPolicyRequestrequest)Deletes a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
DeleteAuthorizationPolicyRequestrequest=
DeleteAuthorizationPolicyRequest.newBuilder()
.setName(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.build();
networkSecurityClient.deleteAuthorizationPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteAuthorizationPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteAuthorizationPolicyAsync(String name)
publicfinalOperationFuture<Empty,OperationMetadata>deleteAuthorizationPolicyAsync(Stringname)Deletes a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringname=
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString();
networkSecurityClient.deleteAuthorizationPolicyAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
String Required. A name of the AuthorizationPolicy to delete. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteAuthorizationPolicyCallable()
publicfinalUnaryCallable<DeleteAuthorizationPolicyRequest,Operation>deleteAuthorizationPolicyCallable()Deletes a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
DeleteAuthorizationPolicyRequestrequest=
DeleteAuthorizationPolicyRequest.newBuilder()
.setName(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.build();
ApiFuture<Operation>future=
networkSecurityClient.deleteAuthorizationPolicyCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteAuthorizationPolicyRequest,Operation> |
|
deleteAuthorizationPolicyOperationCallable()
publicfinalOperationCallable<DeleteAuthorizationPolicyRequest,Empty,OperationMetadata>deleteAuthorizationPolicyOperationCallable()Deletes a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
DeleteAuthorizationPolicyRequestrequest=
DeleteAuthorizationPolicyRequest.newBuilder()
.setName(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.build();
OperationFuture<Empty,OperationMetadata>future=
networkSecurityClient.deleteAuthorizationPolicyOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteAuthorizationPolicyRequest,Empty,OperationMetadata> |
|
deleteClientTlsPolicyAsync(ClientTlsPolicyName name)
publicfinalOperationFuture<Empty,OperationMetadata>deleteClientTlsPolicyAsync(ClientTlsPolicyNamename)Deletes a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ClientTlsPolicyNamename=
ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]");
networkSecurityClient.deleteClientTlsPolicyAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
ClientTlsPolicyName Required. A name of the ClientTlsPolicy to delete. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteClientTlsPolicyAsync(DeleteClientTlsPolicyRequest request)
publicfinalOperationFuture<Empty,OperationMetadata>deleteClientTlsPolicyAsync(DeleteClientTlsPolicyRequestrequest)Deletes a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
DeleteClientTlsPolicyRequestrequest=
DeleteClientTlsPolicyRequest.newBuilder()
.setName(
ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]")
.toString())
.build();
networkSecurityClient.deleteClientTlsPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteClientTlsPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteClientTlsPolicyAsync(String name)
publicfinalOperationFuture<Empty,OperationMetadata>deleteClientTlsPolicyAsync(Stringname)Deletes a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringname=
ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]").toString();
networkSecurityClient.deleteClientTlsPolicyAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
String Required. A name of the ClientTlsPolicy to delete. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteClientTlsPolicyCallable()
publicfinalUnaryCallable<DeleteClientTlsPolicyRequest,Operation>deleteClientTlsPolicyCallable()Deletes a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
DeleteClientTlsPolicyRequestrequest=
DeleteClientTlsPolicyRequest.newBuilder()
.setName(
ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]")
.toString())
.build();
ApiFuture<Operation>future=
networkSecurityClient.deleteClientTlsPolicyCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteClientTlsPolicyRequest,Operation> |
|
deleteClientTlsPolicyOperationCallable()
publicfinalOperationCallable<DeleteClientTlsPolicyRequest,Empty,OperationMetadata>deleteClientTlsPolicyOperationCallable()Deletes a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
DeleteClientTlsPolicyRequestrequest=
DeleteClientTlsPolicyRequest.newBuilder()
.setName(
ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]")
.toString())
.build();
OperationFuture<Empty,OperationMetadata>future=
networkSecurityClient.deleteClientTlsPolicyOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteClientTlsPolicyRequest,Empty,OperationMetadata> |
|
deleteServerTlsPolicyAsync(DeleteServerTlsPolicyRequest request)
publicfinalOperationFuture<Empty,OperationMetadata>deleteServerTlsPolicyAsync(DeleteServerTlsPolicyRequestrequest)Deletes a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
DeleteServerTlsPolicyRequestrequest=
DeleteServerTlsPolicyRequest.newBuilder()
.setName(
ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]")
.toString())
.build();
networkSecurityClient.deleteServerTlsPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteServerTlsPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteServerTlsPolicyAsync(ServerTlsPolicyName name)
publicfinalOperationFuture<Empty,OperationMetadata>deleteServerTlsPolicyAsync(ServerTlsPolicyNamename)Deletes a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ServerTlsPolicyNamename=
ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]");
networkSecurityClient.deleteServerTlsPolicyAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
ServerTlsPolicyName Required. A name of the ServerTlsPolicy to delete. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteServerTlsPolicyAsync(String name)
publicfinalOperationFuture<Empty,OperationMetadata>deleteServerTlsPolicyAsync(Stringname)Deletes a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringname=
ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]").toString();
networkSecurityClient.deleteServerTlsPolicyAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
String Required. A name of the ServerTlsPolicy to delete. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteServerTlsPolicyCallable()
publicfinalUnaryCallable<DeleteServerTlsPolicyRequest,Operation>deleteServerTlsPolicyCallable()Deletes a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
DeleteServerTlsPolicyRequestrequest=
DeleteServerTlsPolicyRequest.newBuilder()
.setName(
ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]")
.toString())
.build();
ApiFuture<Operation>future=
networkSecurityClient.deleteServerTlsPolicyCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteServerTlsPolicyRequest,Operation> |
|
deleteServerTlsPolicyOperationCallable()
publicfinalOperationCallable<DeleteServerTlsPolicyRequest,Empty,OperationMetadata>deleteServerTlsPolicyOperationCallable()Deletes a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
DeleteServerTlsPolicyRequestrequest=
DeleteServerTlsPolicyRequest.newBuilder()
.setName(
ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]")
.toString())
.build();
OperationFuture<Empty,OperationMetadata>future=
networkSecurityClient.deleteServerTlsPolicyOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteServerTlsPolicyRequest,Empty,OperationMetadata> |
|
getAuthorizationPolicy(AuthorizationPolicyName name)
publicfinalAuthorizationPolicygetAuthorizationPolicy(AuthorizationPolicyNamename)Gets details of a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
AuthorizationPolicyNamename=
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]");
AuthorizationPolicyresponse=networkSecurityClient.getAuthorizationPolicy(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
AuthorizationPolicyName Required. A name of the AuthorizationPolicy to get. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
AuthorizationPolicy |
|
getAuthorizationPolicy(GetAuthorizationPolicyRequest request)
publicfinalAuthorizationPolicygetAuthorizationPolicy(GetAuthorizationPolicyRequestrequest)Gets details of a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
GetAuthorizationPolicyRequestrequest=
GetAuthorizationPolicyRequest.newBuilder()
.setName(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.build();
AuthorizationPolicyresponse=networkSecurityClient.getAuthorizationPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetAuthorizationPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
AuthorizationPolicy |
|
getAuthorizationPolicy(String name)
publicfinalAuthorizationPolicygetAuthorizationPolicy(Stringname)Gets details of a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringname=
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString();
AuthorizationPolicyresponse=networkSecurityClient.getAuthorizationPolicy(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
String Required. A name of the AuthorizationPolicy to get. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
AuthorizationPolicy |
|
getAuthorizationPolicyCallable()
publicfinalUnaryCallable<GetAuthorizationPolicyRequest,AuthorizationPolicy>getAuthorizationPolicyCallable()Gets details of a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
GetAuthorizationPolicyRequestrequest=
GetAuthorizationPolicyRequest.newBuilder()
.setName(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.build();
ApiFuture<AuthorizationPolicy>future=
networkSecurityClient.getAuthorizationPolicyCallable().futureCall(request);
// Do something.
AuthorizationPolicyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetAuthorizationPolicyRequest,AuthorizationPolicy> |
|
getClientTlsPolicy(ClientTlsPolicyName name)
publicfinalClientTlsPolicygetClientTlsPolicy(ClientTlsPolicyNamename)Gets details of a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ClientTlsPolicyNamename=
ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]");
ClientTlsPolicyresponse=networkSecurityClient.getClientTlsPolicy(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
ClientTlsPolicyName Required. A name of the ClientTlsPolicy to get. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
ClientTlsPolicy |
|
getClientTlsPolicy(GetClientTlsPolicyRequest request)
publicfinalClientTlsPolicygetClientTlsPolicy(GetClientTlsPolicyRequestrequest)Gets details of a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
GetClientTlsPolicyRequestrequest=
GetClientTlsPolicyRequest.newBuilder()
.setName(
ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]")
.toString())
.build();
ClientTlsPolicyresponse=networkSecurityClient.getClientTlsPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetClientTlsPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
ClientTlsPolicy |
|
getClientTlsPolicy(String name)
publicfinalClientTlsPolicygetClientTlsPolicy(Stringname)Gets details of a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringname=
ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]").toString();
ClientTlsPolicyresponse=networkSecurityClient.getClientTlsPolicy(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
String Required. A name of the ClientTlsPolicy to get. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
ClientTlsPolicy |
|
getClientTlsPolicyCallable()
publicfinalUnaryCallable<GetClientTlsPolicyRequest,ClientTlsPolicy>getClientTlsPolicyCallable()Gets details of a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
GetClientTlsPolicyRequestrequest=
GetClientTlsPolicyRequest.newBuilder()
.setName(
ClientTlsPolicyName.of("[PROJECT]","[LOCATION]","[CLIENT_TLS_POLICY]")
.toString())
.build();
ApiFuture<ClientTlsPolicy>future=
networkSecurityClient.getClientTlsPolicyCallable().futureCall(request);
// Do something.
ClientTlsPolicyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetClientTlsPolicyRequest,ClientTlsPolicy> |
|
getHttpJsonOperationsClient()
publicfinalOperationsClientgetHttpJsonOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
| Returns | |
|---|---|
| Type | Description |
OperationsClient |
|
getIamPolicy(GetIamPolicyRequest request)
publicfinalPolicygetIamPolicy(GetIamPolicyRequestrequest)Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
GetIamPolicyRequestrequest=
GetIamPolicyRequest.newBuilder()
.setResource(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policyresponse=networkSecurityClient.getIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.GetIamPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.Policy |
|
getIamPolicyCallable()
publicfinalUnaryCallable<GetIamPolicyRequest,Policy>getIamPolicyCallable()Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
GetIamPolicyRequestrequest=
GetIamPolicyRequest.newBuilder()
.setResource(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy>future=networkSecurityClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
|
getLocation(GetLocationRequest request)
publicfinalLocationgetLocation(GetLocationRequestrequest)Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
Locationresponse=networkSecurityClient.getLocation(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.GetLocationRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.cloud.location.Location |
|
getLocationCallable()
publicfinalUnaryCallable<GetLocationRequest,Location>getLocationCallable()Gets information about a location.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location>future=networkSecurityClient.getLocationCallable().futureCall(request);
// Do something.
Locationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
|
getOperationsClient()
publicfinalOperationsClientgetOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
| Returns | |
|---|---|
| Type | Description |
OperationsClient |
|
getServerTlsPolicy(GetServerTlsPolicyRequest request)
publicfinalServerTlsPolicygetServerTlsPolicy(GetServerTlsPolicyRequestrequest)Gets details of a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
GetServerTlsPolicyRequestrequest=
GetServerTlsPolicyRequest.newBuilder()
.setName(
ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]")
.toString())
.build();
ServerTlsPolicyresponse=networkSecurityClient.getServerTlsPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetServerTlsPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
ServerTlsPolicy |
|
getServerTlsPolicy(ServerTlsPolicyName name)
publicfinalServerTlsPolicygetServerTlsPolicy(ServerTlsPolicyNamename)Gets details of a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ServerTlsPolicyNamename=
ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]");
ServerTlsPolicyresponse=networkSecurityClient.getServerTlsPolicy(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
ServerTlsPolicyName Required. A name of the ServerTlsPolicy to get. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
ServerTlsPolicy |
|
getServerTlsPolicy(String name)
publicfinalServerTlsPolicygetServerTlsPolicy(Stringname)Gets details of a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringname=
ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]").toString();
ServerTlsPolicyresponse=networkSecurityClient.getServerTlsPolicy(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
String Required. A name of the ServerTlsPolicy to get. Must be in the format
|
| Returns | |
|---|---|
| Type | Description |
ServerTlsPolicy |
|
getServerTlsPolicyCallable()
publicfinalUnaryCallable<GetServerTlsPolicyRequest,ServerTlsPolicy>getServerTlsPolicyCallable()Gets details of a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
GetServerTlsPolicyRequestrequest=
GetServerTlsPolicyRequest.newBuilder()
.setName(
ServerTlsPolicyName.of("[PROJECT]","[LOCATION]","[SERVER_TLS_POLICY]")
.toString())
.build();
ApiFuture<ServerTlsPolicy>future=
networkSecurityClient.getServerTlsPolicyCallable().futureCall(request);
// Do something.
ServerTlsPolicyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetServerTlsPolicyRequest,ServerTlsPolicy> |
|
getSettings()
publicfinalNetworkSecuritySettingsgetSettings()| Returns | |
|---|---|
| Type | Description |
NetworkSecuritySettings |
|
getStub()
publicNetworkSecurityStubgetStub()| Returns | |
|---|---|
| Type | Description |
NetworkSecurityStub |
|
isShutdown()
publicbooleanisShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
publicbooleanisTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listAuthorizationPolicies(ListAuthorizationPoliciesRequest request)
publicfinalNetworkSecurityClient.ListAuthorizationPoliciesPagedResponselistAuthorizationPolicies(ListAuthorizationPoliciesRequestrequest)Lists AuthorizationPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListAuthorizationPoliciesRequestrequest=
ListAuthorizationPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(AuthorizationPolicyelement:
networkSecurityClient.listAuthorizationPolicies(request).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListAuthorizationPoliciesRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse |
|
listAuthorizationPolicies(LocationName parent)
publicfinalNetworkSecurityClient.ListAuthorizationPoliciesPagedResponselistAuthorizationPolicies(LocationNameparent)Lists AuthorizationPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
for(AuthorizationPolicyelement:
networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
LocationName Required. The project and location from which the AuthorizationPolicies should be
listed, specified in the format |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse |
|
listAuthorizationPolicies(String parent)
publicfinalNetworkSecurityClient.ListAuthorizationPoliciesPagedResponselistAuthorizationPolicies(Stringparent)Lists AuthorizationPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
for(AuthorizationPolicyelement:
networkSecurityClient.listAuthorizationPolicies(parent).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
String Required. The project and location from which the AuthorizationPolicies should be
listed, specified in the format |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse |
|
listAuthorizationPoliciesCallable()
publicfinalUnaryCallable<ListAuthorizationPoliciesRequest,ListAuthorizationPoliciesResponse>listAuthorizationPoliciesCallable()Lists AuthorizationPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListAuthorizationPoliciesRequestrequest=
ListAuthorizationPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListAuthorizationPoliciesResponseresponse=
networkSecurityClient.listAuthorizationPoliciesCallable().call(request);
for(AuthorizationPolicyelement:response.getAuthorizationPoliciesList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListAuthorizationPoliciesRequest,ListAuthorizationPoliciesResponse> |
|
listAuthorizationPoliciesPagedCallable()
publicfinalUnaryCallable<ListAuthorizationPoliciesRequest,NetworkSecurityClient.ListAuthorizationPoliciesPagedResponse>listAuthorizationPoliciesPagedCallable()Lists AuthorizationPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListAuthorizationPoliciesRequestrequest=
ListAuthorizationPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<AuthorizationPolicy>future=
networkSecurityClient.listAuthorizationPoliciesPagedCallable().futureCall(request);
// Do something.
for(AuthorizationPolicyelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListAuthorizationPoliciesRequest,ListAuthorizationPoliciesPagedResponse> |
|
listClientTlsPolicies(ListClientTlsPoliciesRequest request)
publicfinalNetworkSecurityClient.ListClientTlsPoliciesPagedResponselistClientTlsPolicies(ListClientTlsPoliciesRequestrequest)Lists ClientTlsPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListClientTlsPoliciesRequestrequest=
ListClientTlsPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(ClientTlsPolicyelement:
networkSecurityClient.listClientTlsPolicies(request).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListClientTlsPoliciesRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient.ListClientTlsPoliciesPagedResponse |
|
listClientTlsPolicies(LocationName parent)
publicfinalNetworkSecurityClient.ListClientTlsPoliciesPagedResponselistClientTlsPolicies(LocationNameparent)Lists ClientTlsPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
for(ClientTlsPolicyelement:
networkSecurityClient.listClientTlsPolicies(parent).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
LocationName Required. The project and location from which the ClientTlsPolicies should be
listed, specified in the format |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient.ListClientTlsPoliciesPagedResponse |
|
listClientTlsPolicies(String parent)
publicfinalNetworkSecurityClient.ListClientTlsPoliciesPagedResponselistClientTlsPolicies(Stringparent)Lists ClientTlsPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
for(ClientTlsPolicyelement:
networkSecurityClient.listClientTlsPolicies(parent).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
String Required. The project and location from which the ClientTlsPolicies should be
listed, specified in the format |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient.ListClientTlsPoliciesPagedResponse |
|
listClientTlsPoliciesCallable()
publicfinalUnaryCallable<ListClientTlsPoliciesRequest,ListClientTlsPoliciesResponse>listClientTlsPoliciesCallable()Lists ClientTlsPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListClientTlsPoliciesRequestrequest=
ListClientTlsPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListClientTlsPoliciesResponseresponse=
networkSecurityClient.listClientTlsPoliciesCallable().call(request);
for(ClientTlsPolicyelement:response.getClientTlsPoliciesList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListClientTlsPoliciesRequest,ListClientTlsPoliciesResponse> |
|
listClientTlsPoliciesPagedCallable()
publicfinalUnaryCallable<ListClientTlsPoliciesRequest,NetworkSecurityClient.ListClientTlsPoliciesPagedResponse>listClientTlsPoliciesPagedCallable()Lists ClientTlsPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListClientTlsPoliciesRequestrequest=
ListClientTlsPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<ClientTlsPolicy>future=
networkSecurityClient.listClientTlsPoliciesPagedCallable().futureCall(request);
// Do something.
for(ClientTlsPolicyelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListClientTlsPoliciesRequest,ListClientTlsPoliciesPagedResponse> |
|
listLocations(ListLocationsRequest request)
publicfinalNetworkSecurityClient.ListLocationsPagedResponselistLocations(ListLocationsRequestrequest)Lists information about the supported locations for this service.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(Locationelement:networkSecurityClient.listLocations(request).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.ListLocationsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient.ListLocationsPagedResponse |
|
listLocationsCallable()
publicfinalUnaryCallable<ListLocationsRequest,ListLocationsResponse>listLocationsCallable()Lists information about the supported locations for this service.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListLocationsResponseresponse=
networkSecurityClient.listLocationsCallable().call(request);
for(Locationelement:response.getLocationsList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
|
listLocationsPagedCallable()
publicfinalUnaryCallable<ListLocationsRequest,NetworkSecurityClient.ListLocationsPagedResponse>listLocationsPagedCallable()Lists information about the supported locations for this service.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location>future=
networkSecurityClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for(Locationelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
|
listServerTlsPolicies(ListServerTlsPoliciesRequest request)
publicfinalNetworkSecurityClient.ListServerTlsPoliciesPagedResponselistServerTlsPolicies(ListServerTlsPoliciesRequestrequest)Lists ServerTlsPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListServerTlsPoliciesRequestrequest=
ListServerTlsPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(ServerTlsPolicyelement:
networkSecurityClient.listServerTlsPolicies(request).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListServerTlsPoliciesRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient.ListServerTlsPoliciesPagedResponse |
|
listServerTlsPolicies(LocationName parent)
publicfinalNetworkSecurityClient.ListServerTlsPoliciesPagedResponselistServerTlsPolicies(LocationNameparent)Lists ServerTlsPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
for(ServerTlsPolicyelement:
networkSecurityClient.listServerTlsPolicies(parent).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
LocationName Required. The project and location from which the ServerTlsPolicies should be
listed, specified in the format |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient.ListServerTlsPoliciesPagedResponse |
|
listServerTlsPolicies(String parent)
publicfinalNetworkSecurityClient.ListServerTlsPoliciesPagedResponselistServerTlsPolicies(Stringparent)Lists ServerTlsPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
for(ServerTlsPolicyelement:
networkSecurityClient.listServerTlsPolicies(parent).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
parent |
String Required. The project and location from which the ServerTlsPolicies should be
listed, specified in the format |
| Returns | |
|---|---|
| Type | Description |
NetworkSecurityClient.ListServerTlsPoliciesPagedResponse |
|
listServerTlsPoliciesCallable()
publicfinalUnaryCallable<ListServerTlsPoliciesRequest,ListServerTlsPoliciesResponse>listServerTlsPoliciesCallable()Lists ServerTlsPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListServerTlsPoliciesRequestrequest=
ListServerTlsPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListServerTlsPoliciesResponseresponse=
networkSecurityClient.listServerTlsPoliciesCallable().call(request);
for(ServerTlsPolicyelement:response.getServerTlsPoliciesList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListServerTlsPoliciesRequest,ListServerTlsPoliciesResponse> |
|
listServerTlsPoliciesPagedCallable()
publicfinalUnaryCallable<ListServerTlsPoliciesRequest,NetworkSecurityClient.ListServerTlsPoliciesPagedResponse>listServerTlsPoliciesPagedCallable()Lists ServerTlsPolicies 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(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ListServerTlsPoliciesRequestrequest=
ListServerTlsPoliciesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<ServerTlsPolicy>future=
networkSecurityClient.listServerTlsPoliciesPagedCallable().futureCall(request);
// Do something.
for(ServerTlsPolicyelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListServerTlsPoliciesRequest,ListServerTlsPoliciesPagedResponse> |
|
setIamPolicy(SetIamPolicyRequest request)
publicfinalPolicysetIamPolicy(SetIamPolicyRequestrequest)Sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
SetIamPolicyRequestrequest=
SetIamPolicyRequest.newBuilder()
.setResource(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policyresponse=networkSecurityClient.setIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.SetIamPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.Policy |
|
setIamPolicyCallable()
publicfinalUnaryCallable<SetIamPolicyRequest,Policy>setIamPolicyCallable()Sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
SetIamPolicyRequestrequest=
SetIamPolicyRequest.newBuilder()
.setResource(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy>future=networkSecurityClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
|
shutdown()
publicvoidshutdown()shutdownNow()
publicvoidshutdownNow()testIamPermissions(TestIamPermissionsRequest request)
publicfinalTestIamPermissionsResponsetestIamPermissions(TestIamPermissionsRequestrequest)Returns permissions that a caller has on the specified resource. If theresource does not exist,
this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
TestIamPermissionsRequestrequest=
TestIamPermissionsRequest.newBuilder()
.setResource(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.addAllPermissions(newArrayList<String>())
.build();
TestIamPermissionsResponseresponse=networkSecurityClient.testIamPermissions(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.TestIamPermissionsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.TestIamPermissionsResponse |
|
testIamPermissionsCallable()
publicfinalUnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse>testIamPermissionsCallable()Returns permissions that a caller has on the specified resource. If theresource does not exist,
this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
TestIamPermissionsRequestrequest=
TestIamPermissionsRequest.newBuilder()
.setResource(
AuthorizationPolicyName.of("[PROJECT]","[LOCATION]","[AUTHORIZATION_POLICY]")
.toString())
.addAllPermissions(newArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse>future=
networkSecurityClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponseresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
|
updateAuthorizationPolicyAsync(AuthorizationPolicy authorizationPolicy, FieldMask updateMask)
publicfinalOperationFuture<AuthorizationPolicy,OperationMetadata>updateAuthorizationPolicyAsync(AuthorizationPolicyauthorizationPolicy,FieldMaskupdateMask)Updates the parameters of a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
AuthorizationPolicyauthorizationPolicy=AuthorizationPolicy.newBuilder().build();
FieldMaskupdateMask=FieldMask.newBuilder().build();
AuthorizationPolicyresponse=
networkSecurityClient
.updateAuthorizationPolicyAsync(authorizationPolicy,updateMask)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
authorizationPolicy |
AuthorizationPolicy Required. Updated AuthorizationPolicy resource. |
updateMask |
FieldMask Optional. Field mask is used to specify the fields to be overwritten in the AuthorizationPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AuthorizationPolicy,OperationMetadata> |
|
updateAuthorizationPolicyAsync(UpdateAuthorizationPolicyRequest request)
publicfinalOperationFuture<AuthorizationPolicy,OperationMetadata>updateAuthorizationPolicyAsync(UpdateAuthorizationPolicyRequestrequest)Updates the parameters of a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
UpdateAuthorizationPolicyRequestrequest=
UpdateAuthorizationPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
.build();
AuthorizationPolicyresponse=
networkSecurityClient.updateAuthorizationPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateAuthorizationPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<AuthorizationPolicy,OperationMetadata> |
|
updateAuthorizationPolicyCallable()
publicfinalUnaryCallable<UpdateAuthorizationPolicyRequest,Operation>updateAuthorizationPolicyCallable()Updates the parameters of a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
UpdateAuthorizationPolicyRequestrequest=
UpdateAuthorizationPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
.build();
ApiFuture<Operation>future=
networkSecurityClient.updateAuthorizationPolicyCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateAuthorizationPolicyRequest,Operation> |
|
updateAuthorizationPolicyOperationCallable()
publicfinalOperationCallable<UpdateAuthorizationPolicyRequest,AuthorizationPolicy,OperationMetadata>updateAuthorizationPolicyOperationCallable()Updates the parameters of a single AuthorizationPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
UpdateAuthorizationPolicyRequestrequest=
UpdateAuthorizationPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setAuthorizationPolicy(AuthorizationPolicy.newBuilder().build())
.build();
OperationFuture<AuthorizationPolicy,OperationMetadata>future=
networkSecurityClient.updateAuthorizationPolicyOperationCallable().futureCall(request);
// Do something.
AuthorizationPolicyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateAuthorizationPolicyRequest,AuthorizationPolicy,OperationMetadata> |
|
updateClientTlsPolicyAsync(ClientTlsPolicy clientTlsPolicy, FieldMask updateMask)
publicfinalOperationFuture<ClientTlsPolicy,OperationMetadata>updateClientTlsPolicyAsync(ClientTlsPolicyclientTlsPolicy,FieldMaskupdateMask)Updates the parameters of a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ClientTlsPolicyclientTlsPolicy=ClientTlsPolicy.newBuilder().build();
FieldMaskupdateMask=FieldMask.newBuilder().build();
ClientTlsPolicyresponse=
networkSecurityClient.updateClientTlsPolicyAsync(clientTlsPolicy,updateMask).get();
}
| Parameters | |
|---|---|
| Name | Description |
clientTlsPolicy |
ClientTlsPolicy Required. Updated ClientTlsPolicy resource. |
updateMask |
FieldMask Optional. Field mask is used to specify the fields to be overwritten in the ClientTlsPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ClientTlsPolicy,OperationMetadata> |
|
updateClientTlsPolicyAsync(UpdateClientTlsPolicyRequest request)
publicfinalOperationFuture<ClientTlsPolicy,OperationMetadata>updateClientTlsPolicyAsync(UpdateClientTlsPolicyRequestrequest)Updates the parameters of a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
UpdateClientTlsPolicyRequestrequest=
UpdateClientTlsPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
.build();
ClientTlsPolicyresponse=networkSecurityClient.updateClientTlsPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateClientTlsPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ClientTlsPolicy,OperationMetadata> |
|
updateClientTlsPolicyCallable()
publicfinalUnaryCallable<UpdateClientTlsPolicyRequest,Operation>updateClientTlsPolicyCallable()Updates the parameters of a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
UpdateClientTlsPolicyRequestrequest=
UpdateClientTlsPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
.build();
ApiFuture<Operation>future=
networkSecurityClient.updateClientTlsPolicyCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateClientTlsPolicyRequest,Operation> |
|
updateClientTlsPolicyOperationCallable()
publicfinalOperationCallable<UpdateClientTlsPolicyRequest,ClientTlsPolicy,OperationMetadata>updateClientTlsPolicyOperationCallable()Updates the parameters of a single ClientTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
UpdateClientTlsPolicyRequestrequest=
UpdateClientTlsPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setClientTlsPolicy(ClientTlsPolicy.newBuilder().build())
.build();
OperationFuture<ClientTlsPolicy,OperationMetadata>future=
networkSecurityClient.updateClientTlsPolicyOperationCallable().futureCall(request);
// Do something.
ClientTlsPolicyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateClientTlsPolicyRequest,ClientTlsPolicy,OperationMetadata> |
|
updateServerTlsPolicyAsync(ServerTlsPolicy serverTlsPolicy, FieldMask updateMask)
publicfinalOperationFuture<ServerTlsPolicy,OperationMetadata>updateServerTlsPolicyAsync(ServerTlsPolicyserverTlsPolicy,FieldMaskupdateMask)Updates the parameters of a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
ServerTlsPolicyserverTlsPolicy=ServerTlsPolicy.newBuilder().build();
FieldMaskupdateMask=FieldMask.newBuilder().build();
ServerTlsPolicyresponse=
networkSecurityClient.updateServerTlsPolicyAsync(serverTlsPolicy,updateMask).get();
}
| Parameters | |
|---|---|
| Name | Description |
serverTlsPolicy |
ServerTlsPolicy Required. Updated ServerTlsPolicy resource. |
updateMask |
FieldMask Optional. Field mask is used to specify the fields to be overwritten in the ServerTlsPolicy resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ServerTlsPolicy,OperationMetadata> |
|
updateServerTlsPolicyAsync(UpdateServerTlsPolicyRequest request)
publicfinalOperationFuture<ServerTlsPolicy,OperationMetadata>updateServerTlsPolicyAsync(UpdateServerTlsPolicyRequestrequest)Updates the parameters of a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
UpdateServerTlsPolicyRequestrequest=
UpdateServerTlsPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
.build();
ServerTlsPolicyresponse=networkSecurityClient.updateServerTlsPolicyAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateServerTlsPolicyRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<ServerTlsPolicy,OperationMetadata> |
|
updateServerTlsPolicyCallable()
publicfinalUnaryCallable<UpdateServerTlsPolicyRequest,Operation>updateServerTlsPolicyCallable()Updates the parameters of a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
UpdateServerTlsPolicyRequestrequest=
UpdateServerTlsPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
.build();
ApiFuture<Operation>future=
networkSecurityClient.updateServerTlsPolicyCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateServerTlsPolicyRequest,Operation> |
|
updateServerTlsPolicyOperationCallable()
publicfinalOperationCallable<UpdateServerTlsPolicyRequest,ServerTlsPolicy,OperationMetadata>updateServerTlsPolicyOperationCallable()Updates the parameters of a single ServerTlsPolicy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try(NetworkSecurityClientnetworkSecurityClient=NetworkSecurityClient.create()){
UpdateServerTlsPolicyRequestrequest=
UpdateServerTlsPolicyRequest.newBuilder()
.setUpdateMask(FieldMask.newBuilder().build())
.setServerTlsPolicy(ServerTlsPolicy.newBuilder().build())
.build();
OperationFuture<ServerTlsPolicy,OperationMetadata>future=
networkSecurityClient.updateServerTlsPolicyOperationCallable().futureCall(request);
// Do something.
ServerTlsPolicyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateServerTlsPolicyRequest,ServerTlsPolicy,OperationMetadata> |
|