- 1.65.0 (latest)
- 1.64.0
- 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
GitHub Repository | Product Reference |
Service Description: The NetworkFirewallPolicies 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 and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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
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
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
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
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
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
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
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
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
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.
Static Methods
create()
public static final NetworkFirewallPoliciesClient create()
Constructs an instance of NetworkFirewallPoliciesClient with default settings.
Returns | |
---|---|
Type | Description |
NetworkFirewallPoliciesClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(NetworkFirewallPoliciesSettings settings)
public static final NetworkFirewallPoliciesClient create(NetworkFirewallPoliciesSettings settings)
Constructs an instance of NetworkFirewallPoliciesClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Parameter | |
---|---|
Name | Description |
settings | NetworkFirewallPoliciesSettings |
Returns | |
---|---|
Type | Description |
NetworkFirewallPoliciesClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(NetworkFirewallPoliciesStub stub)
public static final NetworkFirewallPoliciesClient create(NetworkFirewallPoliciesStub stub)
Constructs an instance of NetworkFirewallPoliciesClient, using the given stub for making calls. This is for advanced usage - prefer using create(NetworkFirewallPoliciesSettings).
Parameter | |
---|---|
Name | Description |
stub | NetworkFirewallPoliciesStub |
Returns | |
---|---|
Type | Description |
NetworkFirewallPoliciesClient |
Constructors
NetworkFirewallPoliciesClient(NetworkFirewallPoliciesSettings settings)
protected NetworkFirewallPoliciesClient(NetworkFirewallPoliciesSettings settings)
Constructs an instance of NetworkFirewallPoliciesClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Parameter | |
---|---|
Name | Description |
settings | NetworkFirewallPoliciesSettings |
NetworkFirewallPoliciesClient(NetworkFirewallPoliciesStub stub)
protected NetworkFirewallPoliciesClient(NetworkFirewallPoliciesStub stub)
Parameter | |
---|---|
Name | Description |
stub | NetworkFirewallPoliciesStub |
Methods
addAssociationAsync(AddAssociationNetworkFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> addAssociationAsync(AddAssociationNetworkFirewallPolicyRequest request)
Inserts an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | AddAssociationNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
addAssociationAsync(String project, String firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource)
public final OperationFuture<Operation,Operation> addAssociationAsync(String project, String firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource)
Inserts an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to update. |
firewallPolicyAssociationResource | FirewallPolicyAssociation The body resource for this request |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
addAssociationCallable()
public final UnaryCallable<AddAssociationNetworkFirewallPolicyRequest,Operation> addAssociationCallable()
Inserts an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<AddAssociationNetworkFirewallPolicyRequest,Operation> |
addAssociationOperationCallable()
public final OperationCallable<AddAssociationNetworkFirewallPolicyRequest,Operation,Operation> addAssociationOperationCallable()
Inserts an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<AddAssociationNetworkFirewallPolicyRequest,Operation,Operation> |
addRuleAsync(AddRuleNetworkFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> addRuleAsync(AddRuleNetworkFirewallPolicyRequest request)
Inserts a rule into a firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | AddRuleNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
addRuleAsync(String project, String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
public final OperationFuture<Operation,Operation> addRuleAsync(String project, String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
Inserts a rule into a firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to update. |
firewallPolicyRuleResource | FirewallPolicyRule The body resource for this request |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
addRuleCallable()
public final UnaryCallable<AddRuleNetworkFirewallPolicyRequest,Operation> addRuleCallable()
Inserts a rule into a firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<AddRuleNetworkFirewallPolicyRequest,Operation> |
addRuleOperationCallable()
public final OperationCallable<AddRuleNetworkFirewallPolicyRequest,Operation,Operation> addRuleOperationCallable()
Inserts a rule into a firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<AddRuleNetworkFirewallPolicyRequest,Operation,Operation> |
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration | long |
unit | TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
cloneRulesAsync(CloneRulesNetworkFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> cloneRulesAsync(CloneRulesNetworkFirewallPolicyRequest request)
Copies rules to the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | CloneRulesNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
cloneRulesAsync(String project, String firewallPolicy)
public final OperationFuture<Operation,Operation> cloneRulesAsync(String project, String firewallPolicy)
Copies rules to the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to update. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
cloneRulesCallable()
public final UnaryCallable<CloneRulesNetworkFirewallPolicyRequest,Operation> cloneRulesCallable()
Copies rules to the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CloneRulesNetworkFirewallPolicyRequest,Operation> |
cloneRulesOperationCallable()
public final OperationCallable<CloneRulesNetworkFirewallPolicyRequest,Operation,Operation> cloneRulesOperationCallable()
Copies rules to the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CloneRulesNetworkFirewallPolicyRequest,Operation,Operation> |
close()
public final void close()
deleteAsync(DeleteNetworkFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> deleteAsync(DeleteNetworkFirewallPolicyRequest request)
Deletes the specified policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | DeleteNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
deleteAsync(String project, String firewallPolicy)
public final OperationFuture<Operation,Operation> deleteAsync(String project, String firewallPolicy)
Deletes the specified policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to delete. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
deleteCallable()
public final UnaryCallable<DeleteNetworkFirewallPolicyRequest,Operation> deleteCallable()
Deletes the specified policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteNetworkFirewallPolicyRequest,Operation> |
deleteOperationCallable()
public final OperationCallable<DeleteNetworkFirewallPolicyRequest,Operation,Operation> deleteOperationCallable()
Deletes the specified policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteNetworkFirewallPolicyRequest,Operation,Operation> |
get(GetNetworkFirewallPolicyRequest request)
public final FirewallPolicy get(GetNetworkFirewallPolicyRequest request)
Returns the specified network firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameter | |
---|---|
Name | Description |
request | GetNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
FirewallPolicy |
get(String project, String firewallPolicy)
public final FirewallPolicy get(String project, String firewallPolicy)
Returns the specified network firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to get. |
Returns | |
---|---|
Type | Description |
FirewallPolicy |
getAssociation(GetAssociationNetworkFirewallPolicyRequest request)
public final FirewallPolicyAssociation getAssociation(GetAssociationNetworkFirewallPolicyRequest request)
Gets an association with the specified name.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameter | |
---|---|
Name | Description |
request | GetAssociationNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
FirewallPolicyAssociation |
getAssociation(String project, String firewallPolicy)
public final FirewallPolicyAssociation getAssociation(String project, String firewallPolicy)
Gets an association with the specified name.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to which the queried association belongs. |
Returns | |
---|---|
Type | Description |
FirewallPolicyAssociation |
getAssociationCallable()
public final UnaryCallable<GetAssociationNetworkFirewallPolicyRequest,FirewallPolicyAssociation> getAssociationCallable()
Gets an association with the specified name.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetAssociationNetworkFirewallPolicyRequest,FirewallPolicyAssociation> |
getCallable()
public final UnaryCallable<GetNetworkFirewallPolicyRequest,FirewallPolicy> getCallable()
Returns the specified network firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetNetworkFirewallPolicyRequest,FirewallPolicy> |
getIamPolicy(GetIamPolicyNetworkFirewallPolicyRequest request)
public final Policy getIamPolicy(GetIamPolicyNetworkFirewallPolicyRequest 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 and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameter | |
---|---|
Name | Description |
request | GetIamPolicyNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Policy |
getIamPolicy(String project, String resource)
public final Policy getIamPolicy(String project, 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 and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
resource | String Name or id of the resource for this request. |
Returns | |
---|---|
Type | Description |
Policy |
getIamPolicyCallable()
public final UnaryCallable<GetIamPolicyNetworkFirewallPolicyRequest,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 and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetIamPolicyNetworkFirewallPolicyRequest,Policy> |
getRule(GetRuleNetworkFirewallPolicyRequest request)
public final FirewallPolicyRule getRule(GetRuleNetworkFirewallPolicyRequest request)
Gets a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameter | |
---|---|
Name | Description |
request | GetRuleNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
FirewallPolicyRule |
getRule(String project, String firewallPolicy)
public final FirewallPolicyRule getRule(String project, String firewallPolicy)
Gets a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to which the queried rule belongs. |
Returns | |
---|---|
Type | Description |
FirewallPolicyRule |
getRuleCallable()
public final UnaryCallable<GetRuleNetworkFirewallPolicyRequest,FirewallPolicyRule> getRuleCallable()
Gets a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetRuleNetworkFirewallPolicyRequest,FirewallPolicyRule> |
getSettings()
public final NetworkFirewallPoliciesSettings getSettings()
Returns | |
---|---|
Type | Description |
NetworkFirewallPoliciesSettings |
getStub()
public NetworkFirewallPoliciesStub getStub()
Returns | |
---|---|
Type | Description |
NetworkFirewallPoliciesStub |
insertAsync(InsertNetworkFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> insertAsync(InsertNetworkFirewallPolicyRequest request)
Creates a new policy in the specified project using the data included in the 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();
}
Parameter | |
---|---|
Name | Description |
request | InsertNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
insertAsync(String project, FirewallPolicy firewallPolicyResource)
public final OperationFuture<Operation,Operation> insertAsync(String project, 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 and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicyResource | FirewallPolicy The body resource for this request |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
insertCallable()
public final UnaryCallable<InsertNetworkFirewallPolicyRequest,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 and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<InsertNetworkFirewallPolicyRequest,Operation> |
insertOperationCallable()
public final OperationCallable<InsertNetworkFirewallPolicyRequest,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 and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<InsertNetworkFirewallPolicyRequest,Operation,Operation> |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
boolean |
list(ListNetworkFirewallPoliciesRequest request)
public final NetworkFirewallPoliciesClient.ListPagedResponse list(ListNetworkFirewallPoliciesRequest request)
Lists all the policies that have been configured for the specified 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()) {
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);
}
}
Parameter | |
---|---|
Name | Description |
request | ListNetworkFirewallPoliciesRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
NetworkFirewallPoliciesClient.ListPagedResponse |
list(String project)
public final NetworkFirewallPoliciesClient.ListPagedResponse list(String project)
Lists all the policies that have been configured for the specified 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);
}
}
Parameter | |
---|---|
Name | Description |
project | String Project ID for this request. |
Returns | |
---|---|
Type | Description |
NetworkFirewallPoliciesClient.ListPagedResponse |
listCallable()
public final UnaryCallable<ListNetworkFirewallPoliciesRequest,FirewallPolicyList> listCallable()
Lists all the policies that have been configured for the specified 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()) {
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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListNetworkFirewallPoliciesRequest,FirewallPolicyList> |
listPagedCallable()
public final UnaryCallable<ListNetworkFirewallPoliciesRequest,NetworkFirewallPoliciesClient.ListPagedResponse> listPagedCallable()
Lists all the policies that have been configured for the specified 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()) {
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);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListNetworkFirewallPoliciesRequest,ListPagedResponse> |
patchAsync(PatchNetworkFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> patchAsync(PatchNetworkFirewallPolicyRequest request)
Patches the specified policy with the data included in the 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();
}
Parameter | |
---|---|
Name | Description |
request | PatchNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
patchAsync(String project, String firewallPolicy, FirewallPolicy firewallPolicyResource)
public final OperationFuture<Operation,Operation> patchAsync(String project, String firewallPolicy, FirewallPolicy firewallPolicyResource)
Patches the specified policy with the data included in the 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()) {
String project = "project-309310695";
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
Operation response =
networkFirewallPoliciesClient
.patchAsync(project, firewallPolicy, firewallPolicyResource)
.get();
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to update. |
firewallPolicyResource | FirewallPolicy The body resource for this request |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
patchCallable()
public final UnaryCallable<PatchNetworkFirewallPolicyRequest,Operation> patchCallable()
Patches the specified policy with the data included in the 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();
ApiFuture<Operation> future =
networkFirewallPoliciesClient.patchCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<PatchNetworkFirewallPolicyRequest,Operation> |
patchOperationCallable()
public final OperationCallable<PatchNetworkFirewallPolicyRequest,Operation,Operation> patchOperationCallable()
Patches the specified policy with the data included in the 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();
OperationFuture<Operation, Operation> future =
networkFirewallPoliciesClient.patchOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<PatchNetworkFirewallPolicyRequest,Operation,Operation> |
patchRuleAsync(PatchRuleNetworkFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> patchRuleAsync(PatchRuleNetworkFirewallPolicyRequest request)
Patches a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | PatchRuleNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
patchRuleAsync(String project, String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
public final OperationFuture<Operation,Operation> patchRuleAsync(String project, String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
Patches a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to update. |
firewallPolicyRuleResource | FirewallPolicyRule The body resource for this request |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
patchRuleCallable()
public final UnaryCallable<PatchRuleNetworkFirewallPolicyRequest,Operation> patchRuleCallable()
Patches a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<PatchRuleNetworkFirewallPolicyRequest,Operation> |
patchRuleOperationCallable()
public final OperationCallable<PatchRuleNetworkFirewallPolicyRequest,Operation,Operation> patchRuleOperationCallable()
Patches a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<PatchRuleNetworkFirewallPolicyRequest,Operation,Operation> |
removeAssociationAsync(RemoveAssociationNetworkFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> removeAssociationAsync(RemoveAssociationNetworkFirewallPolicyRequest request)
Removes an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | RemoveAssociationNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
removeAssociationAsync(String project, String firewallPolicy)
public final OperationFuture<Operation,Operation> removeAssociationAsync(String project, String firewallPolicy)
Removes an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to update. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
removeAssociationCallable()
public final UnaryCallable<RemoveAssociationNetworkFirewallPolicyRequest,Operation> removeAssociationCallable()
Removes an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<RemoveAssociationNetworkFirewallPolicyRequest,Operation> |
removeAssociationOperationCallable()
public final OperationCallable<RemoveAssociationNetworkFirewallPolicyRequest,Operation,Operation> removeAssociationOperationCallable()
Removes an association for the specified firewall policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<RemoveAssociationNetworkFirewallPolicyRequest,Operation,Operation> |
removeRuleAsync(RemoveRuleNetworkFirewallPolicyRequest request)
public final OperationFuture<Operation,Operation> removeRuleAsync(RemoveRuleNetworkFirewallPolicyRequest request)
Deletes a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | RemoveRuleNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
removeRuleAsync(String project, String firewallPolicy)
public final OperationFuture<Operation,Operation> removeRuleAsync(String project, String firewallPolicy)
Deletes a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
firewallPolicy | String Name of the firewall policy to update. |
Returns | |
---|---|
Type | Description |
OperationFuture<Operation,Operation> |
removeRuleCallable()
public final UnaryCallable<RemoveRuleNetworkFirewallPolicyRequest,Operation> removeRuleCallable()
Deletes a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<RemoveRuleNetworkFirewallPolicyRequest,Operation> |
removeRuleOperationCallable()
public final OperationCallable<RemoveRuleNetworkFirewallPolicyRequest,Operation,Operation> removeRuleOperationCallable()
Deletes a rule of the specified priority.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<RemoveRuleNetworkFirewallPolicyRequest,Operation,Operation> |
setIamPolicy(SetIamPolicyNetworkFirewallPolicyRequest request)
public final Policy setIamPolicy(SetIamPolicyNetworkFirewallPolicyRequest request)
Sets the access control policy on the specified resource. Replaces any existing policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameter | |
---|---|
Name | Description |
request | SetIamPolicyNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Policy |
setIamPolicy(String project, String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource)
public final Policy setIamPolicy(String project, String resource, GlobalSetPolicyRequest globalSetPolicyRequestResource)
Sets the access control policy on the specified resource. Replaces any existing policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
resource | String Name or id of the resource for this request. |
globalSetPolicyRequestResource | GlobalSetPolicyRequest The body resource for this request |
Returns | |
---|---|
Type | Description |
Policy |
setIamPolicyCallable()
public final UnaryCallable<SetIamPolicyNetworkFirewallPolicyRequest,Policy> setIamPolicyCallable()
Sets the access control policy on the specified resource. Replaces any existing policy.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<SetIamPolicyNetworkFirewallPolicyRequest,Policy> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
testIamPermissions(TestIamPermissionsNetworkFirewallPolicyRequest request)
public final TestPermissionsResponse testIamPermissions(TestIamPermissionsNetworkFirewallPolicyRequest request)
Returns permissions that a caller has on the specified 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()) {
TestIamPermissionsNetworkFirewallPolicyRequest request =
TestIamPermissionsNetworkFirewallPolicyRequest.newBuilder()
.setProject("project-309310695")
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.build();
TestPermissionsResponse response = networkFirewallPoliciesClient.testIamPermissions(request);
}
Parameter | |
---|---|
Name | Description |
request | TestIamPermissionsNetworkFirewallPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
TestPermissionsResponse |
testIamPermissions(String project, String resource, TestPermissionsRequest testPermissionsRequestResource)
public final TestPermissionsResponse testIamPermissions(String project, String resource, TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified 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";
TestPermissionsRequest testPermissionsRequestResource =
TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response =
networkFirewallPoliciesClient.testIamPermissions(
project, resource, testPermissionsRequestResource);
}
Parameters | |
---|---|
Name | Description |
project | String Project ID for this request. |
resource | String Name or id of the resource for this request. |
testPermissionsRequestResource | TestPermissionsRequest The body resource for this request |
Returns | |
---|---|
Type | Description |
TestPermissionsResponse |
testIamPermissionsCallable()
public final UnaryCallable<TestIamPermissionsNetworkFirewallPolicyRequest,TestPermissionsResponse> testIamPermissionsCallable()
Returns permissions that a caller has on the specified 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()) {
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<TestIamPermissionsNetworkFirewallPolicyRequest,TestPermissionsResponse> |