airflow.providers.google.cloud.hooks.dlp¶
此模块包含一个 CloudDLPHook,允许您连接到 Google Cloud DLP 服务。
属性¶
类¶
用于 Google Cloud 数据丢失防护 (DLP) API 的 Hook。 |
模块内容¶
- airflow.providers.google.cloud.hooks.dlp.DLP_JOB_PATH_PATTERN = '^projects/[^/]+/dlpJobs/(?P<job>.*?)$'[source]¶
- class airflow.providers.google.cloud.hooks.dlp.CloudDLPHook(gcp_conn_id='google_cloud_default', impersonation_chain=None, **kwargs)[source]¶
基类:
airflow.providers.google.common.hooks.base_google.GoogleBaseHook
用于 Google Cloud 数据丢失防护 (DLP) API 的 Hook。
Cloud DLP 允许客户端检测用户提供的非结构化数据流(如文本块或图像)中是否存在个人身份信息 (PII) 和其他隐私敏感数据。该服务还包括敏感数据删除修订和在 Google Cloud 数据集上安排数据扫描的方法。
- 参数:
gcp_conn_id (str) – 获取连接信息时使用的连接 ID。
impersonation_chain (str | collections.abc.Sequence[str] | None) – 可选的服务账号,用于使用短期凭据进行模拟,或获取列表中最后一个账号(将在请求中被模拟)access_token 所需的账号链列表。如果设置为字符串,该账号必须授予原始账号 Service Account Token Creator IAM 角色。如果设置为序列,则列表中的身份必须授予紧前身份 Service Account Token Creator IAM 角色,并且列表中的第一个账号将此角色授予原始账号。
- get_conn()[source]¶
提供用于与 Cloud DLP API 交互的客户端。
- 返回:
Google Cloud DLP API 客户端
- 返回类型:
google.cloud.dlp.DlpServiceClient
- cancel_dlp_job(dlp_job_id, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]¶
开始对长时间运行的 DLP 作业进行异步取消。
- 参数:
dlp_job_id (str) – 要取消的 DLP 作业资源的 ID。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- create_deidentify_template(organization_id=None, project_id=PROVIDE_PROJECT_ID, deidentify_template=None, template_id=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
创建一个去标识化模板,以重用内容、图像和存储的常用配置。
- 参数:
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
deidentify_template (dict | google.cloud.dlp_v2.types.DeidentifyTemplate | None) – (可选) 要创建的去标识化模板。
template_id (str | None) – (可选) 模板 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- create_dlp_job(project_id=PROVIDE_PROJECT_ID, inspect_job=None, risk_job=None, job_id=None, retry=DEFAULT, timeout=None, metadata=(), wait_until_finished=True, time_to_sleep_in_seconds=60)[source]¶
创建一个新作业,用于检查存储或计算风险指标。
- 参数:
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
inspect_job (dict | google.cloud.dlp_v2.types.InspectJobConfig | None) – (可选) 检查作业的配置。
risk_job (dict | google.cloud.dlp_v2.types.RiskAnalysisJobConfig | None) – (可选) 风险作业的配置。
job_id (str | None) – (可选) 作业 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
wait_until_finished (bool) – (可选) 如果为 true,它将持续轮询作业状态,直到状态设置为 DONE。
time_to_sleep_in_seconds (int) – (可选) 在主动检查操作结果之间休眠的时间量(以秒为单位)。默认为 60。
- create_inspect_template(organization_id=None, project_id=PROVIDE_PROJECT_ID, inspect_template=None, template_id=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
创建一个检查模板,以重用内容、图像和存储的常用配置。
- 参数:
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
inspect_template (google.cloud.dlp_v2.types.InspectTemplate | None) – (可选) 要创建的检查模板。
template_id (str | None) – (可选) 模板 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- create_job_trigger(project_id=PROVIDE_PROJECT_ID, job_trigger=None, trigger_id=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
创建一个作业触发器,用于按照设定的计划运行 DLP 操作,例如扫描存储中的敏感信息。
- 参数:
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
job_trigger (dict | google.cloud.dlp_v2.types.JobTrigger | None) – (可选) 要创建的作业触发器。
trigger_id (str | None) – (可选) 作业触发器 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- create_stored_info_type(organization_id=None, project_id=PROVIDE_PROJECT_ID, config=None, stored_info_type_id=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
创建一个预建的存储信息类型,用于检查。
- 参数:
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
config (dict | google.cloud.dlp_v2.types.StoredInfoTypeConfig | None) – (可选) 存储信息类型的配置。
stored_info_type_id (str | None) – (可选) 存储信息类型 ID。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- deidentify_content(project_id=PROVIDE_PROJECT_ID, deidentify_config=None, inspect_config=None, item=None, inspect_template_name=None, deidentify_template_name=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
从内容项中去标识化潜在的敏感信息;限制输入大小和输出大小。
- 参数:
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
deidentify_config (dict | google.cloud.dlp_v2.types.DeidentifyConfig | None) – (可选) 内容项去标识化的配置。此处指定的项将覆盖 deidentify_template_name 参数引用的模板。
inspect_config (dict | google.cloud.dlp_v2.types.InspectConfig | None) – (可选) 检查器的配置。此处指定的项将覆盖 inspect_template_name 参数引用的模板。
item (dict | google.cloud.dlp_v2.types.ContentItem | None) – (可选) 要去标识化的项。将被视为文本。
inspect_template_name (str | None) – (可选) 要使用的可选模板。inspect_config 中直接指定的任何配置都将覆盖模板中设置的配置。
deidentify_template_name (str | None) – (可选) 要使用的可选模板。deidentify_config 中直接指定的任何配置都将覆盖模板中设置的配置。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- delete_deidentify_template(template_id, organization_id=None, project_id=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
删除一个去标识化模板。
- 参数:
template_id – 要删除的去标识化模板的 ID。
organization_id – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
retry – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata – (可选) 提供给方法的附加元数据。
- delete_dlp_job(dlp_job_id, project_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
删除一个长时间运行的 DLP 作业。
此方法表明客户端不再关心 DLP 作业结果。如果可能,作业将被取消。
- 参数:
dlp_job_id (str) – 要取消的 DLP 作业资源的 ID。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- delete_inspect_template(template_id, organization_id=None, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]¶
删除一个检查模板。
- 参数:
template_id (str) – 要删除的检查模板的 ID。
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- delete_job_trigger(job_trigger_id, project_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
删除一个作业触发器。
- 参数:
job_trigger_id (str) – 要删除的 DLP 作业触发器的 ID。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- delete_stored_info_type(stored_info_type_id, organization_id=None, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]¶
删除一个存储信息类型。
- 参数:
stored_info_type_id (str) – 要删除的存储信息类型的 ID。
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- get_deidentify_template(template_id, organization_id=None, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]¶
获取一个去标识化模板。
- 参数:
template_id (str) – 要读取的去标识化模板的 ID。
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- get_dlp_job(dlp_job_id, project_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
获取长时间运行的 DLP 作业的最新状态。
- 参数:
dlp_job_id (str) – 要读取的 DLP 作业资源的 ID。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- get_inspect_template(template_id, organization_id=None, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]¶
获取一个检查模板。
- 参数:
template_id (str) – 要读取的检查模板的 ID。
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- get_job_trigger(job_trigger_id, project_id, retry=DEFAULT, timeout=None, metadata=())[source]¶
获取 DLP 作业触发器。
- 参数:
job_trigger_id (str) – 要读取的 DLP 作业触发器的 ID。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- get_stored_info_type(stored_info_type_id, organization_id=None, project_id=PROVIDE_PROJECT_ID, retry=DEFAULT, timeout=None, metadata=())[source]¶
获取存储的信息类型。
- 参数:
stored_info_type_id (str) – 要读取的存储的信息类型的 ID。
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- inspect_content(project_id, inspect_config=None, item=None, inspect_template_name=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
在内容中查找潜在的敏感信息;限制输入大小、处理时间和输出大小。
- 参数:
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
inspect_config (dict | google.cloud.dlp_v2.types.InspectConfig | None) – (可选) 检查器的配置。此处指定的项将覆盖 inspect_template_name 参数引用的模板。
item (dict | google.cloud.dlp_v2.types.ContentItem | None) – (可选) 要去标识化的项。将被视为文本。
inspect_template_name (str | None) – (可选) 要使用的可选模板。inspect_config 中直接指定的任何配置都将覆盖模板中设置的配置。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- list_deidentify_templates(organization_id=None, project_id=PROVIDE_PROJECT_ID, page_size=None, order_by=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
列出去标识模板。
- 参数:
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
page_size (int | None) – (可选)底层 API 响应中包含的最大资源数量。
order_by (str | None) – (可选)用于排序的可选逗号分隔字段列表,后跟 asc 或 desc 后缀。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- list_dlp_jobs(project_id, results_filter=None, page_size=None, job_type=None, order_by=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
列出请求中与指定过滤器匹配的 DLP 作业。
- 参数:
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
results_filter (str | None) – (可选)用于指定结果子集的过滤器。
page_size (int | None) – (可选)底层 API 响应中包含的最大资源数量。
job_type (str | None) – (可选)作业类型。
order_by (str | None) – (可选)用于排序的可选逗号分隔字段列表,后跟 asc 或 desc 后缀。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- list_info_types(language_code=None, results_filter=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
返回 DLP API 支持的敏感信息类型列表。
- 参数:
language_code (str | None) – (可选)用于本地化信息类型友好名称的可选 BCP-47 语言代码。如果省略,或者本地化字符串不可用,则将返回 en-US 字符串。
results_filter (str | None) – (可选)用于指定结果子集的过滤器。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- list_inspect_templates(organization_id=None, project_id=PROVIDE_PROJECT_ID, page_size=None, order_by=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
列出检查模板。
- 参数:
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
page_size (int | None) – (可选)底层 API 响应中包含的最大资源数量。
order_by (str | None) – (可选)用于排序的可选逗号分隔字段列表,后跟 asc 或 desc 后缀。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- list_job_triggers(project_id, page_size=None, order_by=None, results_filter=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
列出作业触发器。
- 参数:
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
page_size (int | None) – (可选)底层 API 响应中包含的最大资源数量。
order_by (str | None) – (可选)用于排序的可选逗号分隔字段列表,后跟 asc 或 desc 后缀。
results_filter (str | None) – (可选)用于指定结果子集的过滤器。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- list_stored_info_types(organization_id=None, project_id=PROVIDE_PROJECT_ID, page_size=None, order_by=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
列出存储的信息类型。
- 参数:
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
page_size (int | None) – (可选)底层 API 响应中包含的最大资源数量。
order_by (str | None) – (可选)用于排序的可选逗号分隔字段列表,后跟 asc 或 desc 后缀。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- redact_image(project_id, inspect_config=None, image_redaction_configs=None, include_findings=None, byte_item=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
从图像中修订潜在的敏感信息;限制输入大小、处理时间和输出大小。
- 参数:
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
inspect_config (dict | google.cloud.dlp_v2.types.InspectConfig | None) – (可选) 检查器的配置。此处指定的项将覆盖 inspect_template_name 参数引用的模板。
image_redaction_configs (None | list[dict] | list[google.cloud.dlp_v2.types.RedactImageRequest.ImageRedactionConfig]) – (可选)用于指定要从图像中修订的内容的配置。list[google.cloud.dlp_v2.types.RedactImageRequest.ImageRedactionConfig]
include_findings (bool | None) – (可选)响应是否应包含发现结果以及已修订的图像。
byte_item (dict | google.cloud.dlp_v2.types.ByteContentItem | None) – (可选)内容必须是 PNG、JPEG、SVG 或 BMP 格式。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- reidentify_content(project_id, reidentify_config=None, inspect_config=None, item=None, inspect_template_name=None, reidentify_template_name=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
重新识别已去标识化的内容。
- 参数:
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
reidentify_config (dict | google.cloud.dlp_v2.types.DeidentifyConfig | None) – (可选)用于重新识别内容项的配置。
inspect_config (dict | google.cloud.dlp_v2.types.InspectConfig | None) – (可选)检查器配置。
item (dict | google.cloud.dlp_v2.types.ContentItem | None) – (可选)要重新识别的项。将被视为文本处理。
inspect_template_name (str | None) – (可选) 要使用的可选模板。inspect_config 中直接指定的任何配置都将覆盖模板中设置的配置。
reidentify_template_name (str | None) – (可选)要使用的可选模板。引用去标识模板的一个实例。在 reidentify_config 或 inspect_config 中直接指定的任何配置将覆盖模板中设置的配置。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- update_deidentify_template(template_id, organization_id=None, project_id=PROVIDE_PROJECT_ID, deidentify_template=None, update_mask=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
更新去标识模板。
- 参数:
template_id (str) – 要更新的去标识模板的 ID。
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
deidentify_template (dict | google.cloud.dlp_v2.types.DeidentifyTemplate | None) – 新的去标识模板值。
update_mask (dict | google.protobuf.field_mask_pb2.FieldMask | None) – 用于控制更新哪些字段的掩码。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- update_inspect_template(template_id, organization_id=None, project_id=PROVIDE_PROJECT_ID, inspect_template=None, update_mask=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
更新检查模板。
- 参数:
template_id (str) – 要更新的检查模板的 ID。
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
inspect_template (dict | google.cloud.dlp_v2.types.InspectTemplate | None) – 新的检查模板值。
update_mask (dict | google.protobuf.field_mask_pb2.FieldMask | None) – 用于控制更新哪些字段的掩码。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- update_job_trigger(job_trigger_id, project_id, job_trigger=None, update_mask=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
更新作业触发器。
- 参数:
job_trigger_id (str) – 要更新的 DLP 作业触发器的 ID。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。如果设置为 None 或缺失,将使用 Google Cloud 连接中的默认 project_id。
job_trigger (dict | google.cloud.dlp_v2.types.JobTrigger | None) – 新的作业触发器值。
update_mask (dict | google.protobuf.field_mask_pb2.FieldMask | None) – 用于控制更新哪些字段的掩码。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。
- update_stored_info_type(stored_info_type_id, organization_id=None, project_id=PROVIDE_PROJECT_ID, config=None, update_mask=None, retry=DEFAULT, timeout=None, metadata=())[source]¶
通过创建新版本来更新存储的信息类型。
- 参数:
stored_info_type_id (str) – 要更新的存储的信息类型的 ID。
organization_id (str | None) – (可选) 组织 ID。如果父资源是组织,则必须设置此字段。
project_id (str) – (可选) DLP 实例所在的 Google Cloud 项目 ID。仅当父资源是项目而不是组织时才设置此字段。
config (dict | google.cloud.dlp_v2.types.StoredInfoTypeConfig | None) – 存储的信息类型的更新配置。如果未提供,将使用现有配置创建存储的信息类型的新版本。
update_mask (dict | google.protobuf.field_mask_pb2.FieldMask | None) – 用于控制更新哪些字段的掩码。
retry (google.api_core.retry.Retry | google.api_core.gapic_v1.method._MethodDefault) – (可选) 用于重试请求的重试对象。如果指定为 None,则不会重试请求。
timeout (float | None) – (可选) 等待请求完成的时间量(以秒为单位)。请注意,如果指定了 retry,则 timeout 应用于每个单独的尝试。
metadata (collections.abc.Sequence[tuple[str, str]]) – (可选) 提供给方法的附加元数据。