我正在尝试使用 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。
有谁知道这里发生了什么?
最佳答案
至少不久前创建一个项目(手动)会自动创建与之关联的 GAE 应用程序资源。从您引用的文档中:
If you choose to use an existing GCP project, you must ensure that the project does not already contain the
Application
resource because projects support only a single App Engine application. To check if your GCP project already contains theApplication
resource, you can use either the apps.get method or run thegcloud app describe
command.
关于google-app-engine - 无法使用 Web API 在 Google App Engine 中创建应用程序。错误 : 409 - This application already exists and cannot be re-created,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52111214/