Class VpcFlowLogsServiceClient

java.lang.Object
com.google.cloud.networkmanagement.v1.VpcFlowLogsServiceClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class VpcFlowLogsServiceClient extends Object implements BackgroundResource
Service Description: The VPC Flow Logs service in the Google Cloud Network Management API provides configurations that generate Flow Logs. The service and the configuration resources created using this service are global.

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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
   VpcFlowLogsConfigName name =
       VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
           "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]");
   VpcFlowLogsConfig response = vpcFlowLogsServiceClient.getVpcFlowLogsConfig(name);
 }
 

Note: close() needs to be called on the VpcFlowLogsServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

ListVpcFlowLogsConfigs

Lists all `VpcFlowLogsConfigs` in a given project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listVpcFlowLogsConfigs(ListVpcFlowLogsConfigsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listVpcFlowLogsConfigs(LocationName parent)

  • listVpcFlowLogsConfigs(OrganizationLocationName parent)

  • listVpcFlowLogsConfigs(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listVpcFlowLogsConfigsPagedCallable()

  • listVpcFlowLogsConfigsCallable()

GetVpcFlowLogsConfig

Gets the details of a specific `VpcFlowLogsConfig`.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getVpcFlowLogsConfig(GetVpcFlowLogsConfigRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getVpcFlowLogsConfig(VpcFlowLogsConfigName name)

  • getVpcFlowLogsConfig(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getVpcFlowLogsConfigCallable()

CreateVpcFlowLogsConfig

Creates a new `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

1. Creating a configuration with `state=DISABLED` will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createVpcFlowLogsConfigAsync(CreateVpcFlowLogsConfigRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createVpcFlowLogsConfigAsync(LocationName parent, VpcFlowLogsConfig vpcFlowLogsConfig, VpcFlowLogsConfigName vpcFlowLogsConfigId)

  • createVpcFlowLogsConfigAsync(LocationName parent, VpcFlowLogsConfig vpcFlowLogsConfig, String vpcFlowLogsConfigId)

  • createVpcFlowLogsConfigAsync(OrganizationLocationName parent, VpcFlowLogsConfig vpcFlowLogsConfig, VpcFlowLogsConfigName vpcFlowLogsConfigId)

  • createVpcFlowLogsConfigAsync(OrganizationLocationName parent, VpcFlowLogsConfig vpcFlowLogsConfig, String vpcFlowLogsConfigId)

  • createVpcFlowLogsConfigAsync(String parent, VpcFlowLogsConfig vpcFlowLogsConfig, VpcFlowLogsConfigName vpcFlowLogsConfigId)

  • createVpcFlowLogsConfigAsync(String parent, VpcFlowLogsConfig vpcFlowLogsConfig, String vpcFlowLogsConfigId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createVpcFlowLogsConfigOperationCallable()

  • createVpcFlowLogsConfigCallable()

UpdateVpcFlowLogsConfig

Updates an existing `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

1. Updating a configuration with `state=DISABLED` will fail. 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - updating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateVpcFlowLogsConfigAsync(UpdateVpcFlowLogsConfigRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateVpcFlowLogsConfigAsync(VpcFlowLogsConfig vpcFlowLogsConfig, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateVpcFlowLogsConfigOperationCallable()

  • updateVpcFlowLogsConfigCallable()

DeleteVpcFlowLogsConfig

Deletes a specific `VpcFlowLogsConfig`.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteVpcFlowLogsConfigAsync(DeleteVpcFlowLogsConfigRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteVpcFlowLogsConfigAsync(VpcFlowLogsConfigName name)

  • deleteVpcFlowLogsConfigAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteVpcFlowLogsConfigOperationCallable()

  • deleteVpcFlowLogsConfigCallable()

QueryOrgVpcFlowLogsConfigs

QueryOrgVpcFlowLogsConfigs returns a list of all organization-level VPC Flow Logs configurations applicable to the specified project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • queryOrgVpcFlowLogsConfigs(QueryOrgVpcFlowLogsConfigsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • queryOrgVpcFlowLogsConfigsPagedCallable()

  • queryOrgVpcFlowLogsConfigsCallable()

ShowEffectiveFlowLogsConfigs

ShowEffectiveFlowLogsConfigs returns a list of all VPC Flow Logs configurations applicable to a specified resource.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • showEffectiveFlowLogsConfigs(ShowEffectiveFlowLogsConfigsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • showEffectiveFlowLogsConfigsPagedCallable()

  • showEffectiveFlowLogsConfigsCallable()

ListLocations

Lists information about the supported locations for this service.This method can be called in two ways:

* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getIamPolicy(GetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • testIamPermissions(TestIamPermissionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

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 VpcFlowLogsServiceSettings 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
 VpcFlowLogsServiceSettings vpcFlowLogsServiceSettings =
     VpcFlowLogsServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 VpcFlowLogsServiceClient vpcFlowLogsServiceClient =
     VpcFlowLogsServiceClient.create(vpcFlowLogsServiceSettings);
 

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
 VpcFlowLogsServiceSettings vpcFlowLogsServiceSettings =
     VpcFlowLogsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 VpcFlowLogsServiceClient vpcFlowLogsServiceClient =
     VpcFlowLogsServiceClient.create(vpcFlowLogsServiceSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 VpcFlowLogsServiceSettings vpcFlowLogsServiceSettings =
     VpcFlowLogsServiceSettings.newHttpJsonBuilder().build();
 VpcFlowLogsServiceClient vpcFlowLogsServiceClient =
     VpcFlowLogsServiceClient.create(vpcFlowLogsServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

  • Constructor Details

    • VpcFlowLogsServiceClient

      protected VpcFlowLogsServiceClient(VpcFlowLogsServiceSettings settings) throws IOException
      Constructs an instance of VpcFlowLogsServiceClient, 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.
      Throws:
      IOException
    • VpcFlowLogsServiceClient

      protected VpcFlowLogsServiceClient(VpcFlowLogsServiceStub stub)
  • Method Details

    • create

      public static final VpcFlowLogsServiceClient create() throws IOException
      Constructs an instance of VpcFlowLogsServiceClient with default settings.
      Throws:
      IOException
    • create

      public static final VpcFlowLogsServiceClient create(VpcFlowLogsServiceSettings settings) throws IOException
      Constructs an instance of VpcFlowLogsServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
      Throws:
      IOException
    • create

      public static final VpcFlowLogsServiceClient create(VpcFlowLogsServiceStub stub)
      Constructs an instance of VpcFlowLogsServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(VpcFlowLogsServiceSettings).
    • getSettings

      public final VpcFlowLogsServiceSettings getSettings()
    • getStub

      public VpcFlowLogsServiceStub getStub()
    • getOperationsClient

      public final OperationsClient getOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • getHttpJsonOperationsClient

      @BetaApi public final OperationsClient getHttpJsonOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • listVpcFlowLogsConfigs

      public final VpcFlowLogsServiceClient.ListVpcFlowLogsConfigsPagedResponse listVpcFlowLogsConfigs(LocationName parent)
      Lists all `VpcFlowLogsConfigs` in a given 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (VpcFlowLogsConfig element :
             vpcFlowLogsServiceClient.listVpcFlowLogsConfigs(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource of the VpcFlowLogsConfig, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global`

      - For organization-level resources: `organizations/{organization_id}/locations/global`

      Throws:
      ApiException - if the remote call fails
    • listVpcFlowLogsConfigs

      Lists all `VpcFlowLogsConfigs` in a given 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
         for (VpcFlowLogsConfig element :
             vpcFlowLogsServiceClient.listVpcFlowLogsConfigs(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource of the VpcFlowLogsConfig, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global`

      - For organization-level resources: `organizations/{organization_id}/locations/global`

      Throws:
      ApiException - if the remote call fails
    • listVpcFlowLogsConfigs

      public final VpcFlowLogsServiceClient.ListVpcFlowLogsConfigsPagedResponse listVpcFlowLogsConfigs(String parent)
      Lists all `VpcFlowLogsConfigs` in a given 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (VpcFlowLogsConfig element :
             vpcFlowLogsServiceClient.listVpcFlowLogsConfigs(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource of the VpcFlowLogsConfig, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global`

      - For organization-level resources: `organizations/{organization_id}/locations/global`

      Throws:
      ApiException - if the remote call fails
    • listVpcFlowLogsConfigs

      Lists all `VpcFlowLogsConfigs` in a given 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         ListVpcFlowLogsConfigsRequest request =
             ListVpcFlowLogsConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (VpcFlowLogsConfig element :
             vpcFlowLogsServiceClient.listVpcFlowLogsConfigs(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listVpcFlowLogsConfigsPagedCallable

      Lists all `VpcFlowLogsConfigs` in a given 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         ListVpcFlowLogsConfigsRequest request =
             ListVpcFlowLogsConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<VpcFlowLogsConfig> future =
             vpcFlowLogsServiceClient.listVpcFlowLogsConfigsPagedCallable().futureCall(request);
         // Do something.
         for (VpcFlowLogsConfig element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listVpcFlowLogsConfigsCallable

      public final UnaryCallable<ListVpcFlowLogsConfigsRequest,ListVpcFlowLogsConfigsResponse> listVpcFlowLogsConfigsCallable()
      Lists all `VpcFlowLogsConfigs` in a given 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         ListVpcFlowLogsConfigsRequest request =
             ListVpcFlowLogsConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListVpcFlowLogsConfigsResponse response =
               vpcFlowLogsServiceClient.listVpcFlowLogsConfigsCallable().call(request);
           for (VpcFlowLogsConfig element : response.getVpcFlowLogsConfigsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getVpcFlowLogsConfig

      public final VpcFlowLogsConfig getVpcFlowLogsConfig(VpcFlowLogsConfigName name)
      Gets the details of a specific `VpcFlowLogsConfig`.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         VpcFlowLogsConfigName name =
             VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                 "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]");
         VpcFlowLogsConfig response = vpcFlowLogsServiceClient.getVpcFlowLogsConfig(name);
       }
       
      Parameters:
      name - Required. The resource name of the VpcFlowLogsConfig, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`

      - For organization-level resources: `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`

      Throws:
      ApiException - if the remote call fails
    • getVpcFlowLogsConfig

      public final VpcFlowLogsConfig getVpcFlowLogsConfig(String name)
      Gets the details of a specific `VpcFlowLogsConfig`.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         String name =
             VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                     "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                 .toString();
         VpcFlowLogsConfig response = vpcFlowLogsServiceClient.getVpcFlowLogsConfig(name);
       }
       
      Parameters:
      name - Required. The resource name of the VpcFlowLogsConfig, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`

      - For organization-level resources: `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`

      Throws:
      ApiException - if the remote call fails
    • getVpcFlowLogsConfig

      public final VpcFlowLogsConfig getVpcFlowLogsConfig(GetVpcFlowLogsConfigRequest request)
      Gets the details of a specific `VpcFlowLogsConfig`.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         GetVpcFlowLogsConfigRequest request =
             GetVpcFlowLogsConfigRequest.newBuilder()
                 .setName(
                     VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                             "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                         .toString())
                 .build();
         VpcFlowLogsConfig response = vpcFlowLogsServiceClient.getVpcFlowLogsConfig(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getVpcFlowLogsConfigCallable

      public final UnaryCallable<GetVpcFlowLogsConfigRequest,VpcFlowLogsConfig> getVpcFlowLogsConfigCallable()
      Gets the details of a specific `VpcFlowLogsConfig`.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         GetVpcFlowLogsConfigRequest request =
             GetVpcFlowLogsConfigRequest.newBuilder()
                 .setName(
                     VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                             "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                         .toString())
                 .build();
         ApiFuture<VpcFlowLogsConfig> future =
             vpcFlowLogsServiceClient.getVpcFlowLogsConfigCallable().futureCall(request);
         // Do something.
         VpcFlowLogsConfig response = future.get();
       }
       
    • createVpcFlowLogsConfigAsync

      public final OperationFuture<VpcFlowLogsConfig,OperationMetadata> createVpcFlowLogsConfigAsync(LocationName parent, VpcFlowLogsConfig vpcFlowLogsConfig, VpcFlowLogsConfigName vpcFlowLogsConfigId)
      Creates a new `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Creating a configuration with `state=DISABLED` will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         VpcFlowLogsConfig vpcFlowLogsConfig = VpcFlowLogsConfig.newBuilder().build();
         VpcFlowLogsConfigName vpcFlowLogsConfigId =
             VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                 "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]");
         VpcFlowLogsConfig response =
             vpcFlowLogsServiceClient
                 .createVpcFlowLogsConfigAsync(parent, vpcFlowLogsConfig, vpcFlowLogsConfigId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the VpcFlowLogsConfig to create, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global`

      - For organization-level resources: `organizations/{organization_id}/locations/global`

      vpcFlowLogsConfig - Required. A `VpcFlowLogsConfig` resource
      vpcFlowLogsConfigId - Required. ID of the `VpcFlowLogsConfig`.
      Throws:
      ApiException - if the remote call fails
    • createVpcFlowLogsConfigAsync

      public final OperationFuture<VpcFlowLogsConfig,OperationMetadata> createVpcFlowLogsConfigAsync(LocationName parent, VpcFlowLogsConfig vpcFlowLogsConfig, String vpcFlowLogsConfigId)
      Creates a new `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Creating a configuration with `state=DISABLED` will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         VpcFlowLogsConfig vpcFlowLogsConfig = VpcFlowLogsConfig.newBuilder().build();
         String vpcFlowLogsConfigId =
             VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                     "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                 .toString();
         VpcFlowLogsConfig response =
             vpcFlowLogsServiceClient
                 .createVpcFlowLogsConfigAsync(parent, vpcFlowLogsConfig, vpcFlowLogsConfigId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the VpcFlowLogsConfig to create, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global`

      - For organization-level resources: `organizations/{organization_id}/locations/global`

      vpcFlowLogsConfig - Required. A `VpcFlowLogsConfig` resource
      vpcFlowLogsConfigId - Required. ID of the `VpcFlowLogsConfig`.
      Throws:
      ApiException - if the remote call fails
    • createVpcFlowLogsConfigAsync

      public final OperationFuture<VpcFlowLogsConfig,OperationMetadata> createVpcFlowLogsConfigAsync(OrganizationLocationName parent, VpcFlowLogsConfig vpcFlowLogsConfig, VpcFlowLogsConfigName vpcFlowLogsConfigId)
      Creates a new `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Creating a configuration with `state=DISABLED` will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
         VpcFlowLogsConfig vpcFlowLogsConfig = VpcFlowLogsConfig.newBuilder().build();
         VpcFlowLogsConfigName vpcFlowLogsConfigId =
             VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                 "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]");
         VpcFlowLogsConfig response =
             vpcFlowLogsServiceClient
                 .createVpcFlowLogsConfigAsync(parent, vpcFlowLogsConfig, vpcFlowLogsConfigId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the VpcFlowLogsConfig to create, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global`

      - For organization-level resources: `organizations/{organization_id}/locations/global`

      vpcFlowLogsConfig - Required. A `VpcFlowLogsConfig` resource
      vpcFlowLogsConfigId - Required. ID of the `VpcFlowLogsConfig`.
      Throws:
      ApiException - if the remote call fails
    • createVpcFlowLogsConfigAsync

      public final OperationFuture<VpcFlowLogsConfig,OperationMetadata> createVpcFlowLogsConfigAsync(OrganizationLocationName parent, VpcFlowLogsConfig vpcFlowLogsConfig, String vpcFlowLogsConfigId)
      Creates a new `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Creating a configuration with `state=DISABLED` will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
         VpcFlowLogsConfig vpcFlowLogsConfig = VpcFlowLogsConfig.newBuilder().build();
         String vpcFlowLogsConfigId =
             VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                     "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                 .toString();
         VpcFlowLogsConfig response =
             vpcFlowLogsServiceClient
                 .createVpcFlowLogsConfigAsync(parent, vpcFlowLogsConfig, vpcFlowLogsConfigId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the VpcFlowLogsConfig to create, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global`

      - For organization-level resources: `organizations/{organization_id}/locations/global`

      vpcFlowLogsConfig - Required. A `VpcFlowLogsConfig` resource
      vpcFlowLogsConfigId - Required. ID of the `VpcFlowLogsConfig`.
      Throws:
      ApiException - if the remote call fails
    • createVpcFlowLogsConfigAsync

      public final OperationFuture<VpcFlowLogsConfig,OperationMetadata> createVpcFlowLogsConfigAsync(String parent, VpcFlowLogsConfig vpcFlowLogsConfig, VpcFlowLogsConfigName vpcFlowLogsConfigId)
      Creates a new `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Creating a configuration with `state=DISABLED` will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         VpcFlowLogsConfig vpcFlowLogsConfig = VpcFlowLogsConfig.newBuilder().build();
         VpcFlowLogsConfigName vpcFlowLogsConfigId =
             VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                 "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]");
         VpcFlowLogsConfig response =
             vpcFlowLogsServiceClient
                 .createVpcFlowLogsConfigAsync(parent, vpcFlowLogsConfig, vpcFlowLogsConfigId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the VpcFlowLogsConfig to create, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global`

      - For organization-level resources: `organizations/{organization_id}/locations/global`

      vpcFlowLogsConfig - Required. A `VpcFlowLogsConfig` resource
      vpcFlowLogsConfigId - Required. ID of the `VpcFlowLogsConfig`.
      Throws:
      ApiException - if the remote call fails
    • createVpcFlowLogsConfigAsync

      public final OperationFuture<VpcFlowLogsConfig,OperationMetadata> createVpcFlowLogsConfigAsync(String parent, VpcFlowLogsConfig vpcFlowLogsConfig, String vpcFlowLogsConfigId)
      Creates a new `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Creating a configuration with `state=DISABLED` will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         VpcFlowLogsConfig vpcFlowLogsConfig = VpcFlowLogsConfig.newBuilder().build();
         String vpcFlowLogsConfigId =
             VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                     "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                 .toString();
         VpcFlowLogsConfig response =
             vpcFlowLogsServiceClient
                 .createVpcFlowLogsConfigAsync(parent, vpcFlowLogsConfig, vpcFlowLogsConfigId)
                 .get();
       }
       
      Parameters:
      parent - Required. The parent resource of the VpcFlowLogsConfig to create, in one of the following formats:

      - For project-level resources: `projects/{project_id}/locations/global`

      - For organization-level resources: `organizations/{organization_id}/locations/global`

      vpcFlowLogsConfig - Required. A `VpcFlowLogsConfig` resource
      vpcFlowLogsConfigId - Required. ID of the `VpcFlowLogsConfig`.
      Throws:
      ApiException - if the remote call fails
    • createVpcFlowLogsConfigAsync

      public final OperationFuture<VpcFlowLogsConfig,OperationMetadata> createVpcFlowLogsConfigAsync(CreateVpcFlowLogsConfigRequest request)
      Creates a new `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Creating a configuration with `state=DISABLED` will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         CreateVpcFlowLogsConfigRequest request =
             CreateVpcFlowLogsConfigRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setVpcFlowLogsConfigId(
                     VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                             "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                         .toString())
                 .setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build())
                 .build();
         VpcFlowLogsConfig response =
             vpcFlowLogsServiceClient.createVpcFlowLogsConfigAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createVpcFlowLogsConfigOperationCallable

      public final OperationCallable<CreateVpcFlowLogsConfigRequest,VpcFlowLogsConfig,OperationMetadata> createVpcFlowLogsConfigOperationCallable()
      Creates a new `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Creating a configuration with `state=DISABLED` will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         CreateVpcFlowLogsConfigRequest request =
             CreateVpcFlowLogsConfigRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setVpcFlowLogsConfigId(
                     VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                             "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                         .toString())
                 .setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build())
                 .build();
         OperationFuture<VpcFlowLogsConfig, OperationMetadata> future =
             vpcFlowLogsServiceClient.createVpcFlowLogsConfigOperationCallable().futureCall(request);
         // Do something.
         VpcFlowLogsConfig response = future.get();
       }
       
    • createVpcFlowLogsConfigCallable

      public final UnaryCallable<CreateVpcFlowLogsConfigRequest,Operation> createVpcFlowLogsConfigCallable()
      Creates a new `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Creating a configuration with `state=DISABLED` will fail 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - creating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         CreateVpcFlowLogsConfigRequest request =
             CreateVpcFlowLogsConfigRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setVpcFlowLogsConfigId(
                     VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                             "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                         .toString())
                 .setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             vpcFlowLogsServiceClient.createVpcFlowLogsConfigCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateVpcFlowLogsConfigAsync

      public final OperationFuture<VpcFlowLogsConfig,OperationMetadata> updateVpcFlowLogsConfigAsync(VpcFlowLogsConfig vpcFlowLogsConfig, com.google.protobuf.FieldMask updateMask)
      Updates an existing `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Updating a configuration with `state=DISABLED` will fail. 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - updating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         VpcFlowLogsConfig vpcFlowLogsConfig = VpcFlowLogsConfig.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         VpcFlowLogsConfig response =
             vpcFlowLogsServiceClient
                 .updateVpcFlowLogsConfigAsync(vpcFlowLogsConfig, updateMask)
                 .get();
       }
       
      Parameters:
      vpcFlowLogsConfig - Required. Only fields specified in update_mask are updated.
      updateMask - Required. Mask of fields to update. At least one path must be supplied in this field. For example, to change the state of the configuration to ENABLED, specify `update_mask` = `"state"`, and the `vpc_flow_logs_config` would be: `vpc_flow_logs_config = { name = "projects/my-project/locations/global/vpcFlowLogsConfigs/my-config" state = "ENABLED" }`
      Throws:
      ApiException - if the remote call fails
    • updateVpcFlowLogsConfigAsync

      public final OperationFuture<VpcFlowLogsConfig,OperationMetadata> updateVpcFlowLogsConfigAsync(UpdateVpcFlowLogsConfigRequest request)
      Updates an existing `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Updating a configuration with `state=DISABLED` will fail. 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - updating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         UpdateVpcFlowLogsConfigRequest request =
             UpdateVpcFlowLogsConfigRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build())
                 .build();
         VpcFlowLogsConfig response =
             vpcFlowLogsServiceClient.updateVpcFlowLogsConfigAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateVpcFlowLogsConfigOperationCallable

      public final OperationCallable<UpdateVpcFlowLogsConfigRequest,VpcFlowLogsConfig,OperationMetadata> updateVpcFlowLogsConfigOperationCallable()
      Updates an existing `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Updating a configuration with `state=DISABLED` will fail. 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - updating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         UpdateVpcFlowLogsConfigRequest request =
             UpdateVpcFlowLogsConfigRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build())
                 .build();
         OperationFuture<VpcFlowLogsConfig, OperationMetadata> future =
             vpcFlowLogsServiceClient.updateVpcFlowLogsConfigOperationCallable().futureCall(request);
         // Do something.
         VpcFlowLogsConfig response = future.get();
       }
       
    • updateVpcFlowLogsConfigCallable

      public final UnaryCallable<UpdateVpcFlowLogsConfigRequest,Operation> updateVpcFlowLogsConfigCallable()
      Updates an existing `VpcFlowLogsConfig`. If a configuration with the exact same settings already exists (even if the ID is different), the creation fails. Notes:

      1. Updating a configuration with `state=DISABLED` will fail. 2. The following fields are not considered as settings for the purpose of the check mentioned above, therefore - updating another configuration with the same fields but different values for the following fields will fail as well: * name * create_time * update_time * labels * description

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         UpdateVpcFlowLogsConfigRequest request =
             UpdateVpcFlowLogsConfigRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build())
                 .build();
         ApiFuture<Operation> future =
             vpcFlowLogsServiceClient.updateVpcFlowLogsConfigCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteVpcFlowLogsConfigAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteVpcFlowLogsConfigAsync(VpcFlowLogsConfigName name)
      Deletes a specific `VpcFlowLogsConfig`.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         VpcFlowLogsConfigName name =
             VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                 "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]");
         vpcFlowLogsServiceClient.deleteVpcFlowLogsConfigAsync(name).get();
       }
       
      Parameters:
      name - Required. The resource name of the VpcFlowLogsConfig, in one of the following formats:

      - For a project-level resource: `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`

      - For an organization-level resource: `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`

      Throws:
      ApiException - if the remote call fails
    • deleteVpcFlowLogsConfigAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteVpcFlowLogsConfigAsync(String name)
      Deletes a specific `VpcFlowLogsConfig`.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         String name =
             VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                     "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                 .toString();
         vpcFlowLogsServiceClient.deleteVpcFlowLogsConfigAsync(name).get();
       }
       
      Parameters:
      name - Required. The resource name of the VpcFlowLogsConfig, in one of the following formats:

      - For a project-level resource: `projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`

      - For an organization-level resource: `organizations/{organization_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config_id}`

      Throws:
      ApiException - if the remote call fails
    • deleteVpcFlowLogsConfigAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteVpcFlowLogsConfigAsync(DeleteVpcFlowLogsConfigRequest request)
      Deletes a specific `VpcFlowLogsConfig`.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         DeleteVpcFlowLogsConfigRequest request =
             DeleteVpcFlowLogsConfigRequest.newBuilder()
                 .setName(
                     VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                             "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                         .toString())
                 .build();
         vpcFlowLogsServiceClient.deleteVpcFlowLogsConfigAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteVpcFlowLogsConfigOperationCallable

      public final OperationCallable<DeleteVpcFlowLogsConfigRequest,com.google.protobuf.Empty,OperationMetadata> deleteVpcFlowLogsConfigOperationCallable()
      Deletes a specific `VpcFlowLogsConfig`.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         DeleteVpcFlowLogsConfigRequest request =
             DeleteVpcFlowLogsConfigRequest.newBuilder()
                 .setName(
                     VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                             "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                         .toString())
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             vpcFlowLogsServiceClient.deleteVpcFlowLogsConfigOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteVpcFlowLogsConfigCallable

      public final UnaryCallable<DeleteVpcFlowLogsConfigRequest,Operation> deleteVpcFlowLogsConfigCallable()
      Deletes a specific `VpcFlowLogsConfig`.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         DeleteVpcFlowLogsConfigRequest request =
             DeleteVpcFlowLogsConfigRequest.newBuilder()
                 .setName(
                     VpcFlowLogsConfigName.ofProjectLocationVpcFlowLogsConfigName(
                             "[PROJECT]", "[LOCATION]", "[VPC_FLOW_LOGS_CONFIG]")
                         .toString())
                 .build();
         ApiFuture<Operation> future =
             vpcFlowLogsServiceClient.deleteVpcFlowLogsConfigCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • queryOrgVpcFlowLogsConfigs

      QueryOrgVpcFlowLogsConfigs returns a list of all organization-level VPC Flow Logs configurations applicable to 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         QueryOrgVpcFlowLogsConfigsRequest request =
             QueryOrgVpcFlowLogsConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         for (VpcFlowLogsConfig element :
             vpcFlowLogsServiceClient.queryOrgVpcFlowLogsConfigs(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • queryOrgVpcFlowLogsConfigsPagedCallable

      QueryOrgVpcFlowLogsConfigs returns a list of all organization-level VPC Flow Logs configurations applicable to 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         QueryOrgVpcFlowLogsConfigsRequest request =
             QueryOrgVpcFlowLogsConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         ApiFuture<VpcFlowLogsConfig> future =
             vpcFlowLogsServiceClient.queryOrgVpcFlowLogsConfigsPagedCallable().futureCall(request);
         // Do something.
         for (VpcFlowLogsConfig element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • queryOrgVpcFlowLogsConfigsCallable

      public final UnaryCallable<QueryOrgVpcFlowLogsConfigsRequest,QueryOrgVpcFlowLogsConfigsResponse> queryOrgVpcFlowLogsConfigsCallable()
      QueryOrgVpcFlowLogsConfigs returns a list of all organization-level VPC Flow Logs configurations applicable to 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         QueryOrgVpcFlowLogsConfigsRequest request =
             QueryOrgVpcFlowLogsConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         while (true) {
           QueryOrgVpcFlowLogsConfigsResponse response =
               vpcFlowLogsServiceClient.queryOrgVpcFlowLogsConfigsCallable().call(request);
           for (VpcFlowLogsConfig element : response.getVpcFlowLogsConfigsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • showEffectiveFlowLogsConfigs

      ShowEffectiveFlowLogsConfigs returns a list of all VPC Flow Logs configurations applicable to a 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         ShowEffectiveFlowLogsConfigsRequest request =
             ShowEffectiveFlowLogsConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setResource("resource-341064690")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         for (EffectiveVpcFlowLogsConfig element :
             vpcFlowLogsServiceClient.showEffectiveFlowLogsConfigs(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • showEffectiveFlowLogsConfigsPagedCallable

      ShowEffectiveFlowLogsConfigs returns a list of all VPC Flow Logs configurations applicable to a 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         ShowEffectiveFlowLogsConfigsRequest request =
             ShowEffectiveFlowLogsConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setResource("resource-341064690")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         ApiFuture<EffectiveVpcFlowLogsConfig> future =
             vpcFlowLogsServiceClient.showEffectiveFlowLogsConfigsPagedCallable().futureCall(request);
         // Do something.
         for (EffectiveVpcFlowLogsConfig element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • showEffectiveFlowLogsConfigsCallable

      public final UnaryCallable<ShowEffectiveFlowLogsConfigsRequest,ShowEffectiveFlowLogsConfigsResponse> showEffectiveFlowLogsConfigsCallable()
      ShowEffectiveFlowLogsConfigs returns a list of all VPC Flow Logs configurations applicable to a 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         ShowEffectiveFlowLogsConfigsRequest request =
             ShowEffectiveFlowLogsConfigsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setResource("resource-341064690")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         while (true) {
           ShowEffectiveFlowLogsConfigsResponse response =
               vpcFlowLogsServiceClient.showEffectiveFlowLogsConfigsCallable().call(request);
           for (EffectiveVpcFlowLogsConfig element : response.getEffectiveFlowLogsConfigsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • listLocations

      Lists information about the supported locations for this service.This method can be called in two ways:

      * **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element : vpcFlowLogsServiceClient.listLocations(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listLocationsPagedCallable

      Lists information about the supported locations for this service.This method can be called in two ways:

      * **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future =
             vpcFlowLogsServiceClient.listLocationsPagedCallable().futureCall(request);
         // Do something.
         for (Location element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listLocationsCallable

      public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
      Lists information about the supported locations for this service.This method can be called in two ways:

      * **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the 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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response =
               vpcFlowLogsServiceClient.listLocationsCallable().call(request);
           for (Location element : response.getLocationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getLocation

      public final Location getLocation(GetLocationRequest request)
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = vpcFlowLogsServiceClient.getLocation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getLocationCallable

      public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
      Gets information about a location.

      Sample code:

      
       // This snippet has been automatically generated and should be regarded as a code template only.
       // It will require modifications to work:
       // - It may require correct/in-range values for request initialization.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future =
             vpcFlowLogsServiceClient.getLocationCallable().futureCall(request);
         // Do something.
         Location response = future.get();
       }
       
    • setIamPolicy

      public final Policy setIamPolicy(SetIamPolicyRequest request)
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         Policy response = vpcFlowLogsServiceClient.setIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • setIamPolicyCallable

      public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<Policy> future =
             vpcFlowLogsServiceClient.setIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • getIamPolicy

      public final Policy getIamPolicy(GetIamPolicyRequest request)
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         Policy response = vpcFlowLogsServiceClient.getIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getIamPolicyCallable

      public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         ApiFuture<Policy> future =
             vpcFlowLogsServiceClient.getIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • testIamPermissions

      public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)
      Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

      Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         TestIamPermissionsRequest request =
             TestIamPermissionsRequest.newBuilder()
                 .setResource(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         TestIamPermissionsResponse response = vpcFlowLogsServiceClient.testIamPermissions(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • testIamPermissionsCallable

      public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()
      Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

      Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

      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 (VpcFlowLogsServiceClient vpcFlowLogsServiceClient = VpcFlowLogsServiceClient.create()) {
         TestIamPermissionsRequest request =
             TestIamPermissionsRequest.newBuilder()
                 .setResource(ConnectivityTestName.of("[PROJECT]", "[TEST]").toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         ApiFuture<TestIamPermissionsResponse> future =
             vpcFlowLogsServiceClient.testIamPermissionsCallable().futureCall(request);
         // Do something.
         TestIamPermissionsResponse response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException