Class NetworkSecurityClient (0.7.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
publicclass NetworkSecurityClientimplementsBackgroundResourceService 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().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceInherited Members
Static Methods
create()
publicstaticfinalNetworkSecurityClientcreate()Constructs an instance of NetworkSecurityClient with default settings.
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.
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).
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.
NetworkSecurityClient(NetworkSecurityStub stub)
protectedNetworkSecurityClient(NetworkSecurityStubstub)Methods
awaitTermination(long duration, TimeUnit unit)
publicbooleanawaitTermination(longduration,TimeUnitunit)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();
}
CreateAuthorizationPolicyRequest The request object containing all of the parameters for the API call.
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();
}
LocationName Required. The parent resource of the AuthorizationPolicy. Must be in the format
projects/{project}/locations/{location}.
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".
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();
}
String Required. The parent resource of the AuthorizationPolicy. Must be in the format
projects/{project}/locations/{location}.
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".
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();
}
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();
}
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();
}
CreateClientTlsPolicyRequest The request object containing all of the parameters for the API call.
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();
}
LocationName Required. The parent resource of the ClientTlsPolicy. Must be in the format
projects/*/locations/{location}.
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".
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();
}
String Required. The parent resource of the ClientTlsPolicy. Must be in the format
projects/*/locations/{location}.
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".
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();
}
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();
}
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();
}
CreateServerTlsPolicyRequest The request object containing all of the parameters for the API call.
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();
}
LocationName Required. The parent resource of the ServerTlsPolicy. Must be in the format
projects/*/locations/{location}.
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".
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();
}
String Required. The parent resource of the ServerTlsPolicy. Must be in the format
projects/*/locations/{location}.
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".
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();
}
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();
}
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();
}
AuthorizationPolicyName Required. A name of the AuthorizationPolicy to delete. Must be in the format
projects/{project}/locations/{location}/authorizationPolicies/*.
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();
}
DeleteAuthorizationPolicyRequest The request object containing all of the parameters for the API call.
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();
}
String Required. A name of the AuthorizationPolicy to delete. Must be in the format
projects/{project}/locations/{location}/authorizationPolicies/*.
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();
}
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();
}
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();
}
ClientTlsPolicyName Required. A name of the ClientTlsPolicy to delete. Must be in the format
projects/*/locations/{location}/clientTlsPolicies/*.
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();
}
DeleteClientTlsPolicyRequest The request object containing all of the parameters for the API call.
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();
}
String Required. A name of the ClientTlsPolicy to delete. Must be in the format
projects/*/locations/{location}/clientTlsPolicies/*.
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();
}
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();
}
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();
}
DeleteServerTlsPolicyRequest The request object containing all of the parameters for the API call.
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();
}
ServerTlsPolicyName Required. A name of the ServerTlsPolicy to delete. Must be in the format
projects/*/locations/{location}/serverTlsPolicies/*.
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();
}
String Required. A name of the ServerTlsPolicy to delete. Must be in the format
projects/*/locations/{location}/serverTlsPolicies/*.
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();
}
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();
}
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);
}
AuthorizationPolicyName Required. A name of the AuthorizationPolicy to get. Must be in the format
projects/{project}/locations/{location}/authorizationPolicies/*.
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);
}
GetAuthorizationPolicyRequest The request object containing all of the parameters for the API call.
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);
}
String Required. A name of the AuthorizationPolicy to get. Must be in the format
projects/{project}/locations/{location}/authorizationPolicies/*.
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();
}
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);
}
ClientTlsPolicyName Required. A name of the ClientTlsPolicy to get. Must be in the format
projects/*/locations/{location}/clientTlsPolicies/*.
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);
}
GetClientTlsPolicyRequest The request object containing all of the parameters for the API call.
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);
}
String Required. A name of the ClientTlsPolicy to get. Must be in the format
projects/*/locations/{location}/clientTlsPolicies/*.
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();
}
getOperationsClient()
publicfinalOperationsClientgetOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
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);
}
GetServerTlsPolicyRequest The request object containing all of the parameters for the API call.
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);
}
ServerTlsPolicyName Required. A name of the ServerTlsPolicy to get. Must be in the format
projects/*/locations/{location}/serverTlsPolicies/*.
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);
}
String Required. A name of the ServerTlsPolicy to get. Must be in the format
projects/*/locations/{location}/serverTlsPolicies/*.
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();
}
getSettings()
publicfinalNetworkSecuritySettingsgetSettings()getStub()
publicNetworkSecurityStubgetStub()isShutdown()
publicbooleanisShutdown()isTerminated()
publicbooleanisTerminated()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);
}
}
ListAuthorizationPoliciesRequest The request object containing all of the parameters for the API call.
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);
}
}
LocationName Required. The project and location from which the AuthorizationPolicies should be
listed, specified in the format projects/{project}/locations/{location}.
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);
}
}
String Required. The project and location from which the AuthorizationPolicies should be
listed, specified in the format projects/{project}/locations/{location}.
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;
}
}
}
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);
}
}
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);
}
}
ListClientTlsPoliciesRequest The request object containing all of the parameters for the API call.
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);
}
}
LocationName Required. The project and location from which the ClientTlsPolicies should be
listed, specified in the format projects/*/locations/{location}.
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);
}
}
String Required. The project and location from which the ClientTlsPolicies should be
listed, specified in the format projects/*/locations/{location}.
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;
}
}
}
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);
}
}
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);
}
}
ListServerTlsPoliciesRequest The request object containing all of the parameters for the API call.
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);
}
}
LocationName Required. The project and location from which the ServerTlsPolicies should be
listed, specified in the format projects/*/locations/{location}.
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);
}
}
String Required. The project and location from which the ServerTlsPolicies should be
listed, specified in the format projects/*/locations/{location}.
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;
}
}
}
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);
}
}
shutdown()
publicvoidshutdown()shutdownNow()
publicvoidshutdownNow()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();
}
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.
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();
}
UpdateAuthorizationPolicyRequest The request object containing all of the parameters for the API call.
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();
}
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();
}
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();
}
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.
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();
}
UpdateClientTlsPolicyRequest The request object containing all of the parameters for the API call.
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();
}
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();
}
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();
}
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.
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();
}
UpdateServerTlsPolicyRequest The request object containing all of the parameters for the API call.
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();
}
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();
}