Class VpcFlowLogsServiceClient (1.61.0)

GitHub RepositoryProduct Reference

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){VpcFlowLogsConfigNamename=VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]");VpcFlowLogsConfigresponse=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
MethodDescriptionMethod 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(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 considrered 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(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. The following fields are not considrered 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()

ListLocations

Lists information about the supported locations for this service.

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_DENIEDerrors.

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_libraryVpcFlowLogsServiceSettingsvpcFlowLogsServiceSettings=VpcFlowLogsServiceSettings.newBuilder().setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)).build();VpcFlowLogsServiceClientvpcFlowLogsServiceClient=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_libraryVpcFlowLogsServiceSettingsvpcFlowLogsServiceSettings=VpcFlowLogsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();VpcFlowLogsServiceClientvpcFlowLogsServiceClient=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_libraryVpcFlowLogsServiceSettingsvpcFlowLogsServiceSettings=VpcFlowLogsServiceSettings.newHttpJsonBuilder().build();VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create(vpcFlowLogsServiceSettings);

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

Inheritance

java.lang.Object > VpcFlowLogsServiceClient

Static Methods

create()

publicstaticfinalVpcFlowLogsServiceClientcreate()

Constructs an instance of VpcFlowLogsServiceClient with default settings.

Returns
TypeDescription
VpcFlowLogsServiceClient
Exceptions
TypeDescription
IOException

create(VpcFlowLogsServiceSettings settings)

publicstaticfinalVpcFlowLogsServiceClientcreate(VpcFlowLogsServiceSettingssettings)

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.

Parameter
NameDescription
settingsVpcFlowLogsServiceSettings
Returns
TypeDescription
VpcFlowLogsServiceClient
Exceptions
TypeDescription
IOException

create(VpcFlowLogsServiceStub stub)

publicstaticfinalVpcFlowLogsServiceClientcreate(VpcFlowLogsServiceStubstub)

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

Parameter
NameDescription
stubVpcFlowLogsServiceStub
Returns
TypeDescription
VpcFlowLogsServiceClient

Constructors

VpcFlowLogsServiceClient(VpcFlowLogsServiceSettings settings)

protectedVpcFlowLogsServiceClient(VpcFlowLogsServiceSettingssettings)

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.

Parameter
NameDescription
settingsVpcFlowLogsServiceSettings

VpcFlowLogsServiceClient(VpcFlowLogsServiceStub stub)

protectedVpcFlowLogsServiceClient(VpcFlowLogsServiceStubstub)
Parameter
NameDescription
stubVpcFlowLogsServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

publicbooleanawaitTermination(longduration,TimeUnitunit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
InterruptedException

close()

publicfinalvoidclose()

createVpcFlowLogsConfigAsync(CreateVpcFlowLogsConfigRequest request)

publicfinalOperationFuture<VpcFlowLogsConfig,OperationMetadata>createVpcFlowLogsConfigAsync(CreateVpcFlowLogsConfigRequestrequest)

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 considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){CreateVpcFlowLogsConfigRequestrequest=CreateVpcFlowLogsConfigRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setVpcFlowLogsConfigId(VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString()).setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build()).build();VpcFlowLogsConfigresponse=vpcFlowLogsServiceClient.createVpcFlowLogsConfigAsync(request).get();}
Parameter
NameDescription
requestCreateVpcFlowLogsConfigRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<VpcFlowLogsConfig,OperationMetadata>

createVpcFlowLogsConfigAsync(LocationName parent, VpcFlowLogsConfig vpcFlowLogsConfig, VpcFlowLogsConfigName vpcFlowLogsConfigId)

