- 1.64.0 (latest)
- 1.63.0
- 1.62.0
- 1.61.0
- 1.59.0
- 1.58.0
- 1.57.0
- 1.56.0
- 1.55.0
- 1.54.0
- 1.53.0
- 1.52.0
- 1.51.0
- 1.50.0
- 1.49.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.38.0
- 1.37.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.26.0
- 1.25.0
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.1
- 1.11.0
- 1.9.1
- 1.8.1
- 1.7.2
- 1.6.0-beta
public class FirewallPoliciesClient implements BackgroundResource
Service Description: The FirewallPolicies API.
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 for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicy response = firewallPoliciesClient.get(firewallPolicy);
}
Note: close() needs to be called on the FirewallPoliciesClient 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 FirewallPoliciesSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
FirewallPoliciesSettings firewallPoliciesSettings =
FirewallPoliciesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
FirewallPoliciesClient firewallPoliciesClient =
FirewallPoliciesClient.create(firewallPoliciesSettings);
To customize the endpoint:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
FirewallPoliciesSettings firewallPoliciesSettings =
FirewallPoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
FirewallPoliciesClient firewallPoliciesClient =
FirewallPoliciesClient.create(firewallPoliciesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final FirewallPoliciesClient create()
Constructs an instance of FirewallPoliciesClient with default settings.
Type | Description |
FirewallPoliciesClient |
Type | Description |
IOException |
create(FirewallPoliciesSettings settings)
public static final FirewallPoliciesClient create(FirewallPoliciesSettings settings)
Constructs an instance of FirewallPoliciesClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | FirewallPoliciesSettings |
Type | Description |
FirewallPoliciesClient |
Type | Description |
IOException |
create(FirewallPoliciesStub stub)
public static final FirewallPoliciesClient create(FirewallPoliciesStub stub)
Constructs an instance of FirewallPoliciesClient, using the given stub for making calls. This is for advanced usage - prefer using create(FirewallPoliciesSettings).
Name | Description |
stub | FirewallPoliciesStub |
Type | Description |
FirewallPoliciesClient |
Constructors
FirewallPoliciesClient(FirewallPoliciesSettings settings)
protected FirewallPoliciesClient(FirewallPoliciesSettings settings)
Constructs an instance of FirewallPoliciesClient, 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.
Name | Description |
settings | FirewallPoliciesSettings |
FirewallPoliciesClient(FirewallPoliciesStub stub)
protected FirewallPoliciesClient(FirewallPoliciesStub stub)
Name | Description |
stub | FirewallPoliciesStub |
Methods
addAssociationAsync(AddAssociationFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> addAssociationAsync(AddAssociationFirewallPolicyRequest request)
Inserts an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
AddAssociationFirewallPolicyRequest request =
AddAssociationFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
.setReplaceExistingAssociation(true)
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.addAssociationAsync(request).get();
}
Name | Description |
request | AddAssociationFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
addAssociationAsync(String firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource)
public final OperationFuture<Operation,Operation> addAssociationAsync(String firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource)
Inserts an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyAssociation firewallPolicyAssociationResource =
FirewallPolicyAssociation.newBuilder().build();
Operation response =
firewallPoliciesClient
.addAssociationAsync(firewallPolicy, firewallPolicyAssociationResource)
.get();
}
Name | Description |
firewallPolicy | String Name of the firewall policy to update. |
firewallPolicyAssociationResource | FirewallPolicyAssociation The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
addAssociationCallable()
public final UnaryCallable<AddAssociationFirewallPolicyRequest,Operation> addAssociationCallable()
Inserts an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
AddAssociationFirewallPolicyRequest request =
AddAssociationFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
.setReplaceExistingAssociation(true)
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
firewallPoliciesClient.addAssociationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<AddAssociationFirewallPolicyRequest,Operation> |
addAssociationOperationCallable()
public final OperationCallable<AddAssociationFirewallPolicyRequest,Operation,Operation> addAssociationOperationCallable()
Inserts an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
AddAssociationFirewallPolicyRequest request =
AddAssociationFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyAssociationResource(FirewallPolicyAssociation.newBuilder().build())
.setReplaceExistingAssociation(true)
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
firewallPoliciesClient.addAssociationOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
OperationCallable<AddAssociationFirewallPolicyRequest,Operation,Operation> |
addRuleAsync(AddRuleFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> addRuleAsync(AddRuleFirewallPolicyRequest request)
Inserts a rule into a firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
AddRuleFirewallPolicyRequest request =
AddRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.addRuleAsync(request).get();
}
Name | Description |
request | AddRuleFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
addRuleAsync(String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
public final OperationFuture<Operation,Operation> addRuleAsync(String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
Inserts a rule into a firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
Operation response =
firewallPoliciesClient.addRuleAsync(firewallPolicy, firewallPolicyRuleResource).get();
}
Name | Description |
firewallPolicy | String Name of the firewall policy to update. |
firewallPolicyRuleResource | FirewallPolicyRule The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
addRuleCallable()
public final UnaryCallable<AddRuleFirewallPolicyRequest,Operation> addRuleCallable()
Inserts a rule into a firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
AddRuleFirewallPolicyRequest request =
AddRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = firewallPoliciesClient.addRuleCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<AddRuleFirewallPolicyRequest,Operation> |
addRuleOperationCallable()
public final OperationCallable<AddRuleFirewallPolicyRequest,Operation,Operation> addRuleOperationCallable()
Inserts a rule into a firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
AddRuleFirewallPolicyRequest request =
AddRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
firewallPoliciesClient.addRuleOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
OperationCallable<AddRuleFirewallPolicyRequest,Operation,Operation> |
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
cloneRulesAsync(CloneRulesFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> cloneRulesAsync(CloneRulesFirewallPolicyRequest request)
Copies rules to the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
CloneRulesFirewallPolicyRequest request =
CloneRulesFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setRequestId("requestId693933066")
.setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
.build();
Operation response = firewallPoliciesClient.cloneRulesAsync(request).get();
}
Name | Description |
request | CloneRulesFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
cloneRulesAsync(String firewallPolicy)
public final OperationFuture<Operation,Operation> cloneRulesAsync(String firewallPolicy)
Copies rules to the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
Operation response = firewallPoliciesClient.cloneRulesAsync(firewallPolicy).get();
}
Name | Description |
firewallPolicy | String Name of the firewall policy to update. |
Type | Description |
OperationFuture<Operation,Operation> |
cloneRulesCallable()
public final UnaryCallable<CloneRulesFirewallPolicyRequest,Operation> cloneRulesCallable()
Copies rules to the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
CloneRulesFirewallPolicyRequest request =
CloneRulesFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setRequestId("requestId693933066")
.setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
.build();
ApiFuture<Operation> future = firewallPoliciesClient.cloneRulesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<CloneRulesFirewallPolicyRequest,Operation> |
cloneRulesOperationCallable()
public final OperationCallable<CloneRulesFirewallPolicyRequest,Operation,Operation> cloneRulesOperationCallable()
Copies rules to the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
CloneRulesFirewallPolicyRequest request =
CloneRulesFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setRequestId("requestId693933066")
.setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
.build();
OperationFuture<Operation, Operation> future =
firewallPoliciesClient.cloneRulesOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
OperationCallable<CloneRulesFirewallPolicyRequest,Operation,Operation> |
close()
public final void close()
deleteAsync(DeleteFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> deleteAsync(DeleteFirewallPolicyRequest request)
Deletes the specified policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
DeleteFirewallPolicyRequest request =
DeleteFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.deleteAsync(request).get();
}
Name | Description |
request | DeleteFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
deleteAsync(String firewallPolicy)
public final OperationFuture<Operation,Operation> deleteAsync(String firewallPolicy)
Deletes the specified policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
Operation response = firewallPoliciesClient.deleteAsync(firewallPolicy).get();
}
Name | Description |
firewallPolicy | String Name of the firewall policy to delete. |
Type | Description |
OperationFuture<Operation,Operation> |
deleteCallable()
public final UnaryCallable<DeleteFirewallPolicyRequest,Operation> deleteCallable()
Deletes the specified policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
DeleteFirewallPolicyRequest request =
DeleteFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = firewallPoliciesClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<DeleteFirewallPolicyRequest,Operation> |
deleteOperationCallable()
public final OperationCallable<DeleteFirewallPolicyRequest,Operation,Operation> deleteOperationCallable()
Deletes the specified policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
DeleteFirewallPolicyRequest request =
DeleteFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
firewallPoliciesClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
OperationCallable<DeleteFirewallPolicyRequest,Operation,Operation> |
get(GetFirewallPolicyRequest request)
public final FirewallPolicy get(GetFirewallPolicyRequest request)
Returns the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetFirewallPolicyRequest request =
GetFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.build();
FirewallPolicy response = firewallPoliciesClient.get(request);
}
Name | Description |
request | GetFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
FirewallPolicy |
get(String firewallPolicy)
public final FirewallPolicy get(String firewallPolicy)
Returns the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicy response = firewallPoliciesClient.get(firewallPolicy);
}
Name | Description |
firewallPolicy | String Name of the firewall policy to get. |
Type | Description |
FirewallPolicy |
getAssociation(GetAssociationFirewallPolicyRequest request)
public final FirewallPolicyAssociation getAssociation(GetAssociationFirewallPolicyRequest request)
Gets an association with the specified name.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetAssociationFirewallPolicyRequest request =
GetAssociationFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.build();
FirewallPolicyAssociation response = firewallPoliciesClient.getAssociation(request);
}
Name | Description |
request | GetAssociationFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
FirewallPolicyAssociation |
getAssociation(String firewallPolicy)
public final FirewallPolicyAssociation getAssociation(String firewallPolicy)
Gets an association with the specified name.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyAssociation response = firewallPoliciesClient.getAssociation(firewallPolicy);
}
Name | Description |
firewallPolicy | String Name of the firewall policy to which the queried rule belongs. |
Type | Description |
FirewallPolicyAssociation |
getAssociationCallable()
public final UnaryCallable<GetAssociationFirewallPolicyRequest,FirewallPolicyAssociation> getAssociationCallable()
Gets an association with the specified name.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetAssociationFirewallPolicyRequest request =
GetAssociationFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.build();
ApiFuture<FirewallPolicyAssociation> future =
firewallPoliciesClient.getAssociationCallable().futureCall(request);
// Do something.
FirewallPolicyAssociation response = future.get();
}
Type | Description |
UnaryCallable<GetAssociationFirewallPolicyRequest,FirewallPolicyAssociation> |
getCallable()
public final UnaryCallable<GetFirewallPolicyRequest,FirewallPolicy> getCallable()
Returns the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetFirewallPolicyRequest request =
GetFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.build();
ApiFuture<FirewallPolicy> future = firewallPoliciesClient.getCallable().futureCall(request);
// Do something.
FirewallPolicy response = future.get();
}
Type | Description |
UnaryCallable<GetFirewallPolicyRequest,FirewallPolicy> |
getIamPolicy(GetIamPolicyFirewallPolicyRequest request)
public final Policy getIamPolicy(GetIamPolicyFirewallPolicyRequest request)
Gets the access control policy for a resource. May be empty if no such policy or resource exists.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetIamPolicyFirewallPolicyRequest request =
GetIamPolicyFirewallPolicyRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setResource("resource-341064690")
.build();
Policy response = firewallPoliciesClient.getIamPolicy(request);
}
Name | Description |
request | GetIamPolicyFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
Policy |
getIamPolicy(String resource)
public final Policy getIamPolicy(String resource)
Gets the access control policy for a resource. May be empty if no such policy or resource exists.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String resource = "resource-341064690";
Policy response = firewallPoliciesClient.getIamPolicy(resource);
}
Name | Description |
resource | String Name or id of the resource for this request. |
Type | Description |
Policy |
getIamPolicyCallable()
public final UnaryCallable<GetIamPolicyFirewallPolicyRequest,Policy> getIamPolicyCallable()
Gets the access control policy for a resource. May be empty if no such policy or resource exists.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetIamPolicyFirewallPolicyRequest request =
GetIamPolicyFirewallPolicyRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setResource("resource-341064690")
.build();
ApiFuture<Policy> future = firewallPoliciesClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
Type | Description |
UnaryCallable<GetIamPolicyFirewallPolicyRequest,Policy> |
getRule(GetRuleFirewallPolicyRequest request)
public final FirewallPolicyRule getRule(GetRuleFirewallPolicyRequest request)
Gets a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetRuleFirewallPolicyRequest request =
GetRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.build();
FirewallPolicyRule response = firewallPoliciesClient.getRule(request);
}
Name | Description |
request | GetRuleFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
FirewallPolicyRule |
getRule(String firewallPolicy)
public final FirewallPolicyRule getRule(String firewallPolicy)
Gets a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyRule response = firewallPoliciesClient.getRule(firewallPolicy);
}
Name | Description |
firewallPolicy | String Name of the firewall policy to which the queried rule belongs. |
Type | Description |
FirewallPolicyRule |
getRuleCallable()
public final UnaryCallable<GetRuleFirewallPolicyRequest,FirewallPolicyRule> getRuleCallable()
Gets a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetRuleFirewallPolicyRequest request =
GetRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.build();
ApiFuture<FirewallPolicyRule> future =
firewallPoliciesClient.getRuleCallable().futureCall(request);
// Do something.
FirewallPolicyRule response = future.get();
}
Type | Description |
UnaryCallable<GetRuleFirewallPolicyRequest,FirewallPolicyRule> |
getSettings()
public final FirewallPoliciesSettings getSettings()
Type | Description |
FirewallPoliciesSettings |
getStub()
public FirewallPoliciesStub getStub()
Type | Description |
FirewallPoliciesStub |
insertAsync(InsertFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> insertAsync(InsertFirewallPolicyRequest request)
Creates a new policy in the specified project using the data included in the request.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
InsertFirewallPolicyRequest request =
InsertFirewallPolicyRequest.newBuilder()
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.insertAsync(request).get();
}
Name | Description |
request | InsertFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
insertAsync(String parentId, FirewallPolicy firewallPolicyResource)
public final OperationFuture<Operation,Operation> insertAsync(String parentId, FirewallPolicy firewallPolicyResource)
Creates a new policy in the specified project using the data included in the request.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String parentId = "parentId1175162725";
FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
Operation response =
firewallPoliciesClient.insertAsync(parentId, firewallPolicyResource).get();
}
Name | Description |
parentId | String Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. |
firewallPolicyResource | FirewallPolicy The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
insertCallable()
public final UnaryCallable<InsertFirewallPolicyRequest,Operation> insertCallable()
Creates a new policy in the specified project using the data included in the request.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
InsertFirewallPolicyRequest request =
InsertFirewallPolicyRequest.newBuilder()
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = firewallPoliciesClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<InsertFirewallPolicyRequest,Operation> |
insertOperationCallable()
public final OperationCallable<InsertFirewallPolicyRequest,Operation,Operation> insertOperationCallable()
Creates a new policy in the specified project using the data included in the request.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
InsertFirewallPolicyRequest request =
InsertFirewallPolicyRequest.newBuilder()
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
firewallPoliciesClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
OperationCallable<InsertFirewallPolicyRequest,Operation,Operation> |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
list()
public final FirewallPoliciesClient.ListPagedResponse list()
Lists all the policies that have been configured for the specified folder or organization.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
for (FirewallPolicy element : firewallPoliciesClient.list().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
FirewallPoliciesClient.ListPagedResponse |
list(ListFirewallPoliciesRequest request)
public final FirewallPoliciesClient.ListPagedResponse list(ListFirewallPoliciesRequest request)
Lists all the policies that have been configured for the specified folder or organization.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
ListFirewallPoliciesRequest request =
ListFirewallPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
for (FirewallPolicy element : firewallPoliciesClient.list(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListFirewallPoliciesRequest The request object containing all of the parameters for the API call. |
Type | Description |
FirewallPoliciesClient.ListPagedResponse |
listAssociations()
public final FirewallPoliciesListAssociationsResponse listAssociations()
Lists associations of a specified target, i.e., organization or folder.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
FirewallPoliciesListAssociationsResponse response = firewallPoliciesClient.listAssociations();
}
Type | Description |
FirewallPoliciesListAssociationsResponse |
listAssociations(ListAssociationsFirewallPolicyRequest request)
public final FirewallPoliciesListAssociationsResponse listAssociations(ListAssociationsFirewallPolicyRequest request)
Lists associations of a specified target, i.e., organization or folder.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
ListAssociationsFirewallPolicyRequest request =
ListAssociationsFirewallPolicyRequest.newBuilder()
.setTargetResource("targetResource-1933150017")
.build();
FirewallPoliciesListAssociationsResponse response =
firewallPoliciesClient.listAssociations(request);
}
Name | Description |
request | ListAssociationsFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
FirewallPoliciesListAssociationsResponse |
listAssociationsCallable()
public final UnaryCallable<ListAssociationsFirewallPolicyRequest,FirewallPoliciesListAssociationsResponse> listAssociationsCallable()
Lists associations of a specified target, i.e., organization or folder.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
ListAssociationsFirewallPolicyRequest request =
ListAssociationsFirewallPolicyRequest.newBuilder()
.setTargetResource("targetResource-1933150017")
.build();
ApiFuture<FirewallPoliciesListAssociationsResponse> future =
firewallPoliciesClient.listAssociationsCallable().futureCall(request);
// Do something.
FirewallPoliciesListAssociationsResponse response = future.get();
}
Type | Description |
UnaryCallable<ListAssociationsFirewallPolicyRequest,FirewallPoliciesListAssociationsResponse> |
listCallable()
public final UnaryCallable<ListFirewallPoliciesRequest,FirewallPolicyList> listCallable()
Lists all the policies that have been configured for the specified folder or organization.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
ListFirewallPoliciesRequest request =
ListFirewallPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
while (true) {
FirewallPolicyList response = firewallPoliciesClient.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;
}
}
}
Type | Description |
UnaryCallable<ListFirewallPoliciesRequest,FirewallPolicyList> |
listPagedCallable()
public final UnaryCallable<ListFirewallPoliciesRequest,FirewallPoliciesClient.ListPagedResponse> listPagedCallable()
Lists all the policies that have been configured for the specified folder or organization.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
ListFirewallPoliciesRequest request =
ListFirewallPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setParentId("parentId1175162725")
.setReturnPartialSuccess(true)
.build();
ApiFuture<FirewallPolicy> future =
firewallPoliciesClient.listPagedCallable().futureCall(request);
// Do something.
for (FirewallPolicy element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListFirewallPoliciesRequest,ListPagedResponse> |
moveAsync(MoveFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> moveAsync(MoveFirewallPolicyRequest request)
Moves the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
MoveFirewallPolicyRequest request =
MoveFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.moveAsync(request).get();
}
Name | Description |
request | MoveFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
moveAsync(String firewallPolicy, String parentId)
public final OperationFuture<Operation,Operation> moveAsync(String firewallPolicy, String parentId)
Moves the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
String parentId = "parentId1175162725";
Operation response = firewallPoliciesClient.moveAsync(firewallPolicy, parentId).get();
}
Name | Description |
firewallPolicy | String Name of the firewall policy to update. |
parentId | String The new parent of the firewall policy. |
Type | Description |
OperationFuture<Operation,Operation> |
moveCallable()
public final UnaryCallable<MoveFirewallPolicyRequest,Operation> moveCallable()
Moves the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
MoveFirewallPolicyRequest request =
MoveFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = firewallPoliciesClient.moveCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<MoveFirewallPolicyRequest,Operation> |
moveOperationCallable()
public final OperationCallable<MoveFirewallPolicyRequest,Operation,Operation> moveOperationCallable()
Moves the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
MoveFirewallPolicyRequest request =
MoveFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
firewallPoliciesClient.moveOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
OperationCallable<MoveFirewallPolicyRequest,Operation,Operation> |
patchAsync(PatchFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> patchAsync(PatchFirewallPolicyRequest request)
Patches the specified policy with the data included in the request.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
PatchFirewallPolicyRequest request =
PatchFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.patchAsync(request).get();
}
Name | Description |
request | PatchFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
patchAsync(String firewallPolicy, FirewallPolicy firewallPolicyResource)
public final OperationFuture<Operation,Operation> patchAsync(String firewallPolicy, FirewallPolicy firewallPolicyResource)
Patches the specified policy with the data included in the request.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
Operation response =
firewallPoliciesClient.patchAsync(firewallPolicy, firewallPolicyResource).get();
}
Name | Description |
firewallPolicy | String Name of the firewall policy to update. |
firewallPolicyResource | FirewallPolicy The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
patchCallable()
public final UnaryCallable<PatchFirewallPolicyRequest,Operation> patchCallable()
Patches the specified policy with the data included in the request.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
PatchFirewallPolicyRequest request =
PatchFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = firewallPoliciesClient.patchCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<PatchFirewallPolicyRequest,Operation> |
patchOperationCallable()
public final OperationCallable<PatchFirewallPolicyRequest,Operation,Operation> patchOperationCallable()
Patches the specified policy with the data included in the request.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
PatchFirewallPolicyRequest request =
PatchFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
firewallPoliciesClient.patchOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
OperationCallable<PatchFirewallPolicyRequest,Operation,Operation> |
patchRuleAsync(PatchRuleFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> patchRuleAsync(PatchRuleFirewallPolicyRequest request)
Patches a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
PatchRuleFirewallPolicyRequest request =
PatchRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.patchRuleAsync(request).get();
}
Name | Description |
request | PatchRuleFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
patchRuleAsync(String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
public final OperationFuture<Operation,Operation> patchRuleAsync(String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
Patches a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
Operation response =
firewallPoliciesClient.patchRuleAsync(firewallPolicy, firewallPolicyRuleResource).get();
}
Name | Description |
firewallPolicy | String Name of the firewall policy to update. |
firewallPolicyRuleResource | FirewallPolicyRule The body resource for this request |
Type | Description |
OperationFuture<Operation,Operation> |
patchRuleCallable()
public final UnaryCallable<PatchRuleFirewallPolicyRequest,Operation> patchRuleCallable()
Patches a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
PatchRuleFirewallPolicyRequest request =
PatchRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = firewallPoliciesClient.patchRuleCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<PatchRuleFirewallPolicyRequest,Operation> |
patchRuleOperationCallable()
public final OperationCallable<PatchRuleFirewallPolicyRequest,Operation,Operation> patchRuleOperationCallable()
Patches a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
PatchRuleFirewallPolicyRequest request =
PatchRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
firewallPoliciesClient.patchRuleOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
OperationCallable<PatchRuleFirewallPolicyRequest,Operation,Operation> |
removeAssociationAsync(RemoveAssociationFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> removeAssociationAsync(RemoveAssociationFirewallPolicyRequest request)
Removes an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
RemoveAssociationFirewallPolicyRequest request =
RemoveAssociationFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.removeAssociationAsync(request).get();
}
Name | Description |
request | RemoveAssociationFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
removeAssociationAsync(String firewallPolicy)
public final OperationFuture<Operation,Operation> removeAssociationAsync(String firewallPolicy)
Removes an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
Operation response = firewallPoliciesClient.removeAssociationAsync(firewallPolicy).get();
}
Name | Description |
firewallPolicy | String Name of the firewall policy to update. |
Type | Description |
OperationFuture<Operation,Operation> |
removeAssociationCallable()
public final UnaryCallable<RemoveAssociationFirewallPolicyRequest,Operation> removeAssociationCallable()
Removes an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
RemoveAssociationFirewallPolicyRequest request =
RemoveAssociationFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
firewallPoliciesClient.removeAssociationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<RemoveAssociationFirewallPolicyRequest,Operation> |
removeAssociationOperationCallable()
public final OperationCallable<RemoveAssociationFirewallPolicyRequest,Operation,Operation> removeAssociationOperationCallable()
Removes an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
RemoveAssociationFirewallPolicyRequest request =
RemoveAssociationFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
firewallPoliciesClient.removeAssociationOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
OperationCallable<RemoveAssociationFirewallPolicyRequest,Operation,Operation> |
removeRuleAsync(RemoveRuleFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> removeRuleAsync(RemoveRuleFirewallPolicyRequest request)
Deletes a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
RemoveRuleFirewallPolicyRequest request =
RemoveRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.removeRuleAsync(request).get();
}
Name | Description |
request | RemoveRuleFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Operation,Operation> |
removeRuleAsync(String firewallPolicy)
public final OperationFuture<Operation,Operation> removeRuleAsync(String firewallPolicy)
Deletes a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
Operation response = firewallPoliciesClient.removeRuleAsync(firewallPolicy).get();
}
Name | Description |
firewallPolicy | String Name of the firewall policy to update. |
Type | Description |
OperationFuture<Operation,Operation> |
removeRuleCallable()
public final UnaryCallable<RemoveRuleFirewallPolicyRequest,Operation> removeRuleCallable()
Deletes a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
RemoveRuleFirewallPolicyRequest request =
RemoveRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = firewallPoliciesClient.removeRuleCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
UnaryCallable<RemoveRuleFirewallPolicyRequest,Operation> |
removeRuleOperationCallable()
public final OperationCallable<RemoveRuleFirewallPolicyRequest,Operation,Operation> removeRuleOperationCallable()
Deletes a rule of the specified priority.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
RemoveRuleFirewallPolicyRequest request =
RemoveRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
firewallPoliciesClient.removeRuleOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Type | Description |
OperationCallable<RemoveRuleFirewallPolicyRequest,Operation,Operation> |
setIamPolicy(SetIamPolicyFirewallPolicyRequest request)
public final Policy setIamPolicy(SetIamPolicyFirewallPolicyRequest request)
Sets the access control policy on the specified resource. Replaces any existing policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
SetIamPolicyFirewallPolicyRequest request =
SetIamPolicyFirewallPolicyRequest.newBuilder()
.setGlobalOrganizationSetPolicyRequestResource(
GlobalOrganizationSetPolicyRequest.newBuilder().build())
.setResource("resource-341064690")
.build();
Policy response = firewallPoliciesClient.setIamPolicy(request);
}
Name | Description |
request | SetIamPolicyFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
Policy |
setIamPolicy(String resource, GlobalOrganizationSetPolicyRequest globalOrganizationSetPolicyRequestResource)
public final Policy setIamPolicy(String resource, GlobalOrganizationSetPolicyRequest globalOrganizationSetPolicyRequestResource)
Sets the access control policy on the specified resource. Replaces any existing policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String resource = "resource-341064690";
GlobalOrganizationSetPolicyRequest globalOrganizationSetPolicyRequestResource =
GlobalOrganizationSetPolicyRequest.newBuilder().build();
Policy response =
firewallPoliciesClient.setIamPolicy(resource, globalOrganizationSetPolicyRequestResource);
}
Name | Description |
resource | String Name or id of the resource for this request. |
globalOrganizationSetPolicyRequestResource | GlobalOrganizationSetPolicyRequest The body resource for this request |
Type | Description |
Policy |
setIamPolicyCallable()
public final UnaryCallable<SetIamPolicyFirewallPolicyRequest,Policy> setIamPolicyCallable()
Sets the access control policy on the specified resource. Replaces any existing policy.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
SetIamPolicyFirewallPolicyRequest request =
SetIamPolicyFirewallPolicyRequest.newBuilder()
.setGlobalOrganizationSetPolicyRequestResource(
GlobalOrganizationSetPolicyRequest.newBuilder().build())
.setResource("resource-341064690")
.build();
ApiFuture<Policy> future = firewallPoliciesClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
Type | Description |
UnaryCallable<SetIamPolicyFirewallPolicyRequest,Policy> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
testIamPermissions(TestIamPermissionsFirewallPolicyRequest request)
public final TestPermissionsResponse testIamPermissions(TestIamPermissionsFirewallPolicyRequest request)
Returns permissions that a caller has on the specified resource.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
TestIamPermissionsFirewallPolicyRequest request =
TestIamPermissionsFirewallPolicyRequest.newBuilder()
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.build();
TestPermissionsResponse response = firewallPoliciesClient.testIamPermissions(request);
}
Name | Description |
request | TestIamPermissionsFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Type | Description |
TestPermissionsResponse |
testIamPermissions(String resource, TestPermissionsRequest testPermissionsRequestResource)
public final TestPermissionsResponse testIamPermissions(String resource, TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String resource = "resource-341064690";
TestPermissionsRequest testPermissionsRequestResource =
TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response =
firewallPoliciesClient.testIamPermissions(resource, testPermissionsRequestResource);
}
Name | Description |
resource | String Name or id of the resource for this request. |
testPermissionsRequestResource | TestPermissionsRequest The body resource for this request |
Type | Description |
TestPermissionsResponse |
testIamPermissionsCallable()
public final UnaryCallable<TestIamPermissionsFirewallPolicyRequest,TestPermissionsResponse> testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
TestIamPermissionsFirewallPolicyRequest request =
TestIamPermissionsFirewallPolicyRequest.newBuilder()
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.build();
ApiFuture<TestPermissionsResponse> future =
firewallPoliciesClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestPermissionsResponse response = future.get();
}
Type | Description |
UnaryCallable<TestIamPermissionsFirewallPolicyRequest,TestPermissionsResponse> |