feat: Add new gcloud commands, API clients, and third-party libraries across various services.

This commit is contained in:
2026-01-01 20:26:35 +01:00
parent 5e23cbece0
commit a19e592eb7
25221 changed files with 8324611 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The gcloud dlp command group."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
@base.DefaultUniverseOnly
class DLP(base.Group):
"""Manage sensitive data with Cloud Data Loss Prevention.
The DLP API lets you understand and manage sensitive data. It provides
fast, scalable classification and optional redaction for sensitive data
elements like credit card numbers, names, Social Security numbers, passport
numbers, U.S. and selected international driver's license numbers, and phone
numbers. The API classifies this data using more than 50 predefined detectors
to identify patterns, formats, and checksums, and even understands contextual
clues. The API supports text and images; just send data to the API or
specify data stored on your Google Cloud Storage, BigQuery,
or Cloud Datastore instances.
"""
category = base.SECURITY_CATEGORY
def Filter(self, context, args):
# TODO(b/190532822): Determine if command group works with project number
base.RequireProjectID(args)
del context, args

View File

@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The gcloud dlp datasources command group."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class Datasources(base.Group):
# pylint: disable=line-too-long
"""Cloud DLP Commands for analyzing Google Cloud data repositories.
Cloud DLP Commands for inspecting and analyzing sensitive data in Google Cloud
data repositories.
See [Inspecting Storage and Databases for Sensitive Data]
(https://cloud.google.com/dlp/docs/inspecting-storage)
for more details.
"""
# pylint: enable=line-too-long

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The gcloud dlp datasources bigquery command group."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class BigQuery(base.Group):
"""Cloud DLP Commands for analyzing data in BigQuery tables.
Cloud DLP commands for inspecting and analyzing content in BigQuery tables.
"""

View File

@@ -0,0 +1,102 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Schedule a risk analysis job for content in a BigQuery table.
description: |
Schedules a job to compute risk analysis metrics on content in a
BigQuery table.
examples: |
To create a job `my-bq-analysis` to analyze records in a BigQuery table
`myproject.myds.mytable`, run:
$ {command} `myproject.myds.mytable` --job-id my-ds-job --output-topics my-topic --numerical-stat-field col2
request:
collection: dlp.projects.dlpJobs
display_resource_type: job
method: create
api_version: v2
modify_request_hooks:
- googlecloudsdk.command_lib.dlp.hooks:SetRequestParent
arguments:
params:
- group:
mutex: true
required: true
help_text: Privacy analysis metrics.
params:
- arg_name: categorical-stat-field
api_field: googlePrivacyDlpV2CreateDlpJobRequest.riskJob.privacyMetric.categoricalStatsConfig.field.name
help_text: |
An individual column to compute numerical stats on, including number
of distinct values and value count distribution.
- arg_name: numerical-stat-field
api_field: googlePrivacyDlpV2CreateDlpJobRequest.riskJob.privacyMetric.numericalStatsConfig.field.name
help_text: |
Individual column to compute numerical stats on. Supported types are
integer, float, date, datetime, timestamp, time.
- group:
help_text: l-diversity analysis options.
params:
- arg_name: quasi-ids
api_field: googlePrivacyDlpV2CreateDlpJobRequest.riskJob.privacyMetric.lDiversityConfig.quasiIds
type: googlecloudsdk.command_lib.dlp.hooks:PrivacyField
required: true
help_text: |
A set of quasi-identifiers indicating how equivalence classes are
defined for the l-diversity computation. When multiple fields are
specified, they are considered a single composite key.
- arg_name: sensitive-attribute
api_field: googlePrivacyDlpV2CreateDlpJobRequest.riskJob.privacyMetric.lDiversityConfig.sensitiveAttribute.name
help_text: |
Sensitive field for computing the l-diversity value.
- group:
mutex: true
required: true
params:
- arg_name: output-topics
api_field: googlePrivacyDlpV2CreateDlpJobRequest.riskJob.actions
type: googlecloudsdk.command_lib.dlp.hooks:PubSubTopicAction
help_text: |
Publishes the results of a Cloud DLP job to one or more Cloud Pub/Sub
topics.
Note: The topic must have given publishing access rights to the DLP
API service account executing the Cloud DLP job.
- arg_name: output-table
api_field: googlePrivacyDlpV2CreateDlpJobRequest.riskJob.actions
type: googlecloudsdk.command_lib.dlp.hooks:BigQueryTableAction
help_text: |
Publishes results of a Cloud DLP job to a BigQuery table.
BigQuery tables are uniquely identified by their project_id,
dataset_id, and table_id in the format
`<project_id>.<dataset_id>.<table_id>`. If no table_id is specified,
DLP will create a new table.
- _REF_: googlecloudsdk.command_lib.dlp.flags:big_query_table
arg_name: input_table
api_field: googlePrivacyDlpV2CreateDlpJobRequest.riskJob.sourceTable
required: true
is_positional: true
processor: googlecloudsdk.command_lib.dlp.hooks:ExtractBqTableFromInputConfig
- _REF_: googlecloudsdk.command_lib.dlp.flags:job_id
resource:
help_text: |
The Cloud DLP project to create Job In.
spec: !REF googlecloudsdk.command_lib.dlp.resources:project
is_parent_resource: true

