@@ -14,6 +14,7 @@ This client supports the following Google Cloud Platform services:
1414
1515- [ Google Cloud Datastore] (#google-cloud-datastore)
1616- [ Google Cloud Storage] (#google-cloud-storage)
17+ - [ Google Cloud Resource Manager] (#google-cloud-resource-manager)
1718
1819> Note: This client is a work-in-progress, and may occasionally
1920> make backwards-incompatible changes.
@@ -182,6 +183,37 @@ if (blob == null) {
182183}
183184` ` `
184185
186+ Google Cloud Resource Manager
187+ ----------------------
188+
189+ - [API Documentation][resourcemanager-api]
190+ - [Official Documentation][cloud-resourcemanager-docs]
191+
192+ # ### Preview
193+
194+ Here is a code snippet showing a simple usage example. Note that you must supply Google SDK credentials for this service, not other forms of authentication listed in the [Authentication section](# authentication).
195+
196+ ` ` ` java
197+ import com.google.gcloud.resourcemanager.ProjectInfo;
198+ import com.google.gcloud.resourcemanager.ResourceManager;
199+ import com.google.gcloud.resourcemanager.ResourceManagerOptions;
200+
201+ import java.util.Iterator;
202+
203+ ResourceManager resourceManager = ResourceManagerOptions.defaultInstance().service ();
204+ ProjectInfo myProject = resourceManager.get(" some-project-id" ); // Use an existing project' s ID
205+ ProjectInfo newProjectInfo = resourceManager.replace(myProject.toBuilder()
206+ .addLabel("launch-status", "in-development").build());
207+ System.out.println("Updated the labels of project " + newProjectInfo.projectId()
208+ + " to be " + newProjectInfo.labels());
209+ // List all the projects you have permission to view.
210+ Iterator<ProjectInfo> projectIterator = resourceManager.list().iterateAll();
211+ System.out.println("Projects I can view:");
212+ while (projectIterator.hasNext()) {
213+ System.out.println(projectIterator.next().projectId());
214+ }
215+ ```
216+
185217Troubleshooting
186218---------------
187219
@@ -241,3 +273,6 @@ Apache 2.0 - See [LICENSE] for more information.
241273[cloud-storage-create-bucket]: https://cloud.google.com/storage/docs/cloud-console#_creatingbuckets
242274[cloud-storage-activation]: https://cloud.google.com/storage/docs/signup
243275[storage-api]: http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html? com/google/gcloud/storage/package-summary.html
276+
277+ [resourcemanager-api]:http://googlecloudplatform.github.io/gcloud-java/apidocs/index.html? com/google/gcloud/resourcemanager/package-summary.html
278+ [cloud-resourcemanager-docs]:https://cloud.google.com/resource-manager/
0 commit comments