HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/current/lib/surface/dlp/images/redact.yaml
# 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