英文:
Unable to list tag bindings for a GCP resource
问题
我正在尝试使用 Python 客户端库 resourcemanager_v3.TagBindingsClient
列出计算实例的标签绑定,但它要求一个位置参数,而在文档中提供的请求参数中没有这个参数。我以为如果我提供实例的完整 URL,它会将实例的位置作为位置参数,但结果仍然出现了相同的错误。这是我的代码:
client = resourcemanager_v3.TagBindingsClient()
request = resourcemanager_v3.ListEffectiveTagsRequest(
parent = "//compute.googleapis.com/projects/{projectId}/zones/{zone}/instances/{instanceId}"
)
page_result = client.list_effective_tags(request = request)
for response in page_result:
print(response)
我检查了列出标签绑定的 REST API,但它也没有位置参数。是否有解决方法?
英文:
I'm trying to list tag bindings for a compute instance using python client libraries resourcemanager_v3.TagBindingsClient
but it is asking for a location parameter, which is not there in the request parameters provided in the docs. I thought that It will take the location of the instance as the location parameter if I provide the full URL of the instance but it results in the same error. Here's my code
client = resourcemanager_v3.TagBindingsClient()
request = resourcemanager_v3.ListEffectiveTagsRequest(
parent = "//compute.googleapis.com/projects/{projectId}/zones/{zone}/instances/{instanceId}"
)
page_result = client.list_effective_tags(request = request)
for response in page_result:
print(response)
I checked REST API for list tag bindings but it doesn't have location argument as well. Is there any solution for this?
答案1
得分: 1
很抱歉,对于 list_effective_tags
函数,没有位置参数。这是 Terraform 中的一个问题,他们在 Terraform 中已经解决了这个问题,但是在 Python 客户端库中尚未解决。
英文:
Unfortunately there is no location parameter for list_effective_tags
. This was an issue in terraform and they solved it but not on python client libraries
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论