Skip to content
This sample python application demonstrates how to access the Compute Engine API using the Google Python API Client Library.
Python Shell
Find file
Latest commit 6d37c15 @jonparrott jonparrott Update README.md
Failed to load latest commit information.
.editorconfig
.gitignore Initial commit
.travis.yml Adding tox and travis config, fixing long lines
CONTRIBUTING.md Re-writing the sample.
LICENSE Fixing indentation, license, long lines.
README.md Update README.md
main.py uses six input instead of straight input
requirements.txt uses six input instead of straight input
startup-script.sh Fix startup script to create GS bucket
tox.ini Adding tox and travis config, fixing long lines

README.md

status: inactive

This project is no longer actively developed or maintained.

This sample has been moved to GoogleCloudPlatform/python-docs-samples.

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.