0

在 DLP 中,我正在创建一个常规的自定义字典检测器,它指向存储在 Cloud Storage 中的字典文本文件。以下是我为定义 custominfotype 所做的工作。我相信它遵循https://cloud.google.com/dlp/docs/creating-custom-infotypes-dictionary#examples上的说明。然而,它与“协议消息字典没有“cloudStoragePath”字段错误。该文本文件肯定存在于我的云存储桶中,并且我拥有适当的凭据。你能告诉我我的语法是否错误吗?谢谢你。

custom_info_types = [
    {
        "info_type": {"name": "TAXES"},
        "likelihood": google.cloud.dlp_v2.Likelihood.POSSIBLE,
        "dictionary": {
                            "cloudStoragePath": {
                                "path": "gs://mybucket/myfile.txt"
                            },
                       },
    }
]
4

1 回答 1

1

Python 不使用驼峰式大小写,而是使用蛇形大小写。

https://cloud.google.com/dlp/docs/samples/dlp-deidentify-masking#dlp_deidentify_masking-python

所以应该是 cloud_storage_path

于 2021-01-25T19:33:15.957 回答