publicfinalOperationFuture<VpcFlowLogsConfig,OperationMetadata>createVpcFlowLogsConfigAsync(LocationNameparent,VpcFlowLogsConfigvpcFlowLogsConfig,VpcFlowLogsConfigNamevpcFlowLogsConfigId)

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 considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");VpcFlowLogsConfigvpcFlowLogsConfig=VpcFlowLogsConfig.newBuilder().build();VpcFlowLogsConfigNamevpcFlowLogsConfigId=VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]");VpcFlowLogsConfigresponse=vpcFlowLogsServiceClient.createVpcFlowLogsConfigAsync(parent,vpcFlowLogsConfig,vpcFlowLogsConfigId).get();}
Parameters
NameDescription
parentLocationName

Required. The parent resource of the VPC Flow Logs configuration to create: projects/{project_id}/locations/global

vpcFlowLogsConfigVpcFlowLogsConfig

Required. A VpcFlowLogsConfig resource

vpcFlowLogsConfigIdVpcFlowLogsConfigName

Required. ID of the VpcFlowLogsConfig.

Returns
TypeDescription
OperationFuture<VpcFlowLogsConfig,OperationMetadata>

createVpcFlowLogsConfigAsync(LocationName parent, VpcFlowLogsConfig vpcFlowLogsConfig, String vpcFlowLogsConfigId)

publicfinalOperationFuture<VpcFlowLogsConfig,OperationMetadata>createVpcFlowLogsConfigAsync(LocationNameparent,VpcFlowLogsConfigvpcFlowLogsConfig,StringvpcFlowLogsConfigId)

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 considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");VpcFlowLogsConfigvpcFlowLogsConfig=VpcFlowLogsConfig.newBuilder().build();StringvpcFlowLogsConfigId=VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString();VpcFlowLogsConfigresponse=vpcFlowLogsServiceClient.createVpcFlowLogsConfigAsync(parent,vpcFlowLogsConfig,vpcFlowLogsConfigId).get();}
Parameters
NameDescription
parentLocationName

Required. The parent resource of the VPC Flow Logs configuration to create: projects/{project_id}/locations/global

vpcFlowLogsConfigVpcFlowLogsConfig

Required. A VpcFlowLogsConfig resource

vpcFlowLogsConfigIdString

Required. ID of the VpcFlowLogsConfig.

Returns
TypeDescription
OperationFuture<VpcFlowLogsConfig,OperationMetadata>

createVpcFlowLogsConfigAsync(String parent, VpcFlowLogsConfig vpcFlowLogsConfig, VpcFlowLogsConfigName vpcFlowLogsConfigId)

publicfinalOperationFuture<VpcFlowLogsConfig,OperationMetadata>createVpcFlowLogsConfigAsync(Stringparent,VpcFlowLogsConfigvpcFlowLogsConfig,VpcFlowLogsConfigNamevpcFlowLogsConfigId)

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 considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();VpcFlowLogsConfigvpcFlowLogsConfig=VpcFlowLogsConfig.newBuilder().build();VpcFlowLogsConfigNamevpcFlowLogsConfigId=VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]");VpcFlowLogsConfigresponse=vpcFlowLogsServiceClient.createVpcFlowLogsConfigAsync(parent,vpcFlowLogsConfig,vpcFlowLogsConfigId).get();}
Parameters
NameDescription
parentString

Required. The parent resource of the VPC Flow Logs configuration to create: projects/{project_id}/locations/global

vpcFlowLogsConfigVpcFlowLogsConfig

Required. A VpcFlowLogsConfig resource

vpcFlowLogsConfigIdVpcFlowLogsConfigName

Required. ID of the VpcFlowLogsConfig.

Returns
TypeDescription
OperationFuture<VpcFlowLogsConfig,OperationMetadata>

createVpcFlowLogsConfigAsync(String parent, VpcFlowLogsConfig vpcFlowLogsConfig, String vpcFlowLogsConfigId)

publicfinalOperationFuture<VpcFlowLogsConfig,OperationMetadata>createVpcFlowLogsConfigAsync(Stringparent,VpcFlowLogsConfigvpcFlowLogsConfig,StringvpcFlowLogsConfigId)

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 considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();VpcFlowLogsConfigvpcFlowLogsConfig=VpcFlowLogsConfig.newBuilder().build();StringvpcFlowLogsConfigId=VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString();VpcFlowLogsConfigresponse=vpcFlowLogsServiceClient.createVpcFlowLogsConfigAsync(parent,vpcFlowLogsConfig,vpcFlowLogsConfigId).get();}
Parameters
NameDescription
parentString

