我正在尝试通过 terraform 测试设置 GCP Cloud Scheduler 作业,并在尝试通过 API 创建时发现问题。我还在此页面上测试 API:projects.locations.jobs/create。我看到的错误是围绕一个无效的论点:
{
"error": {
"code": 400,
"message": "Job name must be formatted: \"projects/\u003cPROJECT_ID\u003e/locations/\u003cLOCATION_ID\u003e/jobs/\u003cJOB_ID\u003e\".",
"status": "INVALID_ARGUMENT"
}
}
然后我修改以适应该格式并看到此错误:
{
"error": {
"code": 400,
"message": "Resource name should start with \"/projects/\u003cPROJECT_ID\u003e/\"",
"status": "INVALID_ARGUMENT"
}
}
请求正文如下所示:
{
"name": "projects/<my-project-id>/locations/us-central1/jobs/snapshots",
"pubsubTarget": {
"topicName": "disk-snapshot-function-trigger",
"attributes": {
"num_backups": "5",
"project": "<my-project-id>"
}
},
"schedule": "0 19 * * *",
"timeZone": "America/Los_Angeles"
}
真的没有获胜,所有请求都会得到 ERROR 400。