适用于 Cloud Storage 的连接器

定义用于在工作流内访问 Cloud Storage 的内置函数的 Workflows 连接器。

包含此代码示例的文档页面

如需查看上下文中使用的代码示例,请参阅以下文档:

代码示例

YAML

# This workflow demonstrates how to use the Cloud Storage connector.
# The workflow creates a Cloud Storage bucket and then deletes it.
# Expected successful output: "SUCCESS"

- init:
    assign:
    - project_id: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
    - bucket_name: "dummy-bucket"
- create_bucket:
    call: googleapis.storage.v1.buckets.insert
    args:
      project: ${project_id}
      body:
        name: ${bucket_name}
- get_bucket:
    call: googleapis.storage.v1.buckets.get
    args:
      bucket: ${bucket_name}
- delete_bucket:
    call: googleapis.storage.v1.buckets.delete
    args:
      bucket: ${bucket_name}
- the_end:
    return: "SUCCESS"

后续步骤

如需搜索和过滤其他 Google Cloud 产品的代码示例,请参阅 Google Cloud 示例浏览器