- 3.52.0 (latest)
- 3.51.0
- 3.50.0
- 3.49.0
- 3.48.0
- 3.47.0
- 3.46.0
- 3.45.0
- 3.44.0
- 3.43.0
- 3.41.0
- 3.40.0
- 3.39.0
- 3.38.0
- 3.37.0
- 3.36.0
- 3.35.0
- 3.34.0
- 3.33.0
- 3.32.0
- 3.31.0
- 3.28.0
- 3.27.0
- 3.26.0
- 3.25.0
- 3.24.0
- 3.23.0
- 3.22.0
- 3.21.0
- 3.20.0
- 3.19.0
- 3.18.0
- 3.17.0
- 3.16.0
- 3.15.0
- 3.13.0
- 3.12.0
- 3.11.0
- 3.10.0
- 3.9.0
- 3.8.0
- 3.7.6
- 3.6.7
- 3.5.0
- 3.4.0
- 3.3.2
- 3.2.1
- 3.1.4
public class DlpServiceClient implements BackgroundResource
Service Description: The Cloud Data Loss Prevention (DLP) API is a service that allows clients to detect the presence of Personally Identifiable Information (PII) and other privacy-sensitive data in user-supplied, unstructured data streams, like text blocks or images. The service also includes methods for sensitive data redaction and scheduling of data scans on Google Cloud Platform based data sets.
To learn more about concepts and find how-to guides see https://cloud.google.com/dlp/docs/.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
InspectContentRequest request =
InspectContentRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setInspectConfig(InspectConfig.newBuilder().build())
.setItem(ContentItem.newBuilder().build())
.setInspectTemplateName("inspectTemplateName1828857433")
.setLocationId("locationId1541836720")
.build();
InspectContentResponse response = dlpServiceClient.inspectContent(request);
}
Note: close() needs to be called on the DlpServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of DlpServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
DlpServiceSettings dlpServiceSettings =
DlpServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DlpServiceClient dlpServiceClient = DlpServiceClient.create(dlpServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
DlpServiceSettings dlpServiceSettings =
DlpServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DlpServiceClient dlpServiceClient = DlpServiceClient.create(dlpServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
DlpServiceSettings dlpServiceSettings =
DlpServiceSettings.newBuilder()
.setTransportChannelProvider(
DlpServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
.build();
DlpServiceClient dlpServiceClient = DlpServiceClient.create(dlpServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final DlpServiceClient create()
Constructs an instance of DlpServiceClient with default settings.
Type | Description |
DlpServiceClient |
Type | Description |
IOException |
create(DlpServiceSettings settings)
public static final DlpServiceClient create(DlpServiceSettings settings)
Constructs an instance of DlpServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | DlpServiceSettings |
Type | Description |
DlpServiceClient |
Type | Description |
IOException |
create(DlpServiceStub stub)
public static final DlpServiceClient create(DlpServiceStub stub)
Constructs an instance of DlpServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DlpServiceSettings).
Name | Description |
stub | DlpServiceStub |
Type | Description |
DlpServiceClient |
Constructors
DlpServiceClient(DlpServiceSettings settings)
protected DlpServiceClient(DlpServiceSettings settings)
Constructs an instance of DlpServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Name | Description |
settings | DlpServiceSettings |
DlpServiceClient(DlpServiceStub stub)
protected DlpServiceClient(DlpServiceStub stub)
Name | Description |
stub | DlpServiceStub |
Methods
activateJobTrigger(ActivateJobTriggerRequest request)
public final DlpJob activateJobTrigger(ActivateJobTriggerRequest request)
Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ActivateJobTriggerRequest request =
ActivateJobTriggerRequest.newBuilder()
.setName(
JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
.build();
DlpJob response = dlpServiceClient.activateJobTrigger(request);
}
Name | Description |
request | ActivateJobTriggerRequest The request object containing all of the parameters for the API call. |
Type | Description |
DlpJob |
activateJobTriggerCallable()
public final UnaryCallable<ActivateJobTriggerRequest,DlpJob> activateJobTriggerCallable()
Activate a job trigger. Causes the immediate execute of a trigger instead of waiting on the trigger event to occur.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ActivateJobTriggerRequest request =
ActivateJobTriggerRequest.newBuilder()
.setName(
JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
.build();
ApiFuture<DlpJob> future = dlpServiceClient.activateJobTriggerCallable().futureCall(request);
// Do something.
DlpJob response = future.get();
}
Type | Description |
UnaryCallable<ActivateJobTriggerRequest,DlpJob> |
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
cancelDlpJob(CancelDlpJobRequest request)
public final void cancelDlpJob(CancelDlpJobRequest request)
Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CancelDlpJobRequest request =
CancelDlpJobRequest.newBuilder()
.setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
.build();
dlpServiceClient.cancelDlpJob(request);
}
Name | Description |
request | CancelDlpJobRequest The request object containing all of the parameters for the API call. |
cancelDlpJobCallable()
public final UnaryCallable<CancelDlpJobRequest,Empty> cancelDlpJobCallable()
Starts asynchronous cancellation on a long-running DlpJob. The server makes a best effort to cancel the DlpJob, but success is not guaranteed. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CancelDlpJobRequest request =
CancelDlpJobRequest.newBuilder()
.setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
.build();
ApiFuture<Empty> future = dlpServiceClient.cancelDlpJobCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<CancelDlpJobRequest,Empty> |
close()
public final void close()
createDeidentifyTemplate(CreateDeidentifyTemplateRequest request)
public final DeidentifyTemplate createDeidentifyTemplate(CreateDeidentifyTemplateRequest request)
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CreateDeidentifyTemplateRequest request =
CreateDeidentifyTemplateRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setDeidentifyTemplate(DeidentifyTemplate.newBuilder().build())
.setTemplateId("templateId1304010549")
.setLocationId("locationId1541836720")
.build();
DeidentifyTemplate response = dlpServiceClient.createDeidentifyTemplate(request);
}
Name | Description |
request | CreateDeidentifyTemplateRequest The request object containing all of the parameters for the API call. |
Type | Description |
DeidentifyTemplate |
createDeidentifyTemplate(LocationName parent, DeidentifyTemplate deidentifyTemplate)
public final DeidentifyTemplate createDeidentifyTemplate(LocationName parent, DeidentifyTemplate deidentifyTemplate)
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
DeidentifyTemplate response =
dlpServiceClient.createDeidentifyTemplate(parent, deidentifyTemplate);
}
Name | Description |
parent | LocationName Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
deidentifyTemplate | DeidentifyTemplate Required. The DeidentifyTemplate to create. |
Type | Description |
DeidentifyTemplate |
createDeidentifyTemplate(OrganizationLocationName parent, DeidentifyTemplate deidentifyTemplate)
public final DeidentifyTemplate createDeidentifyTemplate(OrganizationLocationName parent, DeidentifyTemplate deidentifyTemplate)
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
DeidentifyTemplate response =
dlpServiceClient.createDeidentifyTemplate(parent, deidentifyTemplate);
}
Name | Description |
parent | OrganizationLocationName Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
deidentifyTemplate | DeidentifyTemplate Required. The DeidentifyTemplate to create. |
Type | Description |
DeidentifyTemplate |
createDeidentifyTemplate(OrganizationName parent, DeidentifyTemplate deidentifyTemplate)
public final DeidentifyTemplate createDeidentifyTemplate(OrganizationName parent, DeidentifyTemplate deidentifyTemplate)
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
DeidentifyTemplate response =
dlpServiceClient.createDeidentifyTemplate(parent, deidentifyTemplate);
}
Name | Description |
parent | OrganizationName Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
deidentifyTemplate | DeidentifyTemplate Required. The DeidentifyTemplate to create. |
Type | Description |
DeidentifyTemplate |
createDeidentifyTemplate(ProjectName parent, DeidentifyTemplate deidentifyTemplate)
public final DeidentifyTemplate createDeidentifyTemplate(ProjectName parent, DeidentifyTemplate deidentifyTemplate)
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
DeidentifyTemplate response =
dlpServiceClient.createDeidentifyTemplate(parent, deidentifyTemplate);
}
Name | Description |
parent | ProjectName Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
deidentifyTemplate | DeidentifyTemplate Required. The DeidentifyTemplate to create. |
Type | Description |
DeidentifyTemplate |
createDeidentifyTemplate(String parent, DeidentifyTemplate deidentifyTemplate)
public final DeidentifyTemplate createDeidentifyTemplate(String parent, DeidentifyTemplate deidentifyTemplate)
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
DeidentifyTemplate deidentifyTemplate = DeidentifyTemplate.newBuilder().build();
DeidentifyTemplate response =
dlpServiceClient.createDeidentifyTemplate(parent, deidentifyTemplate);
}
Name | Description |
parent | String Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
deidentifyTemplate | DeidentifyTemplate Required. The DeidentifyTemplate to create. |
Type | Description |
DeidentifyTemplate |
createDeidentifyTemplateCallable()
public final UnaryCallable<CreateDeidentifyTemplateRequest,DeidentifyTemplate> createDeidentifyTemplateCallable()
Creates a DeidentifyTemplate for re-using frequently used configuration for de-identifying content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates-deid to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CreateDeidentifyTemplateRequest request =
CreateDeidentifyTemplateRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setDeidentifyTemplate(DeidentifyTemplate.newBuilder().build())
.setTemplateId("templateId1304010549")
.setLocationId("locationId1541836720")
.build();
ApiFuture<DeidentifyTemplate> future =
dlpServiceClient.createDeidentifyTemplateCallable().futureCall(request);
// Do something.
DeidentifyTemplate response = future.get();
}
Type | Description |
UnaryCallable<CreateDeidentifyTemplateRequest,DeidentifyTemplate> |
createDlpJob(CreateDlpJobRequest request)
public final DlpJob createDlpJob(CreateDlpJobRequest request)
Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CreateDlpJobRequest request =
CreateDlpJobRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setJobId("jobId101296568")
.setLocationId("locationId1541836720")
.build();
DlpJob response = dlpServiceClient.createDlpJob(request);
}
Name | Description |
request | CreateDlpJobRequest The request object containing all of the parameters for the API call. |
Type | Description |
DlpJob |
createDlpJob(LocationName parent, InspectJobConfig inspectJob)
public final DlpJob createDlpJob(LocationName parent, InspectJobConfig inspectJob)
Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
InspectJobConfig inspectJob = InspectJobConfig.newBuilder().build();
DlpJob response = dlpServiceClient.createDlpJob(parent, inspectJob);
}
Name | Description |
parent | LocationName Required. Parent resource name. The format of this value varies depending on whether you have specified a processing location: + Projects scope, location specified:<br/>
|
inspectJob | InspectJobConfig An inspection job scans a storage repository for InfoTypes. |
Type | Description |
DlpJob |
createDlpJob(LocationName parent, RiskAnalysisJobConfig riskJob)
public final DlpJob createDlpJob(LocationName parent, RiskAnalysisJobConfig riskJob)
Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
RiskAnalysisJobConfig riskJob = RiskAnalysisJobConfig.newBuilder().build();
DlpJob response = dlpServiceClient.createDlpJob(parent, riskJob);
}
Name | Description |
parent | LocationName Required. Parent resource name. The format of this value varies depending on whether you have specified a processing location: + Projects scope, location specified:<br/>
|
riskJob | RiskAnalysisJobConfig A risk analysis job calculates re-identification risk metrics for a BigQuery table. |
Type | Description |
DlpJob |
createDlpJob(ProjectName parent, InspectJobConfig inspectJob)
public final DlpJob createDlpJob(ProjectName parent, InspectJobConfig inspectJob)
Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
InspectJobConfig inspectJob = InspectJobConfig.newBuilder().build();
DlpJob response = dlpServiceClient.createDlpJob(parent, inspectJob);
}
Name | Description |
parent | ProjectName Required. Parent resource name. The format of this value varies depending on whether you have specified a processing location: + Projects scope, location specified:<br/>
|
inspectJob | InspectJobConfig An inspection job scans a storage repository for InfoTypes. |
Type | Description |
DlpJob |
createDlpJob(ProjectName parent, RiskAnalysisJobConfig riskJob)
public final DlpJob createDlpJob(ProjectName parent, RiskAnalysisJobConfig riskJob)
Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
RiskAnalysisJobConfig riskJob = RiskAnalysisJobConfig.newBuilder().build();
DlpJob response = dlpServiceClient.createDlpJob(parent, riskJob);
}
Name | Description |
parent | ProjectName Required. Parent resource name. The format of this value varies depending on whether you have specified a processing location: + Projects scope, location specified:<br/>
|
riskJob | RiskAnalysisJobConfig A risk analysis job calculates re-identification risk metrics for a BigQuery table. |
Type | Description |
DlpJob |
createDlpJob(String parent, InspectJobConfig inspectJob)
public final DlpJob createDlpJob(String parent, InspectJobConfig inspectJob)
Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
InspectJobConfig inspectJob = InspectJobConfig.newBuilder().build();
DlpJob response = dlpServiceClient.createDlpJob(parent, inspectJob);
}
Name | Description |
parent | String Required. Parent resource name. The format of this value varies depending on whether you have specified a processing location: + Projects scope, location specified:<br/>
|
inspectJob | InspectJobConfig An inspection job scans a storage repository for InfoTypes. |
Type | Description |
DlpJob |
createDlpJob(String parent, RiskAnalysisJobConfig riskJob)
public final DlpJob createDlpJob(String parent, RiskAnalysisJobConfig riskJob)
Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
RiskAnalysisJobConfig riskJob = RiskAnalysisJobConfig.newBuilder().build();
DlpJob response = dlpServiceClient.createDlpJob(parent, riskJob);
}
Name | Description |
parent | String Required. Parent resource name. The format of this value varies depending on whether you have specified a processing location: + Projects scope, location specified:<br/>
|
riskJob | RiskAnalysisJobConfig A risk analysis job calculates re-identification risk metrics for a BigQuery table. |
Type | Description |
DlpJob |
createDlpJobCallable()
public final UnaryCallable<CreateDlpJobRequest,DlpJob> createDlpJobCallable()
Creates a new job to inspect storage or calculate risk metrics. See https://cloud.google.com/dlp/docs/inspecting-storage and https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the system will automatically choose what detectors to run. By default this may be all types, but may change over time as detectors are updated.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CreateDlpJobRequest request =
CreateDlpJobRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setJobId("jobId101296568")
.setLocationId("locationId1541836720")
.build();
ApiFuture<DlpJob> future = dlpServiceClient.createDlpJobCallable().futureCall(request);
// Do something.
DlpJob response = future.get();
}
Type | Description |
UnaryCallable<CreateDlpJobRequest,DlpJob> |
createInspectTemplate(CreateInspectTemplateRequest request)
public final InspectTemplate createInspectTemplate(CreateInspectTemplateRequest request)
Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CreateInspectTemplateRequest request =
CreateInspectTemplateRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setInspectTemplate(InspectTemplate.newBuilder().build())
.setTemplateId("templateId1304010549")
.setLocationId("locationId1541836720")
.build();
InspectTemplate response = dlpServiceClient.createInspectTemplate(request);
}
Name | Description |
request | CreateInspectTemplateRequest The request object containing all of the parameters for the API call. |
Type | Description |
InspectTemplate |
createInspectTemplate(LocationName parent, InspectTemplate inspectTemplate)
public final InspectTemplate createInspectTemplate(LocationName parent, InspectTemplate inspectTemplate)
Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
InspectTemplate response = dlpServiceClient.createInspectTemplate(parent, inspectTemplate);
}
Name | Description |
parent | LocationName Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
inspectTemplate | InspectTemplate Required. The InspectTemplate to create. |
Type | Description |
InspectTemplate |
createInspectTemplate(OrganizationLocationName parent, InspectTemplate inspectTemplate)
public final InspectTemplate createInspectTemplate(OrganizationLocationName parent, InspectTemplate inspectTemplate)
Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
InspectTemplate response = dlpServiceClient.createInspectTemplate(parent, inspectTemplate);
}
Name | Description |
parent | OrganizationLocationName Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
inspectTemplate | InspectTemplate Required. The InspectTemplate to create. |
Type | Description |
InspectTemplate |
createInspectTemplate(OrganizationName parent, InspectTemplate inspectTemplate)
public final InspectTemplate createInspectTemplate(OrganizationName parent, InspectTemplate inspectTemplate)
Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
InspectTemplate response = dlpServiceClient.createInspectTemplate(parent, inspectTemplate);
}
Name | Description |
parent | OrganizationName Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
inspectTemplate | InspectTemplate Required. The InspectTemplate to create. |
Type | Description |
InspectTemplate |
createInspectTemplate(ProjectName parent, InspectTemplate inspectTemplate)
public final InspectTemplate createInspectTemplate(ProjectName parent, InspectTemplate inspectTemplate)
Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
InspectTemplate response = dlpServiceClient.createInspectTemplate(parent, inspectTemplate);
}
Name | Description |
parent | ProjectName Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
inspectTemplate | InspectTemplate Required. The InspectTemplate to create. |
Type | Description |
InspectTemplate |
createInspectTemplate(String parent, InspectTemplate inspectTemplate)
public final InspectTemplate createInspectTemplate(String parent, InspectTemplate inspectTemplate)
Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String parent = OrganizationName.of("[ORGANIZATION]").toString();
InspectTemplate inspectTemplate = InspectTemplate.newBuilder().build();
InspectTemplate response = dlpServiceClient.createInspectTemplate(parent, inspectTemplate);
}
Name | Description |
parent | String Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
inspectTemplate | InspectTemplate Required. The InspectTemplate to create. |
Type | Description |
InspectTemplate |
createInspectTemplateCallable()
public final UnaryCallable<CreateInspectTemplateRequest,InspectTemplate> createInspectTemplateCallable()
Creates an InspectTemplate for re-using frequently used configuration for inspecting content, images, and storage. See https://cloud.google.com/dlp/docs/creating-templates to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CreateInspectTemplateRequest request =
CreateInspectTemplateRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setInspectTemplate(InspectTemplate.newBuilder().build())
.setTemplateId("templateId1304010549")
.setLocationId("locationId1541836720")
.build();
ApiFuture<InspectTemplate> future =
dlpServiceClient.createInspectTemplateCallable().futureCall(request);
// Do something.
InspectTemplate response = future.get();
}
Type | Description |
UnaryCallable<CreateInspectTemplateRequest,InspectTemplate> |
createJobTrigger(CreateJobTriggerRequest request)
public final JobTrigger createJobTrigger(CreateJobTriggerRequest request)
Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CreateJobTriggerRequest request =
CreateJobTriggerRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setJobTrigger(JobTrigger.newBuilder().build())
.setTriggerId("triggerId-648752909")
.setLocationId("locationId1541836720")
.build();
JobTrigger response = dlpServiceClient.createJobTrigger(request);
}
Name | Description |
request | CreateJobTriggerRequest The request object containing all of the parameters for the API call. |
Type | Description |
JobTrigger |
createJobTrigger(LocationName parent, JobTrigger jobTrigger)
public final JobTrigger createJobTrigger(LocationName parent, JobTrigger jobTrigger)
Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
JobTrigger jobTrigger = JobTrigger.newBuilder().build();
JobTrigger response = dlpServiceClient.createJobTrigger(parent, jobTrigger);
}
Name | Description |
parent | LocationName Required. Parent resource name. The format of this value varies depending on whether you have specified a processing location: + Projects scope, location specified:<br/>
|
jobTrigger | JobTrigger Required. The JobTrigger to create. |
Type | Description |
JobTrigger |
createJobTrigger(ProjectName parent, JobTrigger jobTrigger)
public final JobTrigger createJobTrigger(ProjectName parent, JobTrigger jobTrigger)
Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
JobTrigger jobTrigger = JobTrigger.newBuilder().build();
JobTrigger response = dlpServiceClient.createJobTrigger(parent, jobTrigger);
}
Name | Description |
parent | ProjectName Required. Parent resource name. The format of this value varies depending on whether you have specified a processing location: + Projects scope, location specified:<br/>
|
jobTrigger | JobTrigger Required. The JobTrigger to create. |
Type | Description |
JobTrigger |
createJobTrigger(String parent, JobTrigger jobTrigger)
public final JobTrigger createJobTrigger(String parent, JobTrigger jobTrigger)
Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
JobTrigger jobTrigger = JobTrigger.newBuilder().build();
JobTrigger response = dlpServiceClient.createJobTrigger(parent, jobTrigger);
}
Name | Description |
parent | String Required. Parent resource name. The format of this value varies depending on whether you have specified a processing location: + Projects scope, location specified:<br/>
|
jobTrigger | JobTrigger Required. The JobTrigger to create. |
Type | Description |
JobTrigger |
createJobTriggerCallable()
public final UnaryCallable<CreateJobTriggerRequest,JobTrigger> createJobTriggerCallable()
Creates a job trigger to run DLP actions such as scanning storage for sensitive information on a set schedule. See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CreateJobTriggerRequest request =
CreateJobTriggerRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setJobTrigger(JobTrigger.newBuilder().build())
.setTriggerId("triggerId-648752909")
.setLocationId("locationId1541836720")
.build();
ApiFuture<JobTrigger> future =
dlpServiceClient.createJobTriggerCallable().futureCall(request);
// Do something.
JobTrigger response = future.get();
}
Type | Description |
UnaryCallable<CreateJobTriggerRequest,JobTrigger> |
createStoredInfoType(CreateStoredInfoTypeRequest request)
public final StoredInfoType createStoredInfoType(CreateStoredInfoTypeRequest request)
Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
CreateStoredInfoTypeRequest request =
CreateStoredInfoTypeRequest.newBuilder()
.setParent(OrganizationName.of("[ORGANIZATION]").toString())
.setConfig(StoredInfoTypeConfig.newBuilder().build())
.setStoredInfoTypeId("storedInfoTypeId-1409591226")
.setLocationId("locationId1541836720")
.build();
StoredInfoType response = dlpServiceClient.createStoredInfoType(request);
}
Name | Description |
request | CreateStoredInfoTypeRequest The request object containing all of the parameters for the API call. |
Type | Description |
StoredInfoType |
createStoredInfoType(LocationName parent, StoredInfoTypeConfig config)
public final StoredInfoType createStoredInfoType(LocationName parent, StoredInfoTypeConfig config)
Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
StoredInfoTypeConfig config = StoredInfoTypeConfig.newBuilder().build();
StoredInfoType response = dlpServiceClient.createStoredInfoType(parent, config);
}
Name | Description |
parent | LocationName Required. Parent resource name. The format of this value varies depending on the scope of the request (project or organization) and whether you have specified a processing location: + Projects scope, location specified:<br/>
|
config | StoredInfoTypeConfig Required. Configuration of the storedInfoType to create. |
Type | Description |
StoredInfoType |
createStoredInfoType(OrganizationLocationName parent, StoredInfoTypeConfig config)
public final StoredInfoType createStoredInfoType(OrganizationLocationName parent, StoredInfoTypeConfig config)
Creates a pre-built stored infoType to be used for inspection. See https://cloud.google.com/dlp/docs/creating-stored-infotypes to learn more.
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
StoredInfoTypeConfig config = StoredInfoTypeConfig.newBuilder().build();
StoredInfoType response = dlpServiceClient.createStoredInfoType(parent, config);
}