Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

googlearchive/compute-getting-started-python

Repository files navigation

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

About

This sample python application demonstrates how to access the Compute Engine API using the Google Python API Client Library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published