首页 > 解决方案 > 有没有办法为推送交付类型的 Google Pub/Sub 订阅设置标签?

问题描述

我想在(推送)订阅上设置标签,以便能够区分每项服务的成本。

当我尝试在控制台上添加标签时,我收到消息“无法保存标签”。然后我尝试使用 HTML 元标记验证域,但收到以下错误消息。“INVALID_ARGUMENT:提供的 HTTP URL 未在订阅的父项目中注册。”

有没有办法以这种格式验证域名 https://{hash}-dot-{hash}.appspot.com/_ah/push-handlers/pubsub/projects/{project-id}/topics/{topic -id}?pubsub_trigger=true ?

我可以使用 HTML 元标记验证域,该标记的 URL 格式 为 https://us-central1-.cloudfunctions.net/

我只是想知道我是否真的需要验证推送订阅端点域才能添加标签来推送订阅?

gcloud pubsub subscriptions update subscription_name --update-labels env=dev --push-endpoint=https://hashA-dot-hashB-tp.appspot.com/_ah/push-handlers/pubsub/projects/project_id/topics/topic_id?pubsub_trigger=true

标签: python-3.xgoogle-cloud-functionsgoogle-cloud-pubsub

解决方案


您尝试修改的此订阅由 Cloud Functions 管理,这意味着您将无法设置其标签。


推荐阅读