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