View File

@@ -0,0 +1,64 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Schedules a job to inspect content in a BigQuery table.
description: |
Schedules a job to inspect content in a BigQuery table for sensitive data.
See [Inspecting Storage and Databases for Sensitive Data](https://cloud.google.com/dlp/docs/inspecting-storage)
for more details.
examples: |
The following command creates a job `my-bq-job` to scan records in
BigQuery table `myproject.myds.mytable`:
$ {command} `myproject.myds.mytable` --job-id my-ds-job --min-time '2018-01-01T12:00:00Z' --max-time '2018-01-31T12:00:00Z' --output-topics my-topic --max-findings-per-item 3 --max-findings 1000 --info-types PHONE_NUMBER,EMAIL_ADDRESS --min-likelihood very-likely --include-quote --exclude-info-types
request:
collection: dlp.projects.dlpJobs
display_resource_type: job
method: create
api_version: v2
modify_request_hooks:
- googlecloudsdk.command_lib.dlp.hooks:SetRequestParent
- googlecloudsdk.command_lib.dlp.hooks:UpdateIdentifyingFields
arguments:
additional_arguments_hook: googlecloudsdk.command_lib.dlp.hooks:GetIdentifyingFieldsArg
params:
- _REF_: googlecloudsdk.command_lib.dlp.flags:big_query_table
arg_name: input_table
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.storageConfig.bigQueryOptions
required: true
is_positional: true
- _REF_: googlecloudsdk.command_lib.dlp.flags:max_item_findings
- _REF_: googlecloudsdk.command_lib.dlp.flags:min_time
- _REF_: googlecloudsdk.command_lib.dlp.flags:max_time
- _REF_: googlecloudsdk.command_lib.dlp.flags:jobs_output_group
- _REF_: googlecloudsdk.command_lib.dlp.flags:info_type
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.infoTypes
- _REF_: googlecloudsdk.command_lib.dlp.flags:min_likelihood
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.minLikelihood
- _REF_: googlecloudsdk.command_lib.dlp.flags:include_quote
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.includeQuote
- _REF_: googlecloudsdk.command_lib.dlp.flags:max_findings
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.limits.maxFindingsPerRequest
- _REF_: googlecloudsdk.command_lib.dlp.flags:exclude_info_types
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.excludeInfoTypes
- _REF_: googlecloudsdk.command_lib.dlp.flags:job_id
resource:
help_text: |
The Cloud DLP project to create Job In.
spec: !REF googlecloudsdk.command_lib.dlp.resources:project
is_parent_resource: true

View File

@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The gcloud dlp datasources datastore command group."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class Datastore(base.Group):
"""Cloud DLP Commands for analyzing data in Cloud Datastore repositories.
Cloud DLP commands for inspecting and analyzing content in Cloud Datastore
repositories.
"""

View File

@@ -0,0 +1,61 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Schedules a job to inspect content in a Cloud Datastore.
description: |
Schedules a job to inspect content in a Cloud Datastore for sensitive data.
See [Inspecting Storage and Databases for Sensitive Data](https://cloud.google.com/dlp/docs/inspecting-storage)
for more details.
examples: |
The following command creates a job `my-ds-job` to scan records in
Cloud Datastore table `myds:mykind`:
$ {command} `myds:mykind` --job-id my-ds-job --min-time '2018-01-01T12:00:00Z' --max-time '2018-01-31T12:00:00Z' --output-topics my-topic --max-findings-per-item 3 --max-findings 1000 --info-types PHONE_NUMBER,EMAIL_ADDRESS --min-likelihood very-likely --include-quote --exclude-info-types
request:
collection: dlp.projects.dlpJobs
display_resource_type: job
method: create
api_version: v2
modify_request_hooks:
- googlecloudsdk.command_lib.dlp.hooks:SetRequestParent
arguments:
params:
- _REF_: googlecloudsdk.command_lib.dlp.flags:datastore_kind
arg_name: datastore_kind
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.storageConfig.datastoreOptions
is_positional: true
required: true
- _REF_: googlecloudsdk.command_lib.dlp.flags:max_item_findings
- _REF_: googlecloudsdk.command_lib.dlp.flags:min_time
- _REF_: googlecloudsdk.command_lib.dlp.flags:max_time
- _REF_: googlecloudsdk.command_lib.dlp.flags:jobs_output_group
- _REF_: googlecloudsdk.command_lib.dlp.flags:info_type
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.infoTypes
- _REF_: googlecloudsdk.command_lib.dlp.flags:min_likelihood
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.minLikelihood
- _REF_: googlecloudsdk.command_lib.dlp.flags:include_quote
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.includeQuote
- _REF_: googlecloudsdk.command_lib.dlp.flags:max_findings
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.limits.maxFindingsPerRequest
- _REF_: googlecloudsdk.command_lib.dlp.flags:exclude_info_types
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.excludeInfoTypes
- _REF_: googlecloudsdk.command_lib.dlp.flags:job_id
resource:
help_text: |
The Cloud DLP project to create Job In.
spec: !REF googlecloudsdk.command_lib.dlp.resources:project
is_parent_resource: true

View File

@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The gcloud dlp datasources gcs command group."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class Gcs(base.Group):
"""Cloud DLP Commands for analyzing data in Google Cloud Storage.
Cloud DLP commands for inspecting content in a Google Cloud Storage bucket.
"""

View File

@@ -0,0 +1,69 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Schedules a job to inspect content in a Google Cloud Storage bucket.
description: |
Schedules a job to inspect content in a Google Cloud Storage bucket for
sensitive data.
See [Inspecting Storage and Databases for Sensitive Data](https://cloud.google.com/dlp/docs/inspecting-storage)
for more details.
examples: |
The following command creates a job `my-gcs-job` to scan files in the
Google Cloud Storage path `gs://testproject/dlp/*`:
$ {command} `gs://testproject/dlp/*` --job-id my-gcs-job --file-size-limit 10000 --min-time '2018-01-01T12:00:00Z' --max-time '2018-01-31T12:00:00Z' --output-topics my-topic --max-findings-per-item 3 --max-findings 1000 --info-types PHONE_NUMBER,EMAIL_ADDRESS --min-likelihood very-likely --include-quote --exclude-info-types
request:
collection: dlp.projects.dlpJobs
display_resource_type: job
method: create
api_version: v2
modify_request_hooks:
- googlecloudsdk.command_lib.dlp.hooks:SetRequestParent
- googlecloudsdk.command_lib.util.hooks.request_modifiers:SetFieldFromArg:api_field=googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFile,arg_name=file_size_limit
arguments:
params:
- arg_name: file-size-limit
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.storageConfig.cloudStorageOptions.bytesLimitPerFile
type: int
default: 1024
help_text: |
Integer indicating max number of bytes to scan from a file. If a
scanned file's size is bigger than this value, then the rest of the
bytes are omitted. The default value is 1024.
- _REF_: googlecloudsdk.command_lib.dlp.flags:gcs_path
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.storageConfig.cloudStorageOptions
is_positional: true
- _REF_: googlecloudsdk.command_lib.dlp.flags:max_item_findings
- _REF_: googlecloudsdk.command_lib.dlp.flags:min_time
- _REF_: googlecloudsdk.command_lib.dlp.flags:max_time
- _REF_: googlecloudsdk.command_lib.dlp.flags:jobs_output_group
- _REF_: googlecloudsdk.command_lib.dlp.flags:info_type
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.infoTypes
- _REF_: googlecloudsdk.command_lib.dlp.flags:min_likelihood
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.minLikelihood
- _REF_: googlecloudsdk.command_lib.dlp.flags:include_quote
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.includeQuote
- _REF_: googlecloudsdk.command_lib.dlp.flags:max_findings
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.limits.maxFindingsPerRequest
- _REF_: googlecloudsdk.command_lib.dlp.flags:exclude_info_types
api_field: googlePrivacyDlpV2CreateDlpJobRequest.inspectJob.inspectConfig.excludeInfoTypes
- _REF_: googlecloudsdk.command_lib.dlp.flags:job_id
resource:
help_text: |
The Cloud DLP project to create Job In.
spec: !REF googlecloudsdk.command_lib.dlp.resources:project
is_parent_resource: true

View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The gcloud dlp images command group."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class Images(base.Group):
"""Use Cloud DLP Image capabilities.
Cloud DLP commands for inspecting and redacting sensitive content in images.
"""

View File

@@ -0,0 +1,22 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
image_file:
api_field: googlePrivacyDlpV2InspectContentRequest.item.byteItem
arg_name: image
is_positional: true
required: true
processor: googlecloudsdk.command_lib.dlp.hooks:GetImageFromFile
help_text: |
Image file to search for sensitive info. The file type must be one of
PNG, JPEG, SVG, or BMP.

View File

@@ -0,0 +1,35 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Finds potentially sensitive data in image content.
description: |
Finds potentially sensitive data in image content.
request:
collection: dlp.projects.content
method: inspect
api_version: v2
arguments:
params:
- _COMMON_: image_file
- !REF googlecloudsdk.command_lib.dlp.flags:info_type
- !REF googlecloudsdk.command_lib.dlp.flags:min_likelihood
- !REF googlecloudsdk.command_lib.dlp.flags:include_quote
- !REF googlecloudsdk.command_lib.dlp.flags:exclude_info_types
- !REF googlecloudsdk.command_lib.dlp.flags:max_findings
resource:
help_text: Project to use to inspect images.
spec: !REF googlecloudsdk.command_lib.dlp.resources:content

View File

@@ -0,0 +1,67 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Redact potentially sensitive data from image content.
description: |
Redact potentially sensitive data from image content.
examples: |
To redact phone numbers from an image named my-image.jpg and write the
redacted image to my-redacted-image.jpg, run:
$ {command} my-image.jpg --info-types PHONE_NUMBER \
--output-file my-redacted-image.jpg
request:
collection: dlp.projects.image
method: redact
api_version: v2
arguments:
additional_arguments_hook: googlecloudsdk.command_lib.dlp.hooks:AddOutputFileFlag
params:
- _COMMON_: image_file
api_field: googlePrivacyDlpV2RedactImageRequest.byteItem
- arg_name: redact-all-text
api_field: googlePrivacyDlpV2RedactImageRequest.imageRedactionConfigs.redactAllText
action: store_true
help_text: |
If specified, all text info in the image will be removed,
whether it is detected as sensitive or not.
required: false
- arg_name: redact-color
api_field: googlePrivacyDlpV2RedactImageRequest.imageRedactionConfigs.redactionColor
processor: googlecloudsdk.command_lib.dlp.hooks:GetRedactColorFromString
help_text: |
The color to use when redacting content from an image. If not
specified, the default value is black. Colors should be specified as
a string of `r,g,b` float values in the interval [0,1] representing
the amount of red, green, and blue in the color, respectively.
For example, `black = 0,0,0`, `red = 1.0,0,0`, `white = 1.0,1.0,1.0`,
and so on.
required: false
# Need to override shared arg definitions
- _REF_: googlecloudsdk.command_lib.dlp.flags:info_type
api_field: googlePrivacyDlpV2RedactImageRequest.inspectConfig.infoTypes
- _REF_: googlecloudsdk.command_lib.dlp.flags:min_likelihood
api_field: googlePrivacyDlpV2RedactImageRequest.inspectConfig.minLikelihood
- _REF_: googlecloudsdk.command_lib.dlp.flags:include_quote
api_field: googlePrivacyDlpV2RedactImageRequest.inspectConfig.includeQuote
resource:
help_text: Project to use to redact images.
spec: !REF googlecloudsdk.command_lib.dlp.resources:image
response:
modify_response_hooks:
- googlecloudsdk.command_lib.dlp.hooks:PossiblyWriteRedactedImageResponseToOutputFile

View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The gcloud dlp job-triggers command group."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class JobTriggers(base.Group):
"""Cloud DLP commands for creating and managing Cloud DLP job triggers.
Job triggers contain configurations to run Cloud DLP jobs on a set schedule.
"""

View File

@@ -0,0 +1,117 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Creates a Cloud DLP job trigger.
description: |
Creates a Cloud DLP job trigger.
examples: |
The following command creates a job trigger named `my_job_trigger`:
$ {command} my_job_trigger --display-name Daily_Inspect_Trigger --description 'My New Trigger' --input-table myproject.mydataset.input --output-topics my-topic --max-findings-per-item 3 --max-findings 1000 --info-types PHONE_NUMBER,US_DRIVERS_LICENSE --min-likelihood very-likely --include-quote --exclude-info-types --trigger-schedule 8400s
request:
collection: dlp.projects.jobTriggers
api_version: v2
static_fields:
googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.status: HEALTHY
modify_request_hooks:
- googlecloudsdk.command_lib.dlp.hooks:UpdateDataStoreOptions
- googlecloudsdk.command_lib.util.hooks.request_modifiers:SetFieldFromArg:api_field=googlePrivacyDlpV2CreateJobTriggerRequest.triggerId,arg_name=job_trigger
- googlecloudsdk.command_lib.dlp.hooks:SetRequestParent
arguments:
params:
- arg_name: description
api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.description
is_positional: false
required: false
help_text: |
User provided description (maximum 256 characters)
- arg_name: display-name
api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.displayName
is_positional: false
required: false
help_text: |
Display name of the job trigger (maximum 100 characters)
- api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.inspectJob.inspectConfig.limits.maxFindingsPerItem
arg_name: max-findings-per-item
type: int
is_positional: false
required: false
help_text: |
Maximum number of findings that will be returned for each item
scanned.
If not specified, no limits are applied.
- api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.triggers.schedule.recurrencePeriodDuration
arg_name: trigger-schedule
type: 'googlecloudsdk.calliope.arg_parsers:Duration:'
processor: googlecloudsdk.command_lib.dlp.hooks:GetJobScheduleDurationString
is_positional: false
repeated: false
required: true
help_text: |
Duration specifying how often the triggered job will be run. A
scheduled start time will be skipped if the previous execution has
not ended when its scheduled time occurs. Value must be a time
duration greater than or equal to 1 day and can be no longer
than 60 days.
See `$ gcloud topic datetimes for information on duration formats.`
- group:
mutex: true
required: true
params:
- arg_name: output-topics
api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.inspectJob.actions
type: googlecloudsdk.command_lib.dlp.hooks:PubSubTopicAction
help_text: |
Publishes the results of a Cloud DLP job to one or more Cloud Pub/Sub
topics.
Note: The topic must have given publishing access rights to the
DLP API service account executing the Cloud DLP job.
- arg_name: output-table
api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.inspectJob.actions
type: googlecloudsdk.command_lib.dlp.hooks:BigQueryTableAction
help_text: |
Publishes results of a Cloud DLP job a BigQuery table.
BigQuery tables are uniquely identified by their project_id,
dataset_id, and table_id in the format
`<project_id>.<dataset_id>.<table_id>`.
- group:
mutex: true
required: true
params:
- _REF_: googlecloudsdk.command_lib.dlp.flags:datastore_kind
- _REF_: googlecloudsdk.command_lib.dlp.flags:gcs_path
- _REF_: googlecloudsdk.command_lib.dlp.flags:big_query_table
- _REF_: googlecloudsdk.command_lib.dlp.flags:info_type
api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.inspectJob.inspectConfig.infoTypes
- _REF_: googlecloudsdk.command_lib.dlp.flags:min_likelihood
api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.inspectJob.inspectConfig.minLikelihood
- _REF_: googlecloudsdk.command_lib.dlp.flags:include_quote
api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.inspectJob.inspectConfig.includeQuote
- _REF_: googlecloudsdk.command_lib.dlp.flags:max_findings
api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.inspectJob.inspectConfig.limits.maxFindingsPerRequest
- _REF_: googlecloudsdk.command_lib.dlp.flags:exclude_info_types
api_field: googlePrivacyDlpV2CreateJobTriggerRequest.jobTrigger.inspectJob.inspectConfig.excludeInfoTypes
resource:
help_text: |
The Cloud DLP job trigger to create. The job trigger name can contain
uppercase and lowercase letters, numbers, and hyphens -- that is, it
must match the regular expression:`[a-zA-Z\\d-]+`. The maximum length
is 100 characters. If not supplied, the system generates one.
spec: !REF googlecloudsdk.command_lib.dlp.resources:job_trigger

View File

@@ -0,0 +1,28 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Delete a Cloud DLP job trigger.
description: |
Delete a Cloud DLP job trigger.
request:
collection: dlp.projects.jobTriggers
api_version: v2
arguments:
resource:
help_text: |
The Cloud DLP job trigger to delete.
spec: !REF googlecloudsdk.command_lib.dlp.resources:job_trigger

View File

@@ -0,0 +1,31 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Get the latest status of a Cloud DLP job trigger.
description: |
Get the latest status of a Cloud DLP job trigger.
request:
collection: dlp.projects.jobTriggers
api_version: v2
response:
id_field: name
arguments:
resource:
help_text: |
The Cloud DLP job trigger to fetch.
spec: !REF googlecloudsdk.command_lib.dlp.resources:job_trigger

View File

@@ -0,0 +1,46 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: List Cloud DLP job triggers.
description: |
List Cloud DLP job triggers.
request:
collection: dlp.projects.jobTriggers
api_version: v2
modify_request_hooks:
- googlecloudsdk.command_lib.dlp.hooks:SetRequestParent
- googlecloudsdk.command_lib.dlp.hooks:SetOrderByFromSortBy
response:
id_field: name
arguments:
resource:
help_text: The project to list job triggers for.
spec: !REF googlecloudsdk.command_lib.dlp.resources:project
removed_flags: [project]
output:
format: |
table(
name.basename(),
createTime:label=CREATED,
inspectJob.inspectConfig.minLikelihood:label=MIN_LIKELIHOOD,
inspectJob.inspectConfig.infoTypes.map().extract(name).map().list().join(','):label=INFO_TYPES,
triggers.schedule.recurrencePeriodDuration.list():label=SCHEDULE,
updateTime:label=UPDATED,
status:label=STATUS
)

View File

@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The gcloud dlp jobs command group."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class Jobs(base.Group):
"""Manage asynchronous, long-running Cloud DLP jobs."""

View File

@@ -0,0 +1,37 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applqicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Start the asynchronous cancellation of a Cloud DLP job.
description: |
Start the asynchronous cancellation of a Cloud DLP job. The server makes a
best effort to cancel the job, but success is not guaranteed.
request:
collection: dlp.projects.dlpJobs
method: cancel
api_version: v2
modify_request_hooks:
- googlecloudsdk.command_lib.util.hooks.request_modifiers:SetFieldFromRelativeName:api_field=name
- googlecloudsdk.command_lib.dlp.hooks:SetCancelRequestHook
input:
confirmation_prompt: |
You are about to cancel dlp job [{__name__}].
arguments:
resource:
help_text: |
The Cloud DLP job to cancel.
spec: !REF googlecloudsdk.command_lib.dlp.resources:job

View File

@@ -0,0 +1,28 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Delete a Cloud DLP job.
description: |
Deletes a Cloud DLP job. The job will be canceled if possible.
request:
collection: dlp.projects.dlpJobs
api_version: v2
arguments:
resource:
help_text: |
The Cloud DLP job to delete.
spec: !REF googlecloudsdk.command_lib.dlp.resources:job

View File

@@ -0,0 +1,31 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Get the latest status of a Cloud DLP job.
description: |
Get the latest status of a Cloud DLP job.
request:
collection: dlp.projects.dlpJobs
api_version: v2
response:
id_field: name
arguments:
resource:
help_text: |
The Cloud DLP job to fetch.
spec: !REF googlecloudsdk.command_lib.dlp.resources:job

View File

@@ -0,0 +1,56 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: List Cloud DLP jobs.
description: |
List Cloud DLP jobs.
request:
collection: dlp.projects.locations.dlpJobs
api_version: v2
response:
id_field: name
arguments:
params:
- arg_name: job-type
api_field: type
is_positional: false
required: false
help_text: |
The type of Cloud DLP jobs to list.
default: inspect
choices:
- arg_value: inspect
enum_value: INSPECT_JOB
- arg_value: risk-analysis
enum_value: RISK_ANALYSIS_JOB
resource:
help_text: The location to list jobs for.
spec: !REF googlecloudsdk.command_lib.dlp.resources:location
output:
format: |
table(
name.basename(),
createTime:label=CREATED,
inspectDetails.requestedOptions.jobConfig.inspectConfig.minLikelihood:label=MIN_LIKELIHOOD,
inspectDetails.requestedOptions.jobConfig.inspectConfig.infoTypes.map().extract(name).map().list().join(','):label=INFO_TYPES,
type:label=JOB_TYPE,
state:label=STATUS
)

View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*- #
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""The gcloud dlp text command group."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class Text(base.Group):
"""Use Cloud DLP Text capabilities.
Cloud DLP commands for inspecting and redacting text content.
"""

View File

@@ -0,0 +1,52 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
text_args:
redact_info_type:
_REF_: googlecloudsdk.surface.dlp.__init__:info_type
api_field: googlePrivacyDlpV2DeidentifyContentRequest.inspectConfig.infoTypes
required: true
redact_content_arg:
group:
mutex: true
required: true
params:
- api_field: googlePrivacyDlpV2DeidentifyContentRequest.item.value
arg_name: content-file
type: "googlecloudsdk.calliope.arg_parsers:FileContents:"
help_text: |
Text file to scan for sensitive data to redact. Can also be a CSV
file specifying tabular data. For CSV files, up to 50,000 values
per request are allowed. To read from stdin pass '-' as the file
name.
- api_field: googlePrivacyDlpV2DeidentifyContentRequest.item.value
arg_name: content
help_text: |
Text content to redact sensitive data from.
inspect_content_arg:
group:
mutex: true
required: true
params:
- api_field: googlePrivacyDlpV2InspectContentRequest.item.value
arg_name: content-file
type: "googlecloudsdk.calliope.arg_parsers:FileContents:"
help_text: |
Text file to inspect for sensitive data. Can also be a CSV
file specifying tabular data. For CSV files, up to 50,000 values
per request are allowed. To read from stdin pass '-' as the file
name.
- api_field: googlePrivacyDlpV2InspectContentRequest.item.value
arg_name: content
help_text: |
Text content to inspect for sensitive data.

View File

@@ -0,0 +1,36 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Find potentially sensitive data in text content.
description: |
Find potentially sensitive data in text content.
request:
collection: dlp.projects.content
method: inspect
api_version: v2
arguments:
params:
- _COMMON_: text_args.inspect_content_arg
- !REF googlecloudsdk.command_lib.dlp.flags:info_type
- !REF googlecloudsdk.command_lib.dlp.flags:min_likelihood
- !REF googlecloudsdk.command_lib.dlp.flags:include_quote
- !REF googlecloudsdk.command_lib.dlp.flags:exclude_info_types
- !REF googlecloudsdk.command_lib.dlp.flags:max_findings
resource:
help_text: Project to use to inspect text.
spec: !REF googlecloudsdk.command_lib.dlp.resources:content

View File

@@ -0,0 +1,76 @@
# Copyright 2018 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- release_tracks: [ALPHA]
help_text:
brief: Redact potentially sensitive data from text content.
description: |
Redacts potentially sensitive data from text content.
examples: |
To redact email addresses from a file named my-data.csv and write the
redacted contents to my-redacted-data.csv, run:
$ {command} --info-types EMAIL_ADDRESS --replace-with-info-type \
--content-file my-data.csv --output-file my-redacted-data.csv
request:
collection: dlp.projects.content
method: deidentify
api_version: v2
arguments:
additional_arguments_hook: googlecloudsdk.command_lib.dlp.hooks:AddOutputFileFlag
params:
- _COMMON_: text_args.redact_content_arg
# Need to override shared arg definitions
- _REF_: googlecloudsdk.command_lib.dlp.flags:info_type
api_field: googlePrivacyDlpV2DeidentifyContentRequest.inspectConfig.infoTypes
required: true
- _REF_: googlecloudsdk.command_lib.dlp.flags:min_likelihood
api_field: googlePrivacyDlpV2DeidentifyContentRequest.inspectConfig.minLikelihood
- group:
mutex: true
required: true
params:
- api_field: googlePrivacyDlpV2DeidentifyContentRequest.deidentifyConfig.infoTypeTransformations.transformations.primitiveTransformation.replaceWithInfoTypeConfig
arg_name: replace-with-info-type
action: store_true
repeated: false
default: null
processor: googlecloudsdk.command_lib.dlp.hooks:GetInfoTypeTransform
help_text: |
If specified, all sensitive data will be replaced with its infoType.
For example, 'email:guest@example.com' would become
'email:[EMAIL_ADDRESS]'.
- api_field: googlePrivacyDlpV2DeidentifyContentRequest.deidentifyConfig.infoTypeTransformations.transformations.primitiveTransformation.redactConfig
arg_name: remove-findings
action: store_true
default: null
repeated: false
processor: googlecloudsdk.command_lib.dlp.hooks:GetRedactTransform
help_text: |
If specified, all sensitive data will be removed, instead of
replaced.
- api_field: googlePrivacyDlpV2DeidentifyContentRequest.deidentifyConfig.infoTypeTransformations.transformations.primitiveTransformation.replaceConfig
arg_name: replacement-text
repeated: false
processor: googlecloudsdk.command_lib.dlp.hooks:GetReplaceTextTransform
help_text: |
Text to replace each sensitive data finding with.
resource:
help_text: Project to use to redact images.
spec: !REF googlecloudsdk.command_lib.dlp.resources:content
response:
modify_response_hooks:
- googlecloudsdk.command_lib.dlp.hooks:PossiblyWriteRedactedTextResponseToOutputFile