Skip to main content

Google Cloud Resource Manager API client library

Project description

alpha pypi versions compat_check_pypi compat_check_github

Google Cloud Resource Manager API provides methods that you can use to programmatically manage your projects in the Google Cloud Platform. With this API, you can do the following:

Quick Start

In order to use this library, you first need to go through the following steps:

  1. Select or create a Cloud Platform project.

  2. Enable billing for your project.

  3. Enable the Google Cloud Resource Manager API.

Installation

Install this library in a virtualenv using pip. virtualenv is a tool to create isolated Python environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions.

With virtualenv, it’s possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.

Supported Python Versions

Python >= 3.5

Deprecated Python Versions

Python == 2.7. Python 2.7 support will be removed on January 1, 2020.

Mac/Linux

pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-resource-manager

Windows

pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-resource-manager

Authentication

Unlike the other APIs, the Resource Manager API is focused on managing your various projects inside Google Cloud Platform. What this means (currently, as of August 2015) is that you can’t use a Service Account to work with some parts of this API (for example, creating projects).

The reason is actually pretty simple: if your API call is trying to do something like create a project, what project’s Service Account can you use? Currently none.

This means that for this API you should always use the credentials provided by the Google Cloud SDK, which you can get by running gcloud auth login.

Once you run that command, google-cloud-python will automatically pick up the credentials, and you can use the “automatic discovery” feature of the library.

Start by authenticating:

$ gcloud auth login

And then simply create a client:

from google.cloud import resource_manager
client = resource_manager.Client()

Using the API

Here’s a quick example of the full life-cycle:

from google.cloud import resource_manager

client = resource_manager.Client()

# List all projects you have access to
for project in client.list_projects():
    print(project)

# Create a new project
new_project = client.new_project(
 'your-project-id-here', name='My new project')
new_project.create()

# Update an existing project
project = client.fetch_project('my-existing-project')
project.name = 'Modified name'
project.update()

# Delete a project
project = client.new_project('my-existing-project')
project.delete()

# Undelete a project
project = client.new_project('my-existing-project')
project.undelete()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google-cloud-resource-manager-0.29.2.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

google_cloud_resource_manager-0.29.2-py2.py3-none-any.whl (15.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file google-cloud-resource-manager-0.29.2.tar.gz.

File metadata

  • Download URL: google-cloud-resource-manager-0.29.2.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.0

File hashes

Hashes for google-cloud-resource-manager-0.29.2.tar.gz
Algorithm Hash digest
SHA256 b1d9a5bdb9f320345897ed75ef02c65aace3fa492338bcf60781572eb0524dd8
MD5 db28375d2c7ec459d9cc01cfd1f5e6c2
BLAKE2b-256 f2835e93825c6e306c7af32c9fc07088ee5d3c28c9a133535a12b47f9bf0a52e

See more details on using hashes here.

Provenance

File details

Details for the file google_cloud_resource_manager-0.29.2-py2.py3-none-any.whl.

File metadata

  • Download URL: google_cloud_resource_manager-0.29.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.0

File hashes

Hashes for google_cloud_resource_manager-0.29.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 784ea2061fa609e0bcb82b1d84fa6bb74cc4f0828e8d37b1b84898b86c9a62e6
MD5 f2e164f5b34ebd01e6b6381669477c4a
BLAKE2b-256 e251d14c353d9758f220101e241b9b817c8dfa6becb95be0ca0bd3269d59c7a7

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page