Google Cloud Compute API client library
Project description
Compute Engine API: Create and runs virtual machines on Google Cloud Platform.
Quick Start
In order to use this library, you first need to go through the following steps:
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.
Mac/Linux
pip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-compute
Windows
pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-compute
Long Running Operations
Long-Running Operations (LROs), like the many insert() operations, can be handled using the ExtendedOperation object that is returned when the LRO is started.
You can wait for the completion of an operation using its result() method. This method accepts a timeout argument, specifying how long you want your process to wait for completion of the operation (in seconds). When the call to result() times out, the operation is not automatically cancelled. At any time, you can check whether the operation is complete by using its done() method.
A sample method to handle LROs featuring error and warning reporting can be found in the Python code samples repository: GoogleCloudPlatform/python-docs-samples
Code Samples
You can find useful code samples that will demonstrate the usage of this library on the Google Cloud samples page.
PyCharm/JetBrains IDEs
This library has now grown in size past the JetBrains default size limit of ~2.5Mb. As a result, code completion in JetBrains products can fail to work with the classes from our library. To fix this, you need to update the idea.max.intellisense.filesize setting in custom properties (Help -> Edit custom properties…). Just add the line idea.max.intellisense.filesize = 10000 to change this limit to ~10Mb.
Next Steps
Read the Client Library Documentation for Compute Engine API to see other available methods on the client.
Read the Compute Engine API Product documentation to learn more about the product and see How-to Guides.
View this README to see the full list of Cloud APIs that we cover.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for google-cloud-compute-1.13.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93b72129c6443c898da5a060d2021bc2d11c2a57ef2fbb9306afbb5126a376b9 |
|
MD5 | 9557fdfcf2b8a3d741bbf7674fa49525 |
|
BLAKE2b-256 | c453d228bfaec639a1ecc805292b28656355c3915599fcfee8ccb2ea9f7eecd4 |
Hashes for google_cloud_compute-1.13.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f75d6c09cc504e43f4eceb2a466de9e9eb6fca819ca8ffdcf098ca5b21c7dc1 |
|
MD5 | 6f81a9d9f69f27a87985d4ef4cc63560 |
|
BLAKE2b-256 | a13389a0d52d8c0572be588bdb7d7a5f0317fdc171c688d70fc50fbb0e3dc295 |