I am using Java client and I would like to list all projects that user has access to (as it appears in GCP console).
Do you know solution using ResourceManager but not with parent or without granting too many privileges?
Apparently the replacement for list
is search
method with empty query string:
ProjectsSettings projectsSettings = ProjectsSettings.newBuilder().build();
ProjectsClient projectsClient = ProjectsClient.create(projectsSettings);
ProjectsClient.SearchProjectsPagedResponse searchProjectsPagedResponse = projectsClient.searchProjects("");
for (Project project : searchProjectsPagedResponse.iterateAll()) {
System.out.println(project.getDisplayName());
};
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.