将标签应用于Cloud SQL,BigQuery和PubSub

问题描述

我们需要在以下GCP Services加上标签

      Cloud sql,BigQuery and PubSub

跨越多个Bigquery,Pubsub的{​​{1}}服务数量将超过一千。我们将使用GCP projects下面的Python方法利用PATCH自动化,将标签一次性应用到所有资源。

APIs

标签应用于 https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets/patch https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/patch https://cloud.google.com/sql/docs/MysqL/admin-api/rest/v1beta4/databases/patch 会对Cloud sql,BigQuery and PubSub产生任何影响。我们先前将GCP resources应用于labels时,在应用标签时有一个对应的CLoud Run and Cloud functions。我们假设应用deployment and revision/version change会对Cloud sql,BigQuery and PubSub服务产生任何影响。对于labels,我们将消息推送到某些PubSub,然后使用Topic'方法应用标签。之后,我们使用API PATCH提取了消息,并成功检索了消息。

subscriptions

请建议在应用 gcloud pubsub topics publish storagecheck --message "Hello2" gcloud pubsub subscriptions pull stcheck --auto-ack 时对Cloud sql,BigQuery and PubSub有何影响

解决方法

粘贴标签不会对服务造成影响。

要考虑的次要事项是可以应用于特定实例的数字标签,到今天为止,我们最多可以为每个实例分配64个标签。

参考:

https://cloud.google.com/sql/docs/mysql/label-instance

https://cloud.google.com/pubsub/docs/labels

https://cloud.google.com/bigquery/docs/labels-intro