无法使用Web API在Google App Engine中创建应用。错误:409 - 此应用程序已存在且无法重新创建

问题描述 投票:1回答:1

我正在尝试使用Google Cloud Web API在App Engine中创建应用程序,如官方文档(https://cloud.google.com/appengine/docs/admin-api/creating-an-application)中所述。我用:

当我使用node-fetch进行HTTP POST时如下:

fetch('https://appengine.googleapis.com/v1/apps', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        Authorization: `Bearer ${token}`
    },
    body: JSON.stringify({ 
        id: projectId,
        locationId:'australia-southeast1'
    })
})

然后我收到此错误消息:

{
 "code": 409,
 "message": "This application already exists and cannot be re-created.",
 "status": "ALREADY_EXISTS"
}

这真的很奇怪,因为我的项目ID还没有定义App Engine。

有谁知道这里发生了什么?

google-app-engine google-apis-explorer
1个回答
2
投票

至少在不久前创建一个项目(手动)自动创建与之关联的GAE应用程序资源。从您引用的文档:

如果选择使用现有GCP项目,则必须确保项目尚未包含Application资源,因为项目仅支持单个App Engine应用程序。要检查您的GCP项目是否已包含Application资源,您可以使用apps.get method或运行gcloud app describe命令。

© www.soinside.com 2019 - 2024. All rights reserved.