Required. The parent resource of the VPC Flow Logs configuration to create: projects/{project_id}/locations/global

vpcFlowLogsConfigVpcFlowLogsConfig

Required. A VpcFlowLogsConfig resource

vpcFlowLogsConfigIdString

Required. ID of the VpcFlowLogsConfig.

Returns
TypeDescription
OperationFuture<VpcFlowLogsConfig,OperationMetadata>

createVpcFlowLogsConfigCallable()

publicfinalUnaryCallable<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 considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){CreateVpcFlowLogsConfigRequestrequest=CreateVpcFlowLogsConfigRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setVpcFlowLogsConfigId(VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString()).setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build()).build();ApiFuture<Operation>future=vpcFlowLogsServiceClient.createVpcFlowLogsConfigCallable().futureCall(request);// Do something.Operationresponse=future.get();}
Returns
TypeDescription
UnaryCallable<CreateVpcFlowLogsConfigRequest,Operation>

createVpcFlowLogsConfigOperationCallable()

publicfinalOperationCallable<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 considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){CreateVpcFlowLogsConfigRequestrequest=CreateVpcFlowLogsConfigRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setVpcFlowLogsConfigId(VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString()).setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build()).build();OperationFuture<VpcFlowLogsConfig,OperationMetadata>future=vpcFlowLogsServiceClient.createVpcFlowLogsConfigOperationCallable().futureCall(request);// Do something.VpcFlowLogsConfigresponse=future.get();}
Returns
TypeDescription
OperationCallable<CreateVpcFlowLogsConfigRequest,VpcFlowLogsConfig,OperationMetadata>

deleteVpcFlowLogsConfigAsync(DeleteVpcFlowLogsConfigRequest request)

publicfinalOperationFuture<Empty,OperationMetadata>deleteVpcFlowLogsConfigAsync(DeleteVpcFlowLogsConfigRequestrequest)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){DeleteVpcFlowLogsConfigRequestrequest=DeleteVpcFlowLogsConfigRequest.newBuilder().setName(VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString()).build();vpcFlowLogsServiceClient.deleteVpcFlowLogsConfigAsync(request).get();}
Parameter
NameDescription
requestDeleteVpcFlowLogsConfigRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteVpcFlowLogsConfigAsync(VpcFlowLogsConfigName name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteVpcFlowLogsConfigAsync(VpcFlowLogsConfigNamename)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){VpcFlowLogsConfigNamename=VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]");vpcFlowLogsServiceClient.deleteVpcFlowLogsConfigAsync(name).get();}
Parameter
NameDescription
nameVpcFlowLogsConfigName

Required. VpcFlowLogsConfig resource name using the form: projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteVpcFlowLogsConfigAsync(String name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteVpcFlowLogsConfigAsync(Stringname)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){Stringname=VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString();vpcFlowLogsServiceClient.deleteVpcFlowLogsConfigAsync(name).get();}
Parameter
NameDescription
nameString

Required. VpcFlowLogsConfig resource name using the form: projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}

Returns
TypeDescription
OperationFuture<Empty,OperationMetadata>

deleteVpcFlowLogsConfigCallable()

