Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 如何从木桶(GCS)读取拼花地板文件,并使用DLP api取消对特定列的标识?_Google Cloud Platform_Google Cloud Dlp - Fatal编程技术网

Google cloud platform 如何从木桶(GCS)读取拼花地板文件,并使用DLP api取消对特定列的标识?

Google cloud platform 如何从木桶(GCS)读取拼花地板文件,并使用DLP api取消对特定列的标识?,google-cloud-platform,google-cloud-dlp,Google Cloud Platform,Google Cloud Dlp,下面是我的JSON对象,用于DLPAPI调用,以屏蔽GCS上bucket上的拼花文件上的特定数据列。虽然calli dlp.deIdentity_content()方法必须将项目传递给它,但不确定如何传递拼花文件,我已经提到了拼花文件路径 inspect_config = { 'info_types': info_types, 'custom_info_types': custom_info_types, 'min_likelihood': min_likelihood,

下面是我的JSON对象,用于DLPAPI调用,以屏蔽GCS上bucket上的拼花文件上的特定数据列。虽然calli dlp.deIdentity_content()方法必须将项目传递给它,但不确定如何传递拼花文件,我已经提到了拼花文件路径

inspect_config = {
    'info_types': info_types,
    'custom_info_types': custom_info_types,
    'min_likelihood': min_likelihood,
    'limits': {'max_findings_per_request': max_findings},
}

actions = [{
    'saveFindings': {
        'outputConfig': {
            'table': {
                'projectId': project,
                'datasetId': 1,
                'tableId': "result1"
            }
        }
    }
}]
# Construct a storage_config containing the file's URL.
url = 'gs://{}/{}'.format(bucket, filename)

storage_config = {
    'cloud_storage_options': {
        'file_set': {'url': url}
    }
}
# Construct deidentify configuration dictionary
deidentify_config = {
    "recordTransformations": {
        "fieldTransformations": [
            {
                "fields": [
                    {
                        "name": "IP-address"
                    }
                ],
                "primitiveTransformation": {
                    "cryptoHashConfig": {
                        "cryptoKey": {
                            "transient": {
                                "name": "[TRANSIENT-CRYPTO-KEY-1]"
                            }
                        }
                    }
                }
            },
            {
                "fields": [
                    {
                        "name": "comments"
                    }
                ],
                "infoTypeTransformations": {
                    "transformations": [
                        {
                            "infoTypes": [
                                {
                                    "name": "PHONE_NUMBER"
                                },
                                {
                                    "name": "EMAIL_ADDRESS"
                                },
                                {
                                    "name": "IP_ADDRESS"
                                }
                            ],
                            "primitiveTransformation": {
                                "cryptoHashConfig": {
                                    "cryptoKey": {
                                        "transient": {
                                            "name": "[TRANSIENT-CRYPTO-KEY-2]"
                                        }
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
}
# Call the API
response = dlp.deidentify_content(
    parent, inspect_config=inspect_config,
    deidentify_config=deidentify_config, item=item)

我试图实现的是屏蔽GCS bucket上的拼花文件,屏蔽少数列,并将屏蔽的拼花文件存储为BigQuery表上的表。

拼花文件当前作为二进制对象进行扫描,因为系统尚未智能地解析它们。V2 api中列出了支持的文件类型

您可以做的是将您的拼花文件从一个bucket加载到bigquery中,如本文所述,然后从中解析数据