Class: Google::Apis::DlpV2::GooglePrivacyDlpV2CloudStorageRegexFileSet
- Inherits:
-
Object
- Object
- Google::Apis::DlpV2::GooglePrivacyDlpV2CloudStorageRegexFileSet
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/dlp_v2/classes.rb,
generated/google/apis/dlp_v2/representations.rb,
generated/google/apis/dlp_v2/representations.rb
Overview
Message representing a set of files in a Cloud Storage bucket. Regular
expressions are used to allow fine-grained control over which files in the
bucket to include.
Included files are those that match at least one item in include_regex
and
do not match any items in exclude_regex
. Note that a file that matches
items from both lists will not be included. For a match to occur, the
entire file path (i.e., everything in the url after the bucket name) must
match the regular expression.
For example, given the input bucket_name: "mybucket", include_regex:
["directory1/.*"], exclude_regex:
["directory1/excluded.*"]
:
gs://mybucket/directory1/myfile
will be includedgs://mybucket/directory1/directory2/myfile
will be included (.*
matches across/
)gs://mybucket/directory0/directory1/myfile
will not be included (the full path doesn't match any items ininclude_regex
)gs://mybucket/directory1/excludedfile
will not be included (the path matches an item inexclude_regex
) Ifinclude_regex
is left empty, it will match all files by default (this is equivalent to settinginclude_regex: [".*"]
). Some other common use cases:bucket_name: "mybucket", exclude_regex: [".*\.pdf"]
will include all files inmybucket
except for .pdf filesbucket_name: "mybucket", include_regex: ["directory/[^/]+"]
will include all files directly undergs://mybucket/directory/
, without matching across/
Instance Attribute Summary collapse
-
#bucket_name ⇒ String
The name of a Cloud Storage bucket.
-
#exclude_regex ⇒ Array<String>
A list of regular expressions matching file paths to exclude.
-
#include_regex ⇒ Array<String>
A list of regular expressions matching file paths to include.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GooglePrivacyDlpV2CloudStorageRegexFileSet
constructor
A new instance of GooglePrivacyDlpV2CloudStorageRegexFileSet.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ GooglePrivacyDlpV2CloudStorageRegexFileSet
Returns a new instance of GooglePrivacyDlpV2CloudStorageRegexFileSet
802 803 804 |
# File 'generated/google/apis/dlp_v2/classes.rb', line 802 def initialize(**args) update!(**args) end |
Instance Attribute Details
#bucket_name ⇒ String
The name of a Cloud Storage bucket. Required.
Corresponds to the JSON property bucketName
778 779 780 |
# File 'generated/google/apis/dlp_v2/classes.rb', line 778 def bucket_name @bucket_name end |
#exclude_regex ⇒ Array<String>
A list of regular expressions matching file paths to exclude. All files in
the bucket that match at least one of these regular expressions will be
excluded from the scan.
Regular expressions use RE2
syntax; a guide can be found
under the google/re2 repository on GitHub.
Corresponds to the JSON property excludeRegex
788 789 790 |
# File 'generated/google/apis/dlp_v2/classes.rb', line 788 def exclude_regex @exclude_regex end |
#include_regex ⇒ Array<String>
A list of regular expressions matching file paths to include. All files in
the bucket that match at least one of these regular expressions will be
included in the set of files, except for those that also match an item in
exclude_regex
. Leaving this field empty will match all files by default
(this is equivalent to including .*
in the list).
Regular expressions use RE2
syntax; a guide can be found
under the google/re2 repository on GitHub.
Corresponds to the JSON property includeRegex
800 801 802 |
# File 'generated/google/apis/dlp_v2/classes.rb', line 800 def include_regex @include_regex end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
807 808 809 810 811 |
# File 'generated/google/apis/dlp_v2/classes.rb', line 807 def update!(**args) @bucket_name = args[:bucket_name] if args.key?(:bucket_name) @exclude_regex = args[:exclude_regex] if args.key?(:exclude_regex) @include_regex = args[:include_regex] if args.key?(:include_regex) end |