@Generated(value="by gapic-generator-java") public class FirewallPoliciesClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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().
| Method | Description | Method Variants |
|---|---|---|
AddAssociation |
Inserts an association for the specified firewall policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AddRule |
Inserts a rule into a firewall policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CloneRules |
Copies rules to the specified firewall policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Delete |
Deletes the specified policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Get |
Returns the specified firewall policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetAssociation |
Gets an association with the specified name. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. May be empty if no such policy or resource exists. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRule |
Gets a rule of the specified priority. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Insert |
Creates a new policy in the specified project using the data included in the request. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
List |
Lists all the policies that have been configured for the specified folder or organization. |
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.
|
ListAssociations |
Lists associations of a specified target, i.e., organization or folder. |
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.
|
Move |
Moves the specified firewall policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Patch |
Patches the specified policy with the data included in the request. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
PatchRule |
Patches a rule of the specified priority. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveAssociation |
Removes an association for the specified firewall policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RemoveRule |
Deletes a rule of the specified priority. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replaces any existing policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of FirewallPoliciesSettings 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
FirewallPoliciesSettings firewallPoliciesSettings =
FirewallPoliciesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
FirewallPoliciesClient firewallPoliciesClient =
FirewallPoliciesClient.create(firewallPoliciesSettings);
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
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
FirewallPoliciesClient.ListFixedSizeCollection |
static class |
FirewallPoliciesClient.ListPage |
static class |
FirewallPoliciesClient.ListPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
FirewallPoliciesClient(FirewallPoliciesSettings settings)
Constructs an instance of FirewallPoliciesClient, using the given settings.
|
protected |
FirewallPoliciesClient(FirewallPoliciesStub stub) |
| Modifier and Type | Method and Description |
|---|---|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addAssociationAsync(AddAssociationFirewallPolicyRequest request)
Inserts an association for the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addAssociationAsync(String firewallPolicy,
FirewallPolicyAssociation firewallPolicyAssociationResource)
Inserts an association for the specified firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<AddAssociationFirewallPolicyRequest,Operation> |
addAssociationCallable()
Inserts an association for the specified firewall policy.
|
com.google.api.gax.rpc.OperationCallable<AddAssociationFirewallPolicyRequest,Operation,Operation> |
addAssociationOperationCallable()
Inserts an association for the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addRuleAsync(AddRuleFirewallPolicyRequest request)
Inserts a rule into a firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
addRuleAsync(String firewallPolicy,
FirewallPolicyRule firewallPolicyRuleResource)
Inserts a rule into a firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<AddRuleFirewallPolicyRequest,Operation> |
addRuleCallable()
Inserts a rule into a firewall policy.
|
com.google.api.gax.rpc.OperationCallable<AddRuleFirewallPolicyRequest,Operation,Operation> |
addRuleOperationCallable()
Inserts a rule into a firewall policy.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
cloneRulesAsync(CloneRulesFirewallPolicyRequest request)
Copies rules to the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
cloneRulesAsync(String firewallPolicy)
Copies rules to the specified firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<CloneRulesFirewallPolicyRequest,Operation> |
cloneRulesCallable()
Copies rules to the specified firewall policy.
|
com.google.api.gax.rpc.OperationCallable<CloneRulesFirewallPolicyRequest,Operation,Operation> |
cloneRulesOperationCallable()
Copies rules to the specified firewall policy.
|
void |
close() |
static FirewallPoliciesClient |
create()
Constructs an instance of FirewallPoliciesClient with default settings.
|
static FirewallPoliciesClient |
create(FirewallPoliciesSettings settings)
Constructs an instance of FirewallPoliciesClient, using the given settings.
|
static FirewallPoliciesClient |
create(FirewallPoliciesStub stub)
Constructs an instance of FirewallPoliciesClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(DeleteFirewallPolicyRequest request)
Deletes the specified policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
deleteAsync(String firewallPolicy)
Deletes the specified policy.
|
com.google.api.gax.rpc.UnaryCallable<DeleteFirewallPolicyRequest,Operation> |
deleteCallable()
Deletes the specified policy.
|
com.google.api.gax.rpc.OperationCallable<DeleteFirewallPolicyRequest,Operation,Operation> |
deleteOperationCallable()
Deletes the specified policy.
|
FirewallPolicy |
get(GetFirewallPolicyRequest request)
Returns the specified firewall policy.
|
FirewallPolicy |
get(String firewallPolicy)
Returns the specified firewall policy.
|
FirewallPolicyAssociation |
getAssociation(GetAssociationFirewallPolicyRequest request)
Gets an association with the specified name.
|
FirewallPolicyAssociation |
getAssociation(String firewallPolicy)
Gets an association with the specified name.
|
com.google.api.gax.rpc.UnaryCallable<GetAssociationFirewallPolicyRequest,FirewallPolicyAssociation> |
getAssociationCallable()
Gets an association with the specified name.
|
com.google.api.gax.rpc.UnaryCallable<GetFirewallPolicyRequest,FirewallPolicy> |
getCallable()
Returns the specified firewall policy.
|
Policy |
getIamPolicy(GetIamPolicyFirewallPolicyRequest request)
Gets the access control policy for a resource.
|
Policy |
getIamPolicy(String resource)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<GetIamPolicyFirewallPolicyRequest,Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
FirewallPolicyRule |
getRule(GetRuleFirewallPolicyRequest request)
Gets a rule of the specified priority.
|
FirewallPolicyRule |
getRule(String firewallPolicy)
Gets a rule of the specified priority.
|
com.google.api.gax.rpc.UnaryCallable<GetRuleFirewallPolicyRequest,FirewallPolicyRule> |
getRuleCallable()
Gets a rule of the specified priority.
|
FirewallPoliciesSettings |
getSettings() |
FirewallPoliciesStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(InsertFirewallPolicyRequest request)
Creates a new policy in the specified project using the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
insertAsync(String parentId,
FirewallPolicy firewallPolicyResource)
Creates a new policy in the specified project using the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertFirewallPolicyRequest,Operation> |
insertCallable()
Creates a new policy in the specified project using the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<InsertFirewallPolicyRequest,Operation,Operation> |
insertOperationCallable()
Creates a new policy in the specified project using the data included in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
FirewallPoliciesClient.ListPagedResponse |
list()
Lists all the policies that have been configured for the specified folder or organization.
|
FirewallPoliciesClient.ListPagedResponse |
list(ListFirewallPoliciesRequest request)
Lists all the policies that have been configured for the specified folder or organization.
|
FirewallPoliciesListAssociationsResponse |
listAssociations()
Lists associations of a specified target, i.e., organization or folder.
|
FirewallPoliciesListAssociationsResponse |
listAssociations(ListAssociationsFirewallPolicyRequest request)
Lists associations of a specified target, i.e., organization or folder.
|
com.google.api.gax.rpc.UnaryCallable<ListAssociationsFirewallPolicyRequest,FirewallPoliciesListAssociationsResponse> |
listAssociationsCallable()
Lists associations of a specified target, i.e., organization or folder.
|
com.google.api.gax.rpc.UnaryCallable<ListFirewallPoliciesRequest,FirewallPolicyList> |
listCallable()
Lists all the policies that have been configured for the specified folder or organization.
|
com.google.api.gax.rpc.UnaryCallable<ListFirewallPoliciesRequest,FirewallPoliciesClient.ListPagedResponse> |
listPagedCallable()
Lists all the policies that have been configured for the specified folder or organization.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
moveAsync(MoveFirewallPolicyRequest request)
Moves the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
moveAsync(String firewallPolicy,
String parentId)
Moves the specified firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<MoveFirewallPolicyRequest,Operation> |
moveCallable()
Moves the specified firewall policy.
|
com.google.api.gax.rpc.OperationCallable<MoveFirewallPolicyRequest,Operation,Operation> |
moveOperationCallable()
Moves the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchAsync(PatchFirewallPolicyRequest request)
Patches the specified policy with the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchAsync(String firewallPolicy,
FirewallPolicy firewallPolicyResource)
Patches the specified policy with the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<PatchFirewallPolicyRequest,Operation> |
patchCallable()
Patches the specified policy with the data included in the request.
|
com.google.api.gax.rpc.OperationCallable<PatchFirewallPolicyRequest,Operation,Operation> |
patchOperationCallable()
Patches the specified policy with the data included in the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchRuleAsync(PatchRuleFirewallPolicyRequest request)
Patches a rule of the specified priority.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
patchRuleAsync(String firewallPolicy,
FirewallPolicyRule firewallPolicyRuleResource)
Patches a rule of the specified priority.
|
com.google.api.gax.rpc.UnaryCallable<PatchRuleFirewallPolicyRequest,Operation> |
patchRuleCallable()
Patches a rule of the specified priority.
|
com.google.api.gax.rpc.OperationCallable<PatchRuleFirewallPolicyRequest,Operation,Operation> |
patchRuleOperationCallable()
Patches a rule of the specified priority.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeAssociationAsync(RemoveAssociationFirewallPolicyRequest request)
Removes an association for the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeAssociationAsync(String firewallPolicy)
Removes an association for the specified firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<RemoveAssociationFirewallPolicyRequest,Operation> |
removeAssociationCallable()
Removes an association for the specified firewall policy.
|
com.google.api.gax.rpc.OperationCallable<RemoveAssociationFirewallPolicyRequest,Operation,Operation> |
removeAssociationOperationCallable()
Removes an association for the specified firewall policy.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeRuleAsync(RemoveRuleFirewallPolicyRequest request)
Deletes a rule of the specified priority.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
removeRuleAsync(String firewallPolicy)
Deletes a rule of the specified priority.
|
com.google.api.gax.rpc.UnaryCallable<RemoveRuleFirewallPolicyRequest,Operation> |
removeRuleCallable()
Deletes a rule of the specified priority.
|
com.google.api.gax.rpc.OperationCallable<RemoveRuleFirewallPolicyRequest,Operation,Operation> |
removeRuleOperationCallable()
Deletes a rule of the specified priority.
|
Policy |
setIamPolicy(SetIamPolicyFirewallPolicyRequest request)
Sets the access control policy on the specified resource.
|
Policy |
setIamPolicy(String resource,
GlobalOrganizationSetPolicyRequest globalOrganizationSetPolicyRequestResource)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<SetIamPolicyFirewallPolicyRequest,Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
void |
shutdown() |
void |
shutdownNow() |
TestPermissionsResponse |
testIamPermissions(String resource,
TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
|
TestPermissionsResponse |
testIamPermissions(TestIamPermissionsFirewallPolicyRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsFirewallPolicyRequest,TestPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
protected FirewallPoliciesClient(FirewallPoliciesSettings settings) throws IOException
IOExceptionprotected FirewallPoliciesClient(FirewallPoliciesStub stub)
public static final FirewallPoliciesClient create() throws IOException
IOExceptionpublic static final FirewallPoliciesClient create(FirewallPoliciesSettings settings) throws IOException
IOExceptionpublic static final FirewallPoliciesClient create(FirewallPoliciesStub stub)
public final FirewallPoliciesSettings getSettings()
public FirewallPoliciesStub getStub()
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addAssociationAsync(String firewallPolicy, FirewallPolicyAssociation firewallPolicyAssociationResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyAssociation firewallPolicyAssociationResource =
FirewallPolicyAssociation.newBuilder().build();
Operation response =
firewallPoliciesClient
.addAssociationAsync(firewallPolicy, firewallPolicyAssociationResource)
.get();
}
firewallPolicy - Name of the firewall policy to update.firewallPolicyAssociationResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addAssociationAsync(AddAssociationFirewallPolicyRequest 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 (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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<AddAssociationFirewallPolicyRequest,Operation,Operation> addAssociationOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.rpc.UnaryCallable<AddAssociationFirewallPolicyRequest,Operation> addAssociationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addRuleAsync(String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
Operation response =
firewallPoliciesClient.addRuleAsync(firewallPolicy, firewallPolicyRuleResource).get();
}
firewallPolicy - Name of the firewall policy to update.firewallPolicyRuleResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> addRuleAsync(AddRuleFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
AddRuleFirewallPolicyRequest request =
AddRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyRuleResource(FirewallPolicyRule.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.addRuleAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<AddRuleFirewallPolicyRequest,Operation,Operation> addRuleOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.rpc.UnaryCallable<AddRuleFirewallPolicyRequest,Operation> addRuleCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> cloneRulesAsync(String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
Operation response = firewallPoliciesClient.cloneRulesAsync(firewallPolicy).get();
}
firewallPolicy - Name of the firewall policy to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> cloneRulesAsync(CloneRulesFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
CloneRulesFirewallPolicyRequest request =
CloneRulesFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setRequestId("requestId693933066")
.setSourceFirewallPolicy("sourceFirewallPolicy-593774771")
.build();
Operation response = firewallPoliciesClient.cloneRulesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CloneRulesFirewallPolicyRequest,Operation,Operation> cloneRulesOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.rpc.UnaryCallable<CloneRulesFirewallPolicyRequest,Operation> cloneRulesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
Operation response = firewallPoliciesClient.deleteAsync(firewallPolicy).get();
}
firewallPolicy - Name of the firewall policy to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> deleteAsync(DeleteFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
DeleteFirewallPolicyRequest request =
DeleteFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.deleteAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteFirewallPolicyRequest,Operation,Operation> deleteOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteFirewallPolicyRequest,Operation> deleteCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final FirewallPolicy get(String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicy response = firewallPoliciesClient.get(firewallPolicy);
}
firewallPolicy - Name of the firewall policy to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicy get(GetFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetFirewallPolicyRequest request =
GetFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.build();
FirewallPolicy response = firewallPoliciesClient.get(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetFirewallPolicyRequest,FirewallPolicy> getCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetFirewallPolicyRequest request =
GetFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.build();
ApiFuture<FirewallPolicy> future = firewallPoliciesClient.getCallable().futureCall(request);
// Do something.
FirewallPolicy response = future.get();
}
public final FirewallPolicyAssociation getAssociation(String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyAssociation response = firewallPoliciesClient.getAssociation(firewallPolicy);
}
firewallPolicy - Name of the firewall policy to which the queried rule belongs.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicyAssociation getAssociation(GetAssociationFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetAssociationFirewallPolicyRequest request =
GetAssociationFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.build();
FirewallPolicyAssociation response = firewallPoliciesClient.getAssociation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetAssociationFirewallPolicyRequest,FirewallPolicyAssociation> getAssociationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final Policy getIamPolicy(String resource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String resource = "resource-341064690";
Policy response = firewallPoliciesClient.getIamPolicy(resource);
}
resource - Name or id of the resource for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Policy getIamPolicy(GetIamPolicyFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetIamPolicyFirewallPolicyRequest request =
GetIamPolicyFirewallPolicyRequest.newBuilder()
.setOptionsRequestedPolicyVersion(-574521795)
.setResource("resource-341064690")
.build();
Policy response = firewallPoliciesClient.getIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetIamPolicyFirewallPolicyRequest,Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final FirewallPolicyRule getRule(String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyRule response = firewallPoliciesClient.getRule(firewallPolicy);
}
firewallPolicy - Name of the firewall policy to which the queried rule belongs.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicyRule getRule(GetRuleFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
GetRuleFirewallPolicyRequest request =
GetRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.build();
FirewallPolicyRule response = firewallPoliciesClient.getRule(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRuleFirewallPolicyRequest,FirewallPolicyRule> getRuleCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(String parentId, FirewallPolicy firewallPolicyResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String parentId = "parentId1175162725";
FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
Operation response =
firewallPoliciesClient.insertAsync(parentId, firewallPolicyResource).get();
}
parentId - 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 - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> insertAsync(InsertFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
InsertFirewallPolicyRequest request =
InsertFirewallPolicyRequest.newBuilder()
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.insertAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<InsertFirewallPolicyRequest,Operation,Operation> insertOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.rpc.UnaryCallable<InsertFirewallPolicyRequest,Operation> insertCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final FirewallPoliciesClient.ListPagedResponse list()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
for (FirewallPolicy element : firewallPoliciesClient.list().iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPoliciesClient.ListPagedResponse list(ListFirewallPoliciesRequest 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 (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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListFirewallPoliciesRequest,FirewallPoliciesClient.ListPagedResponse> listPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListFirewallPoliciesRequest,FirewallPolicyList> listCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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;
}
}
}
public final FirewallPoliciesListAssociationsResponse listAssociations()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
FirewallPoliciesListAssociationsResponse response = firewallPoliciesClient.listAssociations();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPoliciesListAssociationsResponse listAssociations(ListAssociationsFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
ListAssociationsFirewallPolicyRequest request =
ListAssociationsFirewallPolicyRequest.newBuilder()
.setTargetResource("targetResource-1933150017")
.build();
FirewallPoliciesListAssociationsResponse response =
firewallPoliciesClient.listAssociations(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListAssociationsFirewallPolicyRequest,FirewallPoliciesListAssociationsResponse> listAssociationsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> moveAsync(String firewallPolicy, String parentId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
String parentId = "parentId1175162725";
Operation response = firewallPoliciesClient.moveAsync(firewallPolicy, parentId).get();
}
firewallPolicy - Name of the firewall policy to update.parentId - The new parent of the firewall policy. 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.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> moveAsync(MoveFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
MoveFirewallPolicyRequest request =
MoveFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setParentId("parentId1175162725")
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.moveAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<MoveFirewallPolicyRequest,Operation,Operation> moveOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final com.google.api.gax.rpc.UnaryCallable<MoveFirewallPolicyRequest,Operation> moveCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(String firewallPolicy, FirewallPolicy firewallPolicyResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicy firewallPolicyResource = FirewallPolicy.newBuilder().build();
Operation response =
firewallPoliciesClient.patchAsync(firewallPolicy, firewallPolicyResource).get();
}
firewallPolicy - Name of the firewall policy to update.firewallPolicyResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchAsync(PatchFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
PatchFirewallPolicyRequest request =
PatchFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setFirewallPolicyResource(FirewallPolicy.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.patchAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<PatchFirewallPolicyRequest,Operation,Operation> patchOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.rpc.UnaryCallable<PatchFirewallPolicyRequest,Operation> patchCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchRuleAsync(String firewallPolicy, FirewallPolicyRule firewallPolicyRuleResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
FirewallPolicyRule firewallPolicyRuleResource = FirewallPolicyRule.newBuilder().build();
Operation response =
firewallPoliciesClient.patchRuleAsync(firewallPolicy, firewallPolicyRuleResource).get();
}
firewallPolicy - Name of the firewall policy to update.firewallPolicyRuleResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> patchRuleAsync(PatchRuleFirewallPolicyRequest 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 (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();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<PatchRuleFirewallPolicyRequest,Operation,Operation> patchRuleOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.rpc.UnaryCallable<PatchRuleFirewallPolicyRequest,Operation> patchRuleCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeAssociationAsync(String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
Operation response = firewallPoliciesClient.removeAssociationAsync(firewallPolicy).get();
}
firewallPolicy - Name of the firewall policy to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeAssociationAsync(RemoveAssociationFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
RemoveAssociationFirewallPolicyRequest request =
RemoveAssociationFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setName("name3373707")
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.removeAssociationAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RemoveAssociationFirewallPolicyRequest,Operation,Operation> removeAssociationOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.rpc.UnaryCallable<RemoveAssociationFirewallPolicyRequest,Operation> removeAssociationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeRuleAsync(String firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String firewallPolicy = "firewallPolicy1819692626";
Operation response = firewallPoliciesClient.removeRuleAsync(firewallPolicy).get();
}
firewallPolicy - Name of the firewall policy to update.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> removeRuleAsync(RemoveRuleFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
RemoveRuleFirewallPolicyRequest request =
RemoveRuleFirewallPolicyRequest.newBuilder()
.setFirewallPolicy("firewallPolicy1819692626")
.setPriority(-1165461084)
.setRequestId("requestId693933066")
.build();
Operation response = firewallPoliciesClient.removeRuleAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<RemoveRuleFirewallPolicyRequest,Operation,Operation> removeRuleOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final com.google.api.gax.rpc.UnaryCallable<RemoveRuleFirewallPolicyRequest,Operation> removeRuleCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final Policy setIamPolicy(String resource, GlobalOrganizationSetPolicyRequest globalOrganizationSetPolicyRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String resource = "resource-341064690";
GlobalOrganizationSetPolicyRequest globalOrganizationSetPolicyRequestResource =
GlobalOrganizationSetPolicyRequest.newBuilder().build();
Policy response =
firewallPoliciesClient.setIamPolicy(resource, globalOrganizationSetPolicyRequestResource);
}
resource - Name or id of the resource for this request.globalOrganizationSetPolicyRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final Policy setIamPolicy(SetIamPolicyFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
SetIamPolicyFirewallPolicyRequest request =
SetIamPolicyFirewallPolicyRequest.newBuilder()
.setGlobalOrganizationSetPolicyRequestResource(
GlobalOrganizationSetPolicyRequest.newBuilder().build())
.setResource("resource-341064690")
.build();
Policy response = firewallPoliciesClient.setIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SetIamPolicyFirewallPolicyRequest,Policy> setIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final TestPermissionsResponse testIamPermissions(String resource, TestPermissionsRequest testPermissionsRequestResource)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
String resource = "resource-341064690";
TestPermissionsRequest testPermissionsRequestResource =
TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response =
firewallPoliciesClient.testIamPermissions(resource, testPermissionsRequestResource);
}
resource - Name or id of the resource for this request.testPermissionsRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final TestPermissionsResponse testIamPermissions(TestIamPermissionsFirewallPolicyRequest 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 (FirewallPoliciesClient firewallPoliciesClient = FirewallPoliciesClient.create()) {
TestIamPermissionsFirewallPolicyRequest request =
TestIamPermissionsFirewallPolicyRequest.newBuilder()
.setResource("resource-341064690")
.setTestPermissionsRequestResource(TestPermissionsRequest.newBuilder().build())
.build();
TestPermissionsResponse response = firewallPoliciesClient.testIamPermissions(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsFirewallPolicyRequest,TestPermissionsResponse> testIamPermissionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (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();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.