Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
This sample python application demonstrates how to access the Compute Engine API using the Google Python API Client Library.
Python Shell
Branch: master

Merge pull request #7 from jonparrott/master

Re-writing the sample.
latest commit 49e1661825
@elibixby elibixby authored

README.md

Getting Started with Compute Engine and the Google Python Client Library

Google Compute Engine features a RESTful API that allows developers to run virtual machines in the cloud. This sample python command-line application demonstrates how to access the Compute Engine API using the Google Python API Client Library.

Pre-requisites

  1. Create a project on the Google Developers Console and enable billing.
  2. Install the Google Cloud SDK
curl https://sdk.cloud.google.com | bash
gcloud auth login
gcloud config set project your-project-id
  1. Install dependencies using pip
pip install -r requirements.txt

Running the sample

python main.py

The sample will:

  1. Create an instance with a start up script and metadata.
  2. Print out the URL where the modified image will be written.
  3. Waits for input from the user and then delete the instance.

The start up script executes these steps on the instance:

  1. Installs Image Magick on the machine.
  2. Downloads the image from the URL provided in the metadata.
  3. Adds the text provided in the metadata to the image.
  4. Copies the edited image to Cloud Storage.

Products

Contributing changes

Licensing

Something went wrong with that request. Please try again.