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,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