插入新图像时将SourceImage作为Google存储桶链接

时间:2018-07-30 06:23:05

标签: google-cloud-platform google-cloud-storage google-compute-engine

images.insert时提供Google存储映像链接的正确格式应该是什么? 位于GS Bucket上的映像文件为*.tar.gz。 使用api images.insert(body=body,project=project)在python中使用Google客户端库创建新图像

我的身体配置如下:

body = { "name":"test", "sourceImage":"https://console.cloud.google.com/storage/browser/[BUCKET]/[IMAGEFILE]",}

过程失败,并出现以下错误:

googleapiclient.errors.HttpError: <HttpError 400 when requesting  returned "Invalid value for field 'resource.sourceImage': 'https://storag
e.cloud.google.com/[BUCKET]/[IMAGEFILE]'. The URL is malformed.">

1 个答案:

答案 0 :(得分:1)

要从Google存储空间访问图片,请改用“rawDisk”。这是一个示例:

62e90394-69f5-4237-9190-012177145e10

其中[bucket]是您的存储桶的名称,[imagefile] = * .tar.gz