publicfinalUnaryCallable<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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){DeleteVpcFlowLogsConfigRequestrequest=DeleteVpcFlowLogsConfigRequest.newBuilder().setName(VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString()).build();ApiFuture<Operation>future=vpcFlowLogsServiceClient.deleteVpcFlowLogsConfigCallable().futureCall(request);// Do something.future.get();}
Returns
TypeDescription
UnaryCallable<DeleteVpcFlowLogsConfigRequest,Operation>

deleteVpcFlowLogsConfigOperationCallable()

publicfinalOperationCallable<DeleteVpcFlowLogsConfigRequest,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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){DeleteVpcFlowLogsConfigRequestrequest=DeleteVpcFlowLogsConfigRequest.newBuilder().setName(VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString()).build();OperationFuture<Empty,OperationMetadata>future=vpcFlowLogsServiceClient.deleteVpcFlowLogsConfigOperationCallable().futureCall(request);// Do something.future.get();}
Returns
TypeDescription
OperationCallable<DeleteVpcFlowLogsConfigRequest,Empty,OperationMetadata>

getHttpJsonOperationsClient()

publicfinalOperationsClientgetHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getIamPolicy(GetIamPolicyRequest request)

publicfinalPolicygetIamPolicy(GetIamPolicyRequestrequest)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){GetIamPolicyRequestrequest=GetIamPolicyRequest.newBuilder().setResource(ConnectivityTestName.of("[PROJECT]","[TEST]").toString()).setOptions(GetPolicyOptions.newBuilder().build()).build();Policyresponse=vpcFlowLogsServiceClient.getIamPolicy(request);}
Parameter
NameDescription
requestcom.google.iam.v1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.Policy

getIamPolicyCallable()

publicfinalUnaryCallable<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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){GetIamPolicyRequestrequest=GetIamPolicyRequest.newBuilder().setResource(ConnectivityTestName.of("[PROJECT]","[TEST]").toString()).setOptions(GetPolicyOptions.newBuilder().build()).build();ApiFuture<Policy>future=vpcFlowLogsServiceClient.getIamPolicyCallable().futureCall(request);// Do something.Policyresponse=future.get();}
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

getLocation(GetLocationRequest request)

publicfinalLocationgetLocation(GetLocationRequestrequest)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();Locationresponse=vpcFlowLogsServiceClient.getLocation(request);}
Parameter
NameDescription
requestcom.google.cloud.location.GetLocationRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.cloud.location.Location

getLocationCallable()

publicfinalUnaryCallable<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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();ApiFuture<Location>future=vpcFlowLogsServiceClient.getLocationCallable().futureCall(request);// Do something.Locationresponse=future.get();}
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getOperationsClient()

publicfinalOperationsClientgetOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
TypeDescription
OperationsClient

getSettings()

publicfinalVpcFlowLogsServiceSettingsgetSettings()
Returns
TypeDescription
VpcFlowLogsServiceSettings

getStub()

publicVpcFlowLogsServiceStubgetStub()
Returns
TypeDescription
VpcFlowLogsServiceStub

getVpcFlowLogsConfig(GetVpcFlowLogsConfigRequest request)

publicfinalVpcFlowLogsConfiggetVpcFlowLogsConfig(GetVpcFlowLogsConfigRequestrequest)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){GetVpcFlowLogsConfigRequestrequest=GetVpcFlowLogsConfigRequest.newBuilder().setName(VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString()).build();VpcFlowLogsConfigresponse=vpcFlowLogsServiceClient.getVpcFlowLogsConfig(request);}
Parameter
NameDescription
requestGetVpcFlowLogsConfigRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
VpcFlowLogsConfig

getVpcFlowLogsConfig(VpcFlowLogsConfigName name)

publicfinalVpcFlowLogsConfiggetVpcFlowLogsConfig(VpcFlowLogsConfigNamename)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){VpcFlowLogsConfigNamename=VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]");VpcFlowLogsConfigresponse=vpcFlowLogsServiceClient.getVpcFlowLogsConfig(name);}
Parameter
NameDescription
nameVpcFlowLogsConfigName

Required. VpcFlowLogsConfig resource name using the form: projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}

Returns
TypeDescription
VpcFlowLogsConfig

getVpcFlowLogsConfig(String name)

publicfinalVpcFlowLogsConfiggetVpcFlowLogsConfig(Stringname)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){Stringname=VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString();VpcFlowLogsConfigresponse=vpcFlowLogsServiceClient.getVpcFlowLogsConfig(name);}
Parameter
NameDescription
nameString

