diff --git a/lib/fog/gce/compute.rb b/lib/fog/gce/compute.rb index 523109422..fc5d2aefe 100644 --- a/lib/fog/gce/compute.rb +++ b/lib/fog/gce/compute.rb @@ -74,10 +74,6 @@ module Fog @api_url = base_url + api_version + '/projects/' @client = ::Google::APIClient.new @compute = @client.discovered_api('compute', api_version) - - @default_image = 'ubuntu-12-04-v20120912' - @default_zone = 'us-east1-a' - @default_machine = 'n1-standard-1' @default_network = 'default' auth_util = CommandLineOAuthHelper.new(api_scope_url) diff --git a/lib/fog/gce/models/compute/server.rb b/lib/fog/gce/models/compute/server.rb index d33395052..479d761e2 100644 --- a/lib/fog/gce/models/compute/server.rb +++ b/lib/fog/gce/models/compute/server.rb @@ -6,8 +6,7 @@ module Fog class Server < Fog::Model - identity :name - + attribute :name attribute :image_name, :aliases => 'image' attribute :network_interfaces, :aliases => 'networkInterfaces' attribute :state, :aliases => 'status' @@ -15,8 +14,8 @@ module Fog attribute :machine_type, :aliases => 'machineType' def destroy - requires :identity - connection.delete_server(identity) + requires :name + connection.delete_server(name) end def image @@ -36,14 +35,13 @@ module Fog end def save - requires :identity + requires :name requires :image_name - requires :zone_name requires :machine_type + requires :zone_name - data = connection.insert_server(identity, image_name=image_name, - zone_name=zone_name, - machine_type=machine_type) + data = connection.insert_server(name, image_name, zone_name, + machine_type) connection.servers.merge_attributes() end diff --git a/lib/fog/gce/requests/compute/insert_server.rb b/lib/fog/gce/requests/compute/insert_server.rb index f1ddc6ddb..090fd5ed6 100644 --- a/lib/fog/gce/requests/compute/insert_server.rb +++ b/lib/fog/gce/requests/compute/insert_server.rb @@ -12,11 +12,10 @@ module Fog class Real - def insert_server(server_name, - image_name=@default_image, - zone_name=@default_zone, - machine_name=@default_machine, + def insert_server(server_name, image_name, + zone_name, machine_name, network_name=@default_network) + api_method = @compute.instances.insert parameters = { 'project' => @project,