require 'googleauth'
require 'google/apis/compute_v1'
compute = Google::Apis::ComputeV1::ComputeService.new
# Get the environment configured authorization
scopes = ['https://www.googleapis.com/auth/cloud-platform', 'https://www.googleapis.com/auth/compute']
compute.authorization = Google::Auth.get_application_default(scopes)