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

This is a simple command line example of calling the Google Compute Engine API in Ruby.

License

Notifications You must be signed in to change notification settings

googlearchive/compute-getting-started-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

status: inactive

This project is no longer actively developed or maintained.

Google Compute Engine Ruby Sample Application

##Description This is a simple command line example of calling the Google Compute Engine APIs in Ruby.

Prerequisites

Please make sure that all of the following is installed before trying to run the sample application.

  • Ruby 1.9.3+

  • The following gems (run 'sudo gem install ' to install)

    • google-api-client
    • thin
    • launchy
    • highline
  • If you haven't installed the above gems, try this:

    • 'sudo gem install google-api-client thin launchy highline'
  • The google-api-ruby-client library checked out locally, and this sample application running from inside of that repo.

Setup Authentication

  1. Visit https://code.google.com/apis/console/ to register your application.
  • From the "Project Home" screen, activate access to "Google Compute Engine API".
  • Click on "API Access" in the left column
  • Click the button labeled "Create an OAuth 2.0 client ID"
  • Give your application a name and click "Next"
  • Select "Installed Application" as the "Application type"
  • Select "Other" under "Installed application type"
  • Click "Create client ID"
  1. Run 'cp client_secrets.json.sample client_secrets.json'
  • Edit the client_secrets.json file and enter the client ID and secret that you retrieved from the API Console.
  1. Edit 'YOUR_PROJECT_ID' in sample.rb to reflect your Google Compute Engine project name.

Running the Sample Application

  1. Run the application
  • $ ruby sample.rb
  1. Authorize the application in the browser window that opens.
  2. The Google Compute Engine sample application will display its output on the command line.

About

This is a simple command line example of calling the Google Compute Engine API in Ruby.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages