如何为GCP云调度程序作业添加属性?

问题描述

我创建了一个名为“ my_job”的云调度程序作业,每分钟将消息发送到一个主题“ my_topic”,该主题正在按预期运行。现在,我想在邮件中添加一些属性,以便使用云功能检索它们。这就是为什么我执行以下命令行的原因:
gcloud scheduler jobs update pubsub my_job --update-attributes=["name"="test","limit"="1000"]

我还尝试通过以下命令行直接创建作业:
gcloud beta scheduler jobs create pubsub my_job_2 --schedule "*/1 * * * *" --topic my_topic --message-body="Hello" --attributes name=test,limit=1000

在两种情况下,控制台都会返回:

enter image description here

但是我没有任何网络连接问题。 我的IAM角色是项目所有者。

有什么主意吗?

解决方法

这只是暂时现象,您所需要的只是检查互联网连接并再次尝试命令,如上所述,您可以检查Google Cloud Services状态板。很高兴得知此问题已解决。

,

这表示从计算机到数据中心或Google一侧的(临时)网络/握手错误。通常,当命令之前起作用时,它将在几分钟后消失。您可以尝试另一个命令,该命令应该检索一些结果,以查看问题是否持续存在。

gcloud scheduler jobs list

测试连接性问题的另一种方法是运行SDK的诊断测试:

gcloud info --run-diagnostics

Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.                                                                                                                                                                                                                                                                     
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).

Property diagnostic detects issues that may be caused by properties.
Checking hidden properties...done.                                                                                                                                                                                                                                                                      
Hidden Property Check passed.
Property diagnostic passed (1/1 checks passed).

否则,如果问题仍然存在,则也可能意味着Google的一项服务(在特定地区)不可用。为了对此进行检查,Google邀请了status board来为其提供所有服务。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...