Reference documentation and code samples for the Data Loss Prevention V2 Client class DiscoveryConfig.
Configuration for discovery to scan resources for profile generation.
Only one discovery configuration may exist per organization, folder,
or project.
The generated data profiles are retained according to thedata retention policy.
Generated from protobuf messagegoogle.privacy.dlp.v2.DiscoveryConfig
Namespace
Google \ Cloud \ Dlp \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Unique resource name for the DiscoveryConfig, assigned by the service when the DiscoveryConfig is created, for exampleprojects/dlp-test-project/locations/global/discoveryConfigs/53234423.
Detection logic for profile generation. Not all template features are used by Discovery. FindingLimits, include_quote and exclude_info_types have no impact on Discovery. Multiple templates may be provided if there is data in multiple regions. At most one template must be specified per-region (including "global"). Each region is scanned using the applicable template. If no region-specific template is specified, but a "global" template is specified, it will be copied to that region and used instead. If no global or region-specific template is provided for a region with data, that region's data will not be scanned. For more information, seehttps://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency.
Output only. A stream of errors encountered when the config was activated. Repeated errors may result in the config automatically being paused. Output only field. Will return the last 100 errors. Whenever the config is modified this list will be cleared.
Optional. Processing location configuration. Vertex AI dataset scanning will set processing_location.image_fallback_type to MultiRegionProcessing by default.
getName
Unique resource name for the DiscoveryConfig, assigned by the service when
the DiscoveryConfig is created, for exampleprojects/dlp-test-project/locations/global/discoveryConfigs/53234423.
Returns
Type
Description
string
setName
Unique resource name for the DiscoveryConfig, assigned by the service when
the DiscoveryConfig is created, for exampleprojects/dlp-test-project/locations/global/discoveryConfigs/53234423.
Not all template features are used by Discovery. FindingLimits,
include_quote and exclude_info_types have no impact on
Discovery.
Multiple templates may be provided if there is data in multiple regions.
At most one template must be specified per-region (including "global").
Each region is scanned using the applicable template. If no region-specific
template is specified, but a "global" template is specified, it will be
copied to that region and used instead. If no global or region-specific
template is provided for a region with data, that region's data will not be
scanned.
For more information, seehttps://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency.
Not all template features are used by Discovery. FindingLimits,
include_quote and exclude_info_types have no impact on
Discovery.
Multiple templates may be provided if there is data in multiple regions.
At most one template must be specified per-region (including "global").
Each region is scanned using the applicable template. If no region-specific
template is specified, but a "global" template is specified, it will be
copied to that region and used instead. If no global or region-specific
template is provided for a region with data, that region's data will not be
scanned.
For more information, seehttps://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency.
Output only. A stream of errors encountered when the config was activated.
Repeated errors may result in the config automatically being paused. Output
only field. Will return the last 100 errors. Whenever the config is
modified this list will be cleared.
Output only. A stream of errors encountered when the config was activated.
Repeated errors may result in the config automatically being paused. Output
only field. Will return the last 100 errors. Whenever the config is
modified this list will be cleared.
Optional. Processing location configuration. Vertex AI dataset scanning
will set processing_location.image_fallback_type to MultiRegionProcessing
by default.
Optional. Processing location configuration. Vertex AI dataset scanning
will set processing_location.image_fallback_type to MultiRegionProcessing
by default.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Data Loss Prevention V2 Client - Class DiscoveryConfig (2.6.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.6.1 (latest)](/php/docs/reference/cloud-dlp/latest/V2.DiscoveryConfig)\n- [2.6.0](/php/docs/reference/cloud-dlp/2.6.0/V2.DiscoveryConfig)\n- [2.4.1](/php/docs/reference/cloud-dlp/2.4.1/V2.DiscoveryConfig)\n- [2.3.0](/php/docs/reference/cloud-dlp/2.3.0/V2.DiscoveryConfig)\n- [2.2.3](/php/docs/reference/cloud-dlp/2.2.3/V2.DiscoveryConfig)\n- [2.1.0](/php/docs/reference/cloud-dlp/2.1.0/V2.DiscoveryConfig)\n- [2.0.0](/php/docs/reference/cloud-dlp/2.0.0/V2.DiscoveryConfig)\n- [1.19.0](/php/docs/reference/cloud-dlp/1.19.0/V2.DiscoveryConfig)\n- [1.18.0](/php/docs/reference/cloud-dlp/1.18.0/V2.DiscoveryConfig)\n- [1.17.0](/php/docs/reference/cloud-dlp/1.17.0/V2.DiscoveryConfig)\n- [1.16.0](/php/docs/reference/cloud-dlp/1.16.0/V2.DiscoveryConfig)\n- [1.15.1](/php/docs/reference/cloud-dlp/1.15.1/V2.DiscoveryConfig)\n- [1.14.0](/php/docs/reference/cloud-dlp/1.14.0/V2.DiscoveryConfig)\n- [1.13.2](/php/docs/reference/cloud-dlp/1.13.2/V2.DiscoveryConfig)\n- [1.12.0](/php/docs/reference/cloud-dlp/1.12.0/V2.DiscoveryConfig)\n- [1.11.0](/php/docs/reference/cloud-dlp/1.11.0/V2.DiscoveryConfig)\n- [1.10.2](/php/docs/reference/cloud-dlp/1.10.2/V2.DiscoveryConfig)\n- [1.9.0](/php/docs/reference/cloud-dlp/1.9.0/V2.DiscoveryConfig)\n- [1.8.6](/php/docs/reference/cloud-dlp/1.8.6/V2.DiscoveryConfig) \nReference documentation and code samples for the Data Loss Prevention V2 Client class DiscoveryConfig.\n\nConfiguration for discovery to scan resources for profile generation.\n\nOnly one discovery configuration may exist per organization, folder,\nor project.\nThe generated data profiles are retained according to the\n[data retention policy](https://cloud.google.com/sensitive-data-protection/docs/data-profiles#retention).\n\nGenerated from protobuf message `google.privacy.dlp.v2.DiscoveryConfig`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dlp \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nUnique resource name for the DiscoveryConfig, assigned by the service when\nthe DiscoveryConfig is created, for example\n`projects/dlp-test-project/locations/global/discoveryConfigs/53234423`.\n\n### setName\n\nUnique resource name for the DiscoveryConfig, assigned by the service when\nthe DiscoveryConfig is created, for example\n`projects/dlp-test-project/locations/global/discoveryConfigs/53234423`.\n\n### getDisplayName\n\nDisplay name (max 100 chars)\n\n### setDisplayName\n\nDisplay name (max 100 chars)\n\n### getOrgConfig\n\nOnly set when the parent is an org.\n\n### hasOrgConfig\n\n### clearOrgConfig\n\n### setOrgConfig\n\nOnly set when the parent is an org.\n\n### getOtherCloudStartingLocation\n\nMust be set only when scanning other clouds.\n\n### hasOtherCloudStartingLocation\n\n### clearOtherCloudStartingLocation\n\n### setOtherCloudStartingLocation\n\nMust be set only when scanning other clouds.\n\n### getInspectTemplates\n\nDetection logic for profile generation.\n\nNot all template features are used by Discovery. FindingLimits,\ninclude_quote and exclude_info_types have no impact on\nDiscovery.\nMultiple templates may be provided if there is data in multiple regions.\nAt most one template must be specified per-region (including \"global\").\nEach region is scanned using the applicable template. If no region-specific\ntemplate is specified, but a \"global\" template is specified, it will be\ncopied to that region and used instead. If no global or region-specific\ntemplate is provided for a region with data, that region's data will not be\nscanned.\nFor more information, see\n\u003chttps://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency\u003e.\n\n### setInspectTemplates\n\nDetection logic for profile generation.\n\nNot all template features are used by Discovery. FindingLimits,\ninclude_quote and exclude_info_types have no impact on\nDiscovery.\nMultiple templates may be provided if there is data in multiple regions.\nAt most one template must be specified per-region (including \"global\").\nEach region is scanned using the applicable template. If no region-specific\ntemplate is specified, but a \"global\" template is specified, it will be\ncopied to that region and used instead. If no global or region-specific\ntemplate is provided for a region with data, that region's data will not be\nscanned.\nFor more information, see\n\u003chttps://cloud.google.com/sensitive-data-protection/docs/data-profiles#data-residency\u003e.\n\n### getActions\n\nActions to execute at the completion of scanning.\n\n### setActions\n\nActions to execute at the completion of scanning.\n\n### getTargets\n\nTarget to match against for determining what to scan and how frequently.\n\n### setTargets\n\nTarget to match against for determining what to scan and how frequently.\n\n### getErrors\n\nOutput only. A stream of errors encountered when the config was activated.\n\nRepeated errors may result in the config automatically being paused. Output\nonly field. Will return the last 100 errors. Whenever the config is\nmodified this list will be cleared.\n\n### setErrors\n\nOutput only. A stream of errors encountered when the config was activated.\n\nRepeated errors may result in the config automatically being paused. Output\nonly field. Will return the last 100 errors. Whenever the config is\nmodified this list will be cleared.\n\n### getCreateTime\n\nOutput only. The creation timestamp of a DiscoveryConfig.\n\n### hasCreateTime\n\n### clearCreateTime\n\n### setCreateTime\n\nOutput only. The creation timestamp of a DiscoveryConfig.\n\n### getUpdateTime\n\nOutput only. The last update timestamp of a DiscoveryConfig.\n\n### hasUpdateTime\n\n### clearUpdateTime\n\n### setUpdateTime\n\nOutput only. The last update timestamp of a DiscoveryConfig.\n\n### getLastRunTime\n\nOutput only. The timestamp of the last time this config was executed.\n\n### hasLastRunTime\n\n### clearLastRunTime\n\n### setLastRunTime\n\nOutput only. The timestamp of the last time this config was executed.\n\n### getStatus\n\nRequired. A status for this configuration.\n\n### setStatus\n\nRequired. A status for this configuration.\n\n### getProcessingLocation\n\nOptional. Processing location configuration. Vertex AI dataset scanning\nwill set processing_location.image_fallback_type to MultiRegionProcessing\nby default.\n\n### hasProcessingLocation\n\n### clearProcessingLocation\n\n### setProcessingLocation\n\nOptional. Processing location configuration. Vertex AI dataset scanning\nwill set processing_location.image_fallback_type to MultiRegionProcessing\nby default."]]