如何在云功能中列出GCP项目标签?

发布于 2025-02-14 00:03:32 字数 267 浏览 4 评论 0原文

下面的文档具有访问各种GCP资源但没有GCP项目的详细信息。我有兴趣使用.NET API列出GCP项目的所有标签。

https://cloud.google.com/dotnet/docs/docs/reference

链接将有所帮助

Below documentation has details for accessing various GCP resources but not GCP project. I am interested in listing all the labels of a GCP project using .net API.

https://cloud.google.com/dotnet/docs/reference

Any references/links will be helpful

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

赠意 2025-02-21 00:03:32

找到了解决方案。

        Google.Cloud.ResourceManager.V3.ProjectsClient projectsClient = await Google.Cloud.ResourceManager.V3.ProjectsClient.CreateAsync();
        Google.Cloud.ResourceManager.V3.Project response = await projectsClient.GetProjectAsync("projects/83446985491");
        //response.Labels;

来源:
https://cloud.google.com/dotnet/docs/reference/google.cloud.resourcemanager.v3/latest/google.cloud.resourcemanager.v3.projects.projects.projects.projects.projects.projectsclient

Found the solution.

        Google.Cloud.ResourceManager.V3.ProjectsClient projectsClient = await Google.Cloud.ResourceManager.V3.ProjectsClient.CreateAsync();
        Google.Cloud.ResourceManager.V3.Project response = await projectsClient.GetProjectAsync("projects/83446985491");
        //response.Labels;

Source:
https://cloud.google.com/dotnet/docs/reference/Google.Cloud.ResourceManager.V3/latest/Google.Cloud.ResourceManager.V3.Projects.ProjectsClient

东走西顾 2025-02-21 00:03:32

如此 so thread 当前,目前无法列出 GCP项目。

此外,还有一个现有功能请求,您可以 star 此功能请求并在线程中添加。随着更多用户要求支持它,这将引起人们对请求的更多关注,但是不能保证它何时实施。

As mentioned in this SO thread, Currently, it's not possible to list all labels within a GCP project.

In Addition, There is an existing feature request, you can star this feature request and add Me too in the thread. This will bring more attention to the request as more users request support for it but there's no guarantee when it will be implemented.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文