Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 8fa2ec4

Browse files
committed
feat!: add v3
1 parent de1d78b commit 8fa2ec4

File tree

100 files changed

+42133
-1534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+42133
-1534
lines changed

.github/.OwlBot.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@
1515
docker:
1616
image: gcr.io/repo-automation-bots/owlbot-python:latest
1717

18+
deep-remove-regex:
19+
- /owl-bot-staging
20+
21+
deep-copy-regex:
22+
- source: /google/cloud/resourcemanager/(v.*)/.*-py/(.*)
23+
dest: /owl-bot-staging/$1/$2
24+
25+
begin-after-commit-hash: 40278112d2922ec917140dcb5cc6d5ef2923aeb2

.repo-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"product_documentation": "https://cloud.google.com/resource-manager",
55
"client_documentation": "https://googleapis.dev/python/cloudresourcemanager/latest",
66
"issue_tracker": "https://issuetracker.google.com/savedsearches/559757",
7-
"release_level": "alpha",
7+
"release_level": "beta",
88
"language": "python",
99
"library_type": "GAPIC_MANUAL",
1010
"repo": "googleapis/python-resource-manager",

README.rst

Lines changed: 19 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
11
Python 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
77
to programmatically manage your projects in the Google Cloud Platform.
88
With 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

3523
Quick Start
3624
-----------
@@ -39,11 +27,13 @@ In order to use this library, you first need to go through the following steps:
3927

4028
1. `Select or create a Cloud Platform project.`_
4129
2. `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

4838
Installation
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-
7152
Mac/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

docs/README.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/README.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
Python Client for Google Cloud Resource Manager
2+
===============================================
3+
4+
|beta| |pypi| |versions|
5+
6+
`Google Cloud Resource Manager`_ API provides methods that you can use
7+
to programmatically manage your projects in the Google Cloud Platform.
8+
With this API, you can do the following:
9+
10+
- `Client Library Documentation`_
11+
- `Product Documentation`_
12+
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
15+
.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-resource-manager.svg
16+
:target: https://pypi.org/project/google-cloud-resource-manager/
17+
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-resource-manager.svg
18+
:target: https://pypi.org/project/google-cloud-resource-manager/
19+
.. _Google Cloud Resource Manager: https://cloud.google.com/resource-manager
20+
.. _Client Library Documentation: https://googleapis.dev/python/cloudresourcemanager/latest
21+
.. _Product Documentation: https://cloud.google.com/resource-manager
22+
23+
Quick Start
24+
-----------
25+
26+
In order to use this library, you first need to go through the following steps:
27+
28+
1. `Select or create a Cloud Platform project.`_
29+
2. `Enable billing for your project.`_
30+
3. `Enable the Resource Manager API.`_
31+
4. `Setup Authentication.`_
32+
33+
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
34+
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
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
37+
38+
Installation
39+
~~~~~~~~~~~~
40+
41+
Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to
42+
create isolated Python environments. The basic problem it addresses is one of
43+
dependencies and versions, and indirectly permissions.
44+
45+
With `virtualenv`_, it's possible to install this library without needing system
46+
install permissions, and without clashing with the installed system
47+
dependencies.
48+
49+
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
50+
51+
52+
Mac/Linux
53+
^^^^^^^^^
54+
55+
.. code-block:: console
56+
57+
pip install virtualenv
58+
virtualenv <your-env>
59+
source <your-env>/bin/activate
60+
<your-env>/bin/pip install google-cloud-resource-manager
61+
62+
63+
Windows
64+
^^^^^^^
65+
66+
.. code-block:: console
67+
68+
pip install virtualenv
69+
virtualenv <your-env>
70+
<your-env>\Scripts\activate
71+
<your-env>\Scripts\pip.exe install google-cloud-resource-manager
72+
73+
Next Steps
74+
~~~~~~~~~~
75+
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.
82+
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

docs/client.rst

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/index.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
.. include:: README.rst
22

3+
.. include:: multiprocessing.rst
34

4-
API Reference
5+
6+
Api Reference
57
-------------
68
.. toctree::
7-
:maxdepth: 2
9+
:maxdepth: 2
810

9-
client
10-
project
11+
resourcemanager_v3/services
12+
resourcemanager_v3/types
1113

1214

1315
Changelog
@@ -16,6 +18,6 @@ Changelog
1618
For a list of all ``google-cloud-resource-manager`` releases:
1719

1820
.. toctree::
19-
:maxdepth: 2
21+
:maxdepth: 2
2022

21-
changelog
23+
changelog

docs/multiprocessing.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. note::
2+
3+
Because this client uses :mod:`grpc` library, it is safe to
4+
share instances across threads. In multiprocessing scenarios, the best
5+
practice is to create client instances *after* the invocation of
6+
:func:`os.fork` by :class:`multiprocessing.pool.Pool` or
7+
:class:`multiprocessing.Process`.

docs/project.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Folders
2+
-------------------------
3+
4+
.. automodule:: google.cloud.resourcemanager_v3.services.folders
5+
:members:
6+
:inherited-members:
7+
8+
.. automodule:: google.cloud.resourcemanager_v3.services.folders.pagers
9+
:members:
10+
:inherited-members:

0 commit comments

Comments
 (0)