@Generated(value="by gapic-generator-java") public class NetworkFirewallPoliciesClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicy response = networkFirewallPoliciesClient.get(project, firewallPolicy);
}
Note: close() needs to be called on the NetworkFirewallPoliciesClient 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 |
|---|---|---|
AddAssociation |
Inserts an association for the specified firewall policy. |
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 `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AddRule |
Inserts a rule into a firewall policy. |
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 `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CloneRules |
Copies rules to the specified firewall policy. |
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 `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Delete |
Deletes the specified policy. |
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 `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Get |
Returns the specified network firewall policy. |
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.
|
GetAssociation |
Gets an association with the specified name. |
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.
|
GetIamPolicy |
Gets the access control policy for a resource. May be empty if no such policy or resource exists. |
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.
|
GetRule |
Gets a rule of the specified priority. |
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.
|
Insert |
Creates a new policy in the specified project using the data included in the request. |
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 `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
List |
Lists all the policies that have been configured for the specified project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Patch |
Patches the specified policy with the data included in the request. |
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 `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
PatchRule |
Patches a rule of the specified priority. |
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 `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveAssociation |
Removes an association for the specified firewall policy. |
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 `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveRule |
Deletes a rule of the specified priority. |
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 `OperationFuture`, which is used to track polling of the service.
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. Replaces any existing policy. |
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.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. |
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.
|
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 NetworkFirewallPoliciesSettings 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
NetworkFirewallPoliciesSettings networkFirewallPoliciesSettings =
NetworkFirewallPoliciesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create(networkFirewallPoliciesSettings);
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
NetworkFirewallPoliciesSettings networkFirewallPoliciesSettings =
NetworkFirewallPoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create(networkFirewallPoliciesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
NetworkFirewallPoliciesClient.ListFixedSizeCollection |
static class |
NetworkFirewallPoliciesClient.ListPage |
static class |
NetworkFirewallPoliciesClient.ListPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
NetworkFirewallPoliciesClient(NetworkFirewallPoliciesSettings settings)
Constructs an instance of NetworkFirewallPoliciesClient, using the given settings.
|
protected |
NetworkFirewallPoliciesClient(NetworkFirewallPoliciesStub stub) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addAssociationAsync(AddAssociationNetworkFirewallPolicyRequest request)
Inserts an association for the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addAssociationAsync(String project,
String firewallPolicy,
FirewallPolicyAssociation firewallPolicyAssociationResource)
Inserts an association for the specified firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<AddAssociationNetworkFirewallPolicyRequest,Operation> |
addAssociationCallable()
Inserts an association for the specified firewall policy.
|
com.google.api.gax.rpc.OperationCallable<AddAssociationNetworkFirewallPolicyRequest,Operation,Operation> |
addAssociationOperationCallable()
Inserts an association for the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addRuleAsync(AddRuleNetworkFirewallPolicyRequest request)
Inserts a rule into a firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addRuleAsync(String project,
String firewallPolicy,
FirewallPolicyRule firewallPolicyRuleResource)
Inserts a rule into a firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<AddRuleNetworkFirewallPolicyRequest,Operation> |
addRuleCallable()
Inserts a rule into a firewall policy.
|
com.google.api.gax.rpc.OperationCallable<AddRuleNetworkFirewallPolicyRequest,Operation,Operation> |
addRuleOperationCallable()
Inserts a rule into a firewall policy.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
cloneRulesAsync(CloneRulesNetworkFirewallPolicyRequest request)
Copies rules to the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
cloneRulesAsync(String project,
String firewallPolicy)
Copies rules to the specified firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<CloneRulesNetworkFirewallPolicyRequest,Operation> |
cloneRulesCallable()
Copies rules to the specified firewall policy.
|
com.google.api.gax.rpc.OperationCallable<CloneRulesNetworkFirewallPolicyRequest,Operation,Operation> |
cloneRulesOperationCallable()
Copies rules to the specified firewall policy.
|
void |
close() |
static NetworkFirewallPoliciesClient |
create()
Constructs an instance of NetworkFirewallPoliciesClient with default settings.
|
static NetworkFirewallPoliciesClient |
create(NetworkFirewallPoliciesSettings settings)
Constructs an instance of NetworkFirewallPoliciesClient, using the given settings.
|
static NetworkFirewallPoliciesClient |
create(NetworkFirewallPoliciesStub stub)
Constructs an instance of NetworkFirewallPoliciesClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(DeleteNetworkFirewallPolicyRequest request)
Deletes the specified policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(String project,
String firewallPolicy)
Deletes the specified policy.
|
com.google.api.gax.rpc.UnaryCallable<DeleteNetworkFirewallPolicyRequest,Operation> |
deleteCallable()
Deletes the specified policy.
|
com.google.api.gax.rpc.OperationCallable<DeleteNetworkFirewallPolicyRequest,Operation,Operation> |
deleteOperationCallable()
Deletes the specified policy.
|
FirewallPolicy |
get(GetNetworkFirewallPolicyRequest request)
Returns the specified network firewall policy.
|
FirewallPolicy |
get(String project,
String firewallPolicy)
Returns the specified network firewall policy.
|
FirewallPolicyAssociation |
getAssociation(GetAssociationNetworkFirewallPolicyRequest request)
Gets an association with the specified name.
|
FirewallPolicyAssociation |
getAssociation(String project,
String firewallPolicy)
Gets an association with the specified name.
|
com.google.api.gax.rpc.UnaryCallable<GetAssociationNetworkFirewallPolicyRequest,FirewallPolicyAssociation> |
getAssociationCallable()
Gets an association with the specified name.
|
com.google.api.gax.rpc.UnaryCallable<GetNetworkFirewallPolicyRequest,FirewallPolicy> |
getCallable()
Returns the specified network firewall policy.
|
Policy |
getIamPolicy(GetIamPolicyNetworkFirewallPolicyRequest request)
Gets the access control policy for a resource.
|
Policy |
getIamPolicy(String project,
String resource)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<GetIamPolicyNetworkFirewallPolicyRequest,Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
FirewallPolicyRule |
getRule(GetRuleNetworkFirewallPolicyRequest request)
Gets a rule of the specified priority.
|
FirewallPolicyRule |
getRule(String project,
String firewallPolicy)
Gets a rule of the specified priority.
|
com.google.api.gax.rpc.UnaryCallable<GetRuleNetworkFirewallPolicyRequest,FirewallPolicyRule> |
getRuleCallable()
Gets a rule of the specified priority.
|
NetworkFirewallPoliciesSettings |
getSettings() |
NetworkFirewallPoliciesStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(InsertNetworkFirewallPolicyRequest request)
Creates a new policy in the specified project using the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(String project,
FirewallPolicy firewallPolicyResource)
Creates a new policy in the specified project using the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertNetworkFirewallPolicyRequest,Operation> |
insertCallable()
Creates a new policy in the specified project using the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<InsertNetworkFirewallPolicyRequest,Operation,Operation> |
insertOperationCallable()
Creates a new policy in the specified project using the data included in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
NetworkFirewallPoliciesClient.ListPagedResponse |
list(ListNetworkFirewallPoliciesRequest request)
Lists all the policies that have been configured for the specified project.
|
NetworkFirewallPoliciesClient.ListPagedResponse |
list(String project)
Lists all the policies that have been configured for the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListNetworkFirewallPoliciesRequest,FirewallPolicyList> |
listCallable()
Lists all the policies that have been configured for the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListNetworkFirewallPoliciesRequest,NetworkFirewallPoliciesClient.ListPagedResponse> |
listPagedCallable()
Lists all the policies that have been configured for the specified project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchAsync(PatchNetworkFirewallPolicyRequest request)
Patches the specified policy with the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchAsync(String project,
String firewallPolicy,
FirewallPolicy firewallPolicyResource)
Patches the specified policy with the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<PatchNetworkFirewallPolicyRequest,Operation> |
patchCallable()
Patches the specified policy with the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<PatchNetworkFirewallPolicyRequest,Operation,Operation> |
patchOperationCallable()
Patches the specified policy with the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchRuleAsync(PatchRuleNetworkFirewallPolicyRequest request)
Patches a rule of the specified priority.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchRuleAsync(String project,
String firewallPolicy,
FirewallPolicyRule firewallPolicyRuleResource)
Patches a rule of the specified priority.
|
com.google.api.gax.rpc.UnaryCallable<PatchRuleNetworkFirewallPolicyRequest,Operation> |
patchRuleCallable()
Patches a rule of the specified priority.
|
com.google.api.gax.rpc.OperationCallable<PatchRuleNetworkFirewallPolicyRequest,Operation,Operation> |
patchRuleOperationCallable()
Patches a rule of the specified priority.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeAssociationAsync(RemoveAssociationNetworkFirewallPolicyRequest request)
Removes an association for the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeAssociationAsync(String project,
String firewallPolicy)
Removes an association for the specified firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<RemoveAssociationNetworkFirewallPolicyRequest,Operation> |
removeAssociationCallable()
Removes an association for the specified firewall policy.
|
com.google.api.gax.rpc.OperationCallable<RemoveAssociationNetworkFirewallPolicyRequest,Operation,Operation> |
removeAssociationOperationCallable()
Removes an association for the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeRuleAsync(RemoveRuleNetworkFirewallPolicyRequest request)
Deletes a rule of the specified priority.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeRuleAsync(String project,
String firewallPolicy)
Deletes a rule of the specified priority.
|
com.google.api.gax.rpc.UnaryCallable<RemoveRuleNetworkFirewallPolicyRequest,Operation> |
removeRuleCallable()
Deletes a rule of the specified priority.
|
com.google.api.gax.rpc.OperationCallable<RemoveRuleNetworkFirewallPolicyRequest,Operation,Operation> |
removeRuleOperationCallable()
Deletes a rule of the specified priority.
|
Policy |
setIamPolicy(SetIamPolicyNetworkFirewallPolicyRequest request)
Sets the access control policy on the specified resource.
|
Policy |
setIamPolicy(String project,
String resource,
GlobalSetPolicyRequest globalSetPolicyRequestResource)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<SetIamPolicyNetworkFirewallPolicyRequest,Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
void |
shutdown() |
void |
shutdownNow() |
TestPermissionsResponse |
testIamPermissions(String project,
String resource,
TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
|
TestPermissionsResponse |
testIamPermissions(TestIamPermissionsNetworkFirewallPolicyRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsNetworkFirewallPolicyRequest,TestPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
protected NetworkFirewallPoliciesClient(NetworkFirewallPoliciesSettings settings) throws IOException
IOExceptionprotected NetworkFirewallPoliciesClient(NetworkFirewallPoliciesStub stub)
public static final NetworkFirewallPoliciesClient create() throws IOException
IOExceptionpublic static final NetworkFirewallPoliciesClient create(NetworkFirewallPoliciesSettings settings) throws IOException
IOExceptionpublic static final NetworkFirewallPoliciesClient create(NetworkFirewallPoliciesStub stub)
public final NetworkFirewallPoliciesSettings getSettings()
public NetworkFirewallPoliciesStub getStub()
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addAssociationAsync(String project, String firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyAssociation firewallPolicyAssociationResource =
FirewallPolicyAssociation.newBuilder().build();
Operation response =
networkFirewallPoliciesClient
.addAssociationAsync(project, firewallPolicy, firewallPolicyAssociationResource)
.get();
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to update.firewallPolicyAssociationResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addAssociationAsync(AddAssociationNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
AddAssociationNetworkFirewallPolicyRequest request =
AddAssociationNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
.setProject("project-309310695")
.setReplaceExistingAssociation(true)
.setRequestId("requestId693933066")
.build();
Operation response = networkFirewallPoliciesClient.addAssociationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<AddAssociationNetworkFirewallPolicyRequest,Operation,Operation> addAssociationOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
AddAssociationNetworkFirewallPolicyRequest request =
AddAssociationNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
.setProject("project-309310695")
.setReplaceExistingAssociation(true)
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
networkFirewallPoliciesClient.addAssociationOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AddAssociationNetworkFirewallPolicyRequest,Operation> addAssociationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
AddAssociationNetworkFirewallPolicyRequest request =
AddAssociationNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
.setProject("project-309310695")
.setReplaceExistingAssociation(true)
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
networkFirewallPoliciesClient.addAssociationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addRuleAsync(String project, String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
Operation response =
networkFirewallPoliciesClient
.addRuleAsync(project, firewallPolicy, firewallPolicyRuleResource)
.get();
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to update.firewallPolicyRuleResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addRuleAsync(AddRuleNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
AddRuleNetworkFirewallPolicyRequest request =
AddRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setMaxPriority(-207235553)
.setMinPriority(267190513)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = networkFirewallPoliciesClient.addRuleAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<AddRuleNetworkFirewallPolicyRequest,Operation,Operation> addRuleOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
AddRuleNetworkFirewallPolicyRequest request =
AddRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setMaxPriority(-207235553)
.setMinPriority(267190513)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
networkFirewallPoliciesClient.addRuleOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<AddRuleNetworkFirewallPolicyRequest,Operation> addRuleCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
AddRuleNetworkFirewallPolicyRequest request =
AddRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setMaxPriority(-207235553)
.setMinPriority(267190513)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
networkFirewallPoliciesClient.addRuleCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> cloneRulesAsync(String project, String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
Operation response =
networkFirewallPoliciesClient.cloneRulesAsync(project, firewallPolicy).get();
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> cloneRulesAsync(CloneRulesNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
CloneRulesNetworkFirewallPolicyRequest request =
CloneRulesNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
.build();
Operation response = networkFirewallPoliciesClient.cloneRulesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CloneRulesNetworkFirewallPolicyRequest,Operation,Operation> cloneRulesOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
CloneRulesNetworkFirewallPolicyRequest request =
CloneRulesNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
.build();
OperationFuture<Operation, Operation> future =
networkFirewallPoliciesClient.cloneRulesOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CloneRulesNetworkFirewallPolicyRequest,Operation> cloneRulesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
CloneRulesNetworkFirewallPolicyRequest request =
CloneRulesNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
.build();
ApiFuture<Operation> future =
networkFirewallPoliciesClient.cloneRulesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String project, String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
Operation response = networkFirewallPoliciesClient.deleteAsync(project, firewallPolicy).get();
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
DeleteNetworkFirewallPolicyRequest request =
DeleteNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = networkFirewallPoliciesClient.deleteAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteNetworkFirewallPolicyRequest,Operation,Operation> deleteOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
DeleteNetworkFirewallPolicyRequest request =
DeleteNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
networkFirewallPoliciesClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteNetworkFirewallPolicyRequest,Operation> deleteCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
DeleteNetworkFirewallPolicyRequest request =
DeleteNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
networkFirewallPoliciesClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final FirewallPolicy get(String project, String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicy response = networkFirewallPoliciesClient.get(project, firewallPolicy);
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicy get(GetNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
GetNetworkFirewallPolicyRequest request =
GetNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setProject("project-309310695")
.build();
FirewallPolicy response = networkFirewallPoliciesClient.get(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetNetworkFirewallPolicyRequest,FirewallPolicy> getCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
GetNetworkFirewallPolicyRequest request =
GetNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setProject("project-309310695")
.build();
ApiFuture<FirewallPolicy> future =
networkFirewallPoliciesClient.getCallable().futureCall(request);
// Do something.
FirewallPolicy response = future.get();
}
public final FirewallPolicyAssociation getAssociation(String project, String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyAssociation response =
networkFirewallPoliciesClient.getAssociation(project, firewallPolicy);
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to which the queried association belongs.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicyAssociation getAssociation(GetAssociationNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
GetAssociationNetworkFirewallPolicyRequest request =
GetAssociationNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.setProject("project-309310695")
.build();
FirewallPolicyAssociation response = networkFirewallPoliciesClient.getAssociation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetAssociationNetworkFirewallPolicyRequest,FirewallPolicyAssociation> getAssociationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
GetAssociationNetworkFirewallPolicyRequest request =
GetAssociationNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.setProject("project-309310695")
.build();
ApiFuture<FirewallPolicyAssociation> future =
networkFirewallPoliciesClient.getAssociationCallable().futureCall(request);
// Do something.
FirewallPolicyAssociation response = future.get();
}
public final Policy getIamPolicy(String project, String resource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String resource = "resource-341064690";
Policy response = networkFirewallPoliciesClient.getIamPolicy(project, resource);
}
project - Project ID for this request.resource - Name or id of the resource for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Policy getIamPolicy(GetIamPolicyNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
GetIamPolicyNetworkFirewallPolicyRequest request =
GetIamPolicyNetworkFirewallPolicyRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setProject("project-309310695")
.setResource("resource-341064690")
.build();
Policy response = networkFirewallPoliciesClient.getIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetIamPolicyNetworkFirewallPolicyRequest,Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
GetIamPolicyNetworkFirewallPolicyRequest request =
GetIamPolicyNetworkFirewallPolicyRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setProject("project-309310695")
.setResource("resource-341064690")
.build();
ApiFuture<Policy> future =
networkFirewallPoliciesClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final FirewallPolicyRule getRule(String project, String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyRule response = networkFirewallPoliciesClient.getRule(project, firewallPolicy);
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to which the queried rule belongs.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicyRule getRule(GetRuleNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
GetRuleNetworkFirewallPolicyRequest request =
GetRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.setProject("project-309310695")
.build();
FirewallPolicyRule response = networkFirewallPoliciesClient.getRule(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRuleNetworkFirewallPolicyRequest,FirewallPolicyRule> getRuleCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
GetRuleNetworkFirewallPolicyRequest request =
GetRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.setProject("project-309310695")
.build();
ApiFuture<FirewallPolicyRule> future =
networkFirewallPoliciesClient.getRuleCallable().futureCall(request);
// Do something.
FirewallPolicyRule response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(String project, FirewallPolicy firewallPolicyResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
Operation response =
networkFirewallPoliciesClient.insertAsync(project, firewallPolicyResource).get();
}
project - Project ID for this request.firewallPolicyResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(InsertNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
InsertNetworkFirewallPolicyRequest request =
InsertNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = networkFirewallPoliciesClient.insertAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<InsertNetworkFirewallPolicyRequest,Operation,Operation> insertOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
InsertNetworkFirewallPolicyRequest request =
InsertNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
networkFirewallPoliciesClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<InsertNetworkFirewallPolicyRequest,Operation> insertCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
InsertNetworkFirewallPolicyRequest request =
InsertNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
networkFirewallPoliciesClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final NetworkFirewallPoliciesClient.ListPagedResponse list(String project)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
for (FirewallPolicy element : networkFirewallPoliciesClient.list(project).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final NetworkFirewallPoliciesClient.ListPagedResponse list(ListNetworkFirewallPoliciesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
ListNetworkFirewallPoliciesRequest request =
ListNetworkFirewallPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
for (FirewallPolicy element : networkFirewallPoliciesClient.list(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListNetworkFirewallPoliciesRequest,NetworkFirewallPoliciesClient.ListPagedResponse> listPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
ListNetworkFirewallPoliciesRequest request =
ListNetworkFirewallPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
ApiFuture<FirewallPolicy> future =
networkFirewallPoliciesClient.listPagedCallable().futureCall(request);
// Do something.
for (FirewallPolicy element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListNetworkFirewallPoliciesRequest,FirewallPolicyList> listCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
ListNetworkFirewallPoliciesRequest request =
ListNetworkFirewallPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
while (true) {
FirewallPolicyList response = networkFirewallPoliciesClient.listCallable().call(request);
for (FirewallPolicy element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(String project, String firewallPolicy, FirewallPolicy firewallPolicyResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
Operation response =
networkFirewallPoliciesClient
.patchAsync(project, firewallPolicy, firewallPolicyResource)
.get();
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to update.firewallPolicyResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(PatchNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
PatchNetworkFirewallPolicyRequest request =
PatchNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = networkFirewallPoliciesClient.patchAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<PatchNetworkFirewallPolicyRequest,Operation,Operation> patchOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
PatchNetworkFirewallPolicyRequest request =
PatchNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
networkFirewallPoliciesClient.patchOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<PatchNetworkFirewallPolicyRequest,Operation> patchCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
PatchNetworkFirewallPolicyRequest request =
PatchNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
networkFirewallPoliciesClient.patchCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchRuleAsync(String project, String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
Operation response =
networkFirewallPoliciesClient
.patchRuleAsync(project, firewallPolicy, firewallPolicyRuleResource)
.get();
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to update.firewallPolicyRuleResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchRuleAsync(PatchRuleNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
PatchRuleNetworkFirewallPolicyRequest request =
PatchRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setPriority(-1165461084)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = networkFirewallPoliciesClient.patchRuleAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<PatchRuleNetworkFirewallPolicyRequest,Operation,Operation> patchRuleOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
PatchRuleNetworkFirewallPolicyRequest request =
PatchRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setPriority(-1165461084)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
networkFirewallPoliciesClient.patchRuleOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<PatchRuleNetworkFirewallPolicyRequest,Operation> patchRuleCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
PatchRuleNetworkFirewallPolicyRequest request =
PatchRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setPriority(-1165461084)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
networkFirewallPoliciesClient.patchRuleCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeAssociationAsync(String project, String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
Operation response =
networkFirewallPoliciesClient.removeAssociationAsync(project, firewallPolicy).get();
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeAssociationAsync(RemoveAssociationNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
RemoveAssociationNetworkFirewallPolicyRequest request =
RemoveAssociationNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = networkFirewallPoliciesClient.removeAssociationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RemoveAssociationNetworkFirewallPolicyRequest,Operation,Operation> removeAssociationOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
RemoveAssociationNetworkFirewallPolicyRequest request =
RemoveAssociationNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
networkFirewallPoliciesClient.removeAssociationOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RemoveAssociationNetworkFirewallPolicyRequest,Operation> removeAssociationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
RemoveAssociationNetworkFirewallPolicyRequest request =
RemoveAssociationNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
networkFirewallPoliciesClient.removeAssociationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeRuleAsync(String project, String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
Operation response =
networkFirewallPoliciesClient.removeRuleAsync(project, firewallPolicy).get();
}
project - Project ID for this request.firewallPolicy - Name of the firewall policy to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeRuleAsync(RemoveRuleNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
RemoveRuleNetworkFirewallPolicyRequest request =
RemoveRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = networkFirewallPoliciesClient.removeRuleAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RemoveRuleNetworkFirewallPolicyRequest,Operation,Operation> removeRuleOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
RemoveRuleNetworkFirewallPolicyRequest request =
RemoveRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
networkFirewallPoliciesClient.removeRuleOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RemoveRuleNetworkFirewallPolicyRequest,Operation> removeRuleCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
RemoveRuleNetworkFirewallPolicyRequest request =
RemoveRuleNetworkFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
networkFirewallPoliciesClient.removeRuleCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Policy setIamPolicy(String project, String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String resource = "resource-341064690";
GlobalSetPolicyRequest globalSetPolicyRequestResource =
GlobalSetPolicyRequest.newBuilder().build();
Policy response =
networkFirewallPoliciesClient.setIamPolicy(
project, resource, globalSetPolicyRequestResource);
}
project - Project ID for this request.resource - Name or id of the resource for this request.globalSetPolicyRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final Policy setIamPolicy(SetIamPolicyNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
SetIamPolicyNetworkFirewallPolicyRequest request =
SetIamPolicyNetworkFirewallPolicyRequest.newBuilder()
.setGlobalSetPolicyRequestResource(GlobalSetPolicyRequest.newBuilder().build())
.setProject("project-309310695")
.setResource("resource-341064690")
.build();
Policy response = networkFirewallPoliciesClient.setIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetIamPolicyNetworkFirewallPolicyRequest,Policy> setIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
SetIamPolicyNetworkFirewallPolicyRequest request =
SetIamPolicyNetworkFirewallPolicyRequest.newBuilder()
.setGlobalSetPolicyRequestResource(GlobalSetPolicyRequest.newBuilder().build())
.setProject("project-309310695")
.setResource("resource-341064690")
.build();
ApiFuture<Policy> future =
networkFirewallPoliciesClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final TestPermissionsResponse testIamPermissions(String project, String resource, TestPermissionsRequest testPermissionsRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
String project = "project-309310695";
String resource = "resource-341064690";
TestPermissionsRequest testPermissionsRequestResource =
TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response =
networkFirewallPoliciesClient.testIamPermissions(
project, resource, testPermissionsRequestResource);
}
project - Project ID for this request.resource - Name or id of the resource for this request.testPermissionsRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final TestPermissionsResponse testIamPermissions(TestIamPermissionsNetworkFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
TestIamPermissionsNetworkFirewallPolicyRequest request =
TestIamPermissionsNetworkFirewallPolicyRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.build();
TestPermissionsResponse response = networkFirewallPoliciesClient.testIamPermissions(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsNetworkFirewallPolicyRequest,TestPermissionsResponse> testIamPermissionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (NetworkFirewallPoliciesClient networkFirewallPoliciesClient =
NetworkFirewallPoliciesClient.create()) {
TestIamPermissionsNetworkFirewallPolicyRequest request =
TestIamPermissionsNetworkFirewallPolicyRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.build();
ApiFuture<TestPermissionsResponse> future =
networkFirewallPoliciesClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestPermissionsResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.