【发布时间】:2018-09-07 12:19:59
【问题描述】:
我在Supported Resource Types 的列表中看到,Google Cloud Deployment Manager 至少对storage.v1.object 类型有一些支持。我希望这使我能够根据我的 DM 模板中的数据将文件写入 GCS。不过,我被困在如何以 DM 喜欢的方式组合资源的属性上。当我使用以下模板时:
resources:
- name: foo.txt
type: storage.v1.object
properties:
bucket: my-bucket
name: foo.txt
uploadType: media
我从gcloud deployment-manager 收到以下错误:
ERROR: (gcloud.deployment-manager.deployments.update) Error in Operation [operation-1522258413242-5687c67fa4691-c89f17c6-c0b96018]: errors:
- code: RESOURCE_ERROR
location: /deployments/test-serviceaccount/resources/foo.txt
message: '{"ResourceType":"storage.v1.object","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"errors":[{"domain":"global","message":"Upload
requests must include an uploadType URL parameter and a URL path beginning with
/upload/","reason":"wrongUrlForUpload","extendedHelp":"https://cloud.google.com/storage/docs/json_api/v1/how-tos/upload"}],"message":"Upload
requests must include an uploadType URL parameter and a URL path beginning with
/upload/","statusMessage":"Bad Request","requestPath":"https://www.googleapis.com/storage/v1/b/my-bucket/o","httpMethod":"POST"}}'
我在这里缺少什么?如何在 Deployment Manager 模板中构造有效的 storage.v1.object 资源?
【问题讨论】:
标签: google-cloud-platform google-cloud-storage google-deployment-manager