Required. VpcFlowLogsConfig resource name using the form: projects/{project_id}/locations/global/vpcFlowLogsConfigs/{vpc_flow_logs_config}

Returns
TypeDescription
VpcFlowLogsConfig

getVpcFlowLogsConfigCallable()

publicfinalUnaryCallable<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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){GetVpcFlowLogsConfigRequestrequest=GetVpcFlowLogsConfigRequest.newBuilder().setName(VpcFlowLogsConfigName.of("[PROJECT]","[LOCATION]","[VPC_FLOW_LOGS_CONFIG]").toString()).build();ApiFuture<VpcFlowLogsConfig>future=vpcFlowLogsServiceClient.getVpcFlowLogsConfigCallable().futureCall(request);// Do something.VpcFlowLogsConfigresponse=future.get();}
Returns
TypeDescription
UnaryCallable<GetVpcFlowLogsConfigRequest,VpcFlowLogsConfig>

isShutdown()

publicbooleanisShutdown()
Returns
TypeDescription
boolean

isTerminated()

publicbooleanisTerminated()
Returns
TypeDescription
boolean

listLocations(ListLocationsRequest request)

publicfinalVpcFlowLogsServiceClient.ListLocationsPagedResponselistLocations(ListLocationsRequestrequest)

Lists information about the supported locations for this service.

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){ListLocationsRequestrequest=ListLocationsRequest.newBuilder().setName("name3373707").setFilter("filter-1274492040").setPageSize(883849137).setPageToken("pageToken873572522").build();for(Locationelement:vpcFlowLogsServiceClient.listLocations(request).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
requestcom.google.cloud.location.ListLocationsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
VpcFlowLogsServiceClient.ListLocationsPagedResponse

listLocationsCallable()

publicfinalUnaryCallable<ListLocationsRequest,ListLocationsResponse>listLocationsCallable()

Lists information about the supported locations for this service.

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){ListLocationsRequestrequest=ListLocationsRequest.newBuilder().setName("name3373707").setFilter("filter-1274492040").setPageSize(883849137).setPageToken("pageToken873572522").build();while(true){ListLocationsResponseresponse=vpcFlowLogsServiceClient.listLocationsCallable().call(request);for(Locationelement:response.getLocationsList()){// doThingsWith(element);}StringnextPageToken=response.getNextPageToken();if(!Strings.isNullOrEmpty(nextPageToken)){request=request.toBuilder().setPageToken(nextPageToken).build();}else{break;}}}
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

publicfinalUnaryCallable<ListLocationsRequest,VpcFlowLogsServiceClient.ListLocationsPagedResponse>listLocationsPagedCallable()

Lists information about the supported locations for this service.

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){ListLocationsRequestrequest=ListLocationsRequest.newBuilder().setName("name3373707").setFilter("filter-1274492040").setPageSize(883849137).setPageToken("pageToken873572522").build();ApiFuture<Location>future=vpcFlowLogsServiceClient.listLocationsPagedCallable().futureCall(request);// Do something.for(Locationelement:future.get().iterateAll()){// doThingsWith(element);}}
Returns
TypeDescription
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listVpcFlowLogsConfigs(ListVpcFlowLogsConfigsRequest request)

publicfinalVpcFlowLogsServiceClient.ListVpcFlowLogsConfigsPagedResponselistVpcFlowLogsConfigs(ListVpcFlowLogsConfigsRequestrequest)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){ListVpcFlowLogsConfigsRequestrequest=ListVpcFlowLogsConfigsRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").setFilter("filter-1274492040").setOrderBy("orderBy-1207110587").build();for(VpcFlowLogsConfigelement:vpcFlowLogsServiceClient.listVpcFlowLogsConfigs(request).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
requestListVpcFlowLogsConfigsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
VpcFlowLogsServiceClient.ListVpcFlowLogsConfigsPagedResponse

listVpcFlowLogsConfigs(LocationName parent)

publicfinalVpcFlowLogsServiceClient.ListVpcFlowLogsConfigsPagedResponselistVpcFlowLogsConfigs(LocationNameparent)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");for(VpcFlowLogsConfigelement:vpcFlowLogsServiceClient.listVpcFlowLogsConfigs(parent).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
parentLocationName

Required. The parent resource of the VpcFlowLogsConfig: projects/{project_id}/locations/global

Returns
TypeDescription
VpcFlowLogsServiceClient.ListVpcFlowLogsConfigsPagedResponse

listVpcFlowLogsConfigs(String parent)

publicfinalVpcFlowLogsServiceClient.ListVpcFlowLogsConfigsPagedResponselistVpcFlowLogsConfigs(Stringparent)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();for(VpcFlowLogsConfigelement:vpcFlowLogsServiceClient.listVpcFlowLogsConfigs(parent).iterateAll()){// doThingsWith(element);}}
Parameter
NameDescription
parentString

Required. The parent resource of the VpcFlowLogsConfig: projects/{project_id}/locations/global

Returns
TypeDescription
VpcFlowLogsServiceClient.ListVpcFlowLogsConfigsPagedResponse

listVpcFlowLogsConfigsCallable()

publicfinalUnaryCallable<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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){ListVpcFlowLogsConfigsRequestrequest=ListVpcFlowLogsConfigsRequest.newBuilder().setParent(LocationName.of("[PROJECT]","[LOCATION]").toString()).setPageSize(883849137).setPageToken("pageToken873572522").setFilter("filter-1274492040").setOrderBy("orderBy-1207110587").build();while(true){ListVpcFlowLogsConfigsResponseresponse=vpcFlowLogsServiceClient.listVpcFlowLogsConfigsCallable().call(request);for(VpcFlowLogsConfigelement:response.getVpcFlowLogsConfigsList()){// doThingsWith(element);}StringnextPageToken=response.getNextPageToken();if(!Strings.isNullOrEmpty(nextPageToken)){request=request.toBuilder().setPageToken(nextPageToken).build();}else{break;}}}
Returns
TypeDescription
UnaryCallable<ListVpcFlowLogsConfigsRequest,ListVpcFlowLogsConfigsResponse>

listVpcFlowLogsConfigsPagedCallable()

publicfinalUnaryCallable<ListVpcFlowLogsConfigsRequest,VpcFlowLogsServiceClient.ListVpcFlowLogsConfigsPagedResponse>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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){ListVpcFlowLogsConfigsRequestrequest=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(VpcFlowLogsConfigelement:future.get().iterateAll()){// doThingsWith(element);}}
Returns
TypeDescription
UnaryCallable<ListVpcFlowLogsConfigsRequest,ListVpcFlowLogsConfigsPagedResponse>

setIamPolicy(SetIamPolicyRequest request)

publicfinalPolicysetIamPolicy(SetIamPolicyRequestrequest)

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){SetIamPolicyRequestrequest=SetIamPolicyRequest.newBuilder().setResource(ConnectivityTestName.of("[PROJECT]","[TEST]").toString()).setPolicy(Policy.newBuilder().build()).setUpdateMask(FieldMask.newBuilder().build()).build();Policyresponse=vpcFlowLogsServiceClient.setIamPolicy(request);}
Parameter
NameDescription
requestcom.google.iam.v1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.Policy

setIamPolicyCallable()

publicfinalUnaryCallable<SetIamPolicyRequest,Policy>setIamPolicyCallable()

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){SetIamPolicyRequestrequest=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.Policyresponse=future.get();}
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

publicvoidshutdown()

shutdownNow()

publicvoidshutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

publicfinalTestIamPermissionsResponsetestIamPermissions(TestIamPermissionsRequestrequest)

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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){TestIamPermissionsRequestrequest=TestIamPermissionsRequest.newBuilder().setResource(ConnectivityTestName.of("[PROJECT]","[TEST]").toString()).addAllPermissions(newArrayList<String>()).build();TestIamPermissionsResponseresponse=vpcFlowLogsServiceClient.testIamPermissions(request);}
Parameter
NameDescription
requestcom.google.iam.v1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

publicfinalUnaryCallable<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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){TestIamPermissionsRequestrequest=TestIamPermissionsRequest.newBuilder().setResource(ConnectivityTestName.of("[PROJECT]","[TEST]").toString()).addAllPermissions(newArrayList<String>()).build();ApiFuture<TestIamPermissionsResponse>future=vpcFlowLogsServiceClient.testIamPermissionsCallable().futureCall(request);// Do something.TestIamPermissionsResponseresponse=future.get();}
Returns
TypeDescription
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

updateVpcFlowLogsConfigAsync(UpdateVpcFlowLogsConfigRequest request)

publicfinalOperationFuture<VpcFlowLogsConfig,OperationMetadata>updateVpcFlowLogsConfigAsync(UpdateVpcFlowLogsConfigRequestrequest)

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. The following fields are not considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){UpdateVpcFlowLogsConfigRequestrequest=UpdateVpcFlowLogsConfigRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build()).build();VpcFlowLogsConfigresponse=vpcFlowLogsServiceClient.updateVpcFlowLogsConfigAsync(request).get();}
Parameter
NameDescription
requestUpdateVpcFlowLogsConfigRequest

The request object containing all of the parameters for the API call.

Returns
TypeDescription
OperationFuture<VpcFlowLogsConfig,OperationMetadata>

updateVpcFlowLogsConfigAsync(VpcFlowLogsConfig vpcFlowLogsConfig, FieldMask updateMask)

publicfinalOperationFuture<VpcFlowLogsConfig,OperationMetadata>updateVpcFlowLogsConfigAsync(VpcFlowLogsConfigvpcFlowLogsConfig,FieldMaskupdateMask)

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. The following fields are not considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){VpcFlowLogsConfigvpcFlowLogsConfig=VpcFlowLogsConfig.newBuilder().build();FieldMaskupdateMask=FieldMask.newBuilder().build();VpcFlowLogsConfigresponse=vpcFlowLogsServiceClient.updateVpcFlowLogsConfigAsync(vpcFlowLogsConfig,updateMask).get();}
Parameters
NameDescription
vpcFlowLogsConfigVpcFlowLogsConfig

Required. Only fields specified in update_mask are updated.

updateMaskFieldMask

Required. Mask of fields to update. At least one path must be supplied in this field.

Returns
TypeDescription
OperationFuture<VpcFlowLogsConfig,OperationMetadata>

updateVpcFlowLogsConfigCallable()

publicfinalUnaryCallable<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. The following fields are not considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){UpdateVpcFlowLogsConfigRequestrequest=UpdateVpcFlowLogsConfigRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build()).build();ApiFuture<Operation>future=vpcFlowLogsServiceClient.updateVpcFlowLogsConfigCallable().futureCall(request);// Do something.Operationresponse=future.get();}
Returns
TypeDescription
UnaryCallable<UpdateVpcFlowLogsConfigRequest,Operation>

updateVpcFlowLogsConfigOperationCallable()

publicfinalOperationCallable<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. The following fields are not considrered 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_librarytry(VpcFlowLogsServiceClientvpcFlowLogsServiceClient=VpcFlowLogsServiceClient.create()){UpdateVpcFlowLogsConfigRequestrequest=UpdateVpcFlowLogsConfigRequest.newBuilder().setUpdateMask(FieldMask.newBuilder().build()).setVpcFlowLogsConfig(VpcFlowLogsConfig.newBuilder().build()).build();OperationFuture<VpcFlowLogsConfig,OperationMetadata>future=vpcFlowLogsServiceClient.updateVpcFlowLogsConfigOperationCallable().futureCall(request);// Do something.VpcFlowLogsConfigresponse=future.get();}
Returns
TypeDescription
OperationCallable<UpdateVpcFlowLogsConfigRequest,VpcFlowLogsConfig,OperationMetadata>