11Python Client for Google Cloud Resource Manager
22===============================================
33
4- |alpha | |pypi | |versions |
4+ |beta | |pypi | |versions |
55
66`Google Cloud Resource Manager `_ API provides methods that you can use
77to programmatically manage your projects in the Google Cloud Platform.
88With this API, you can do the following:
99
10- - Get a list of all projects associated with an account
11- - Create new projects
12- - Update existing projects
13- - Delete projects
14- - Undelete, or recover, projects that you don't want to delete
15-
1610- `Client Library Documentation `_
1711- `Product Documentation `_
1812
19-
20- .. |alpha | image :: https://img.shields.io/badge/support-alpha-orange.svg
21- :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#alpha-support
13+ .. |beta | image :: https://img.shields.io/badge/support-beta-orange.svg
14+ :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#beta-support
2215.. |pypi | image :: https://img.shields.io/pypi/v/google-cloud-resource-manager.svg
2316 :target: https://pypi.org/project/google-cloud-resource-manager/
2417.. |versions | image :: https://img.shields.io/pypi/pyversions/google-cloud-resource-manager.svg
2518 :target: https://pypi.org/project/google-cloud-resource-manager/
26- .. _Google Cloud Resource Manager : https://cloud.google.com/resource-manager/
19+ .. _Google Cloud Resource Manager : https://cloud.google.com/resource-manager
2720.. _Client Library Documentation : https://googleapis.dev/python/cloudresourcemanager/latest
28- .. _Product Documentation : https://cloud.google.com/resource-manager/docs/
29-
30- .. note ::
31-
32- Don't forget to look at the `Authentication `_ section below.
33- It's slightly different from the rest of this library.
21+ .. _Product Documentation : https://cloud.google.com/resource-manager
3422
3523Quick Start
3624-----------
@@ -39,11 +27,13 @@ In order to use this library, you first need to go through the following steps:
3927
40281. `Select or create a Cloud Platform project. `_
41292. `Enable billing for your project. `_
42- 3. `Enable the Google Cloud Resource Manager API. `_
30+ 3. `Enable the Resource Manager API. `_
31+ 4. `Setup Authentication. `_
4332
4433.. _Select or create a Cloud Platform project. : https://console.cloud.google.com/project
4534.. _Enable billing for your project. : https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
46- .. _Enable the Google Cloud Resource Manager API. : https://cloud.google.com/resource-manager
35+ .. _Enable the Resource Manager API. : https://cloud.google.com/resource-manager/docs/quickstart-organizations#before-you-begin
36+ .. _Setup Authentication. : https://googleapis.dev/python/google-api-core/latest/auth.html
4737
4838Installation
4939~~~~~~~~~~~~
@@ -59,15 +49,6 @@ dependencies.
5949.. _`virtualenv` : https://virtualenv.pypa.io/en/latest/
6050
6151
62- Supported Python Versions
63- ^^^^^^^^^^^^^^^^^^^^^^^^^
64- Python >= 3.5
65-
66- Deprecated Python Versions
67- ^^^^^^^^^^^^^^^^^^^^^^^^^^
68- Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
69-
70-
7152Mac/Linux
7253^^^^^^^^^
7354
@@ -89,71 +70,15 @@ Windows
8970 <your-env>\Scripts\activate
9071 <your-env>\Scripts\pip.exe install google-cloud-resource-manager
9172
73+ Next Steps
74+ ~~~~~~~~~~
9275
93- Authentication
94- ~~~~~~~~~~~~~~
95-
96- Unlike the other APIs, the Resource Manager API is focused on managing your
97- various projects inside Google Cloud Platform. What this means (currently, as
98- of August 2015) is that you can't use a Service Account to work with some
99- parts of this API (for example, creating projects).
100-
101- The reason is actually pretty simple: if your API call is trying to do
102- something like create a project, what project's Service Account can you use?
103- Currently none.
104-
105- This means that for this API you should always use the credentials
106- provided by the `Google Cloud SDK `_, which you can get by running
107- ``gcloud auth login ``.
108-
109- .. _Google Cloud SDK : http://cloud.google.com/sdk
110-
111- Once you run that command, ``google-cloud-python `` will automatically pick up
112- the credentials, and you can use the "automatic discovery" feature of the
113- library.
114-
115- Start by authenticating:
116-
117- .. code-block :: bash
118-
119- $ gcloud auth application-default login
120-
121- And then simply create a client:
122-
123- .. code-block :: python
124-
125- from google.cloud import resource_manager
126- client = resource_manager.Client()
127-
128- Using the API
129- -------------
130-
131- Here's a quick example of the full life-cycle:
132-
133- .. code-block :: python
134-
135- from google.cloud import resource_manager
136-
137- client = resource_manager.Client()
138-
139- # List all projects you have access to
140- for project in client.list_projects():
141- print (project)
142-
143- # Create a new project
144- new_project = client.new_project(
145- ' your-project-id-here' , name = ' My new project' )
146- new_project.create()
147-
148- # Update an existing project
149- project = client.fetch_project(' my-existing-project' )
150- project.name = ' Modified name'
151- project.update()
152-
153- # Delete a project
154- project = client.new_project(' my-existing-project' )
155- project.delete()
76+ - Read the `Client Library Documentation `_ for Resource Manager
77+ to see other available methods on the client.
78+ - Read the `Resource Manager Product documentation `_ to learn
79+ more about the product and see How-to Guides.
80+ - View this `README `_ to see the full list of Cloud
81+ APIs that we cover.
15682
157- # Undelete a project
158- project = client.new_project(' my-existing-project' )
159- project.undelete()
83+ .. _Resource Manager Product documentation : https://cloud.google.com/resource-manager/docs
84+ .. _README : https://github.com/googleapis/google-cloud-python/blob/master/README.rst
0 commit comments