From d2e315469070786c3b8da22cf76e4754905be98b Mon Sep 17 00:00:00 2001 From: neillturner Date: Sat, 28 Dec 2013 17:02:59 +0000 Subject: [PATCH] addresses and settags --- lib/fog/google/compute.rb | 3 +- .../google/requests/compute/delete_address.rb | 4 +-- .../google/requests/compute/get_address.rb | 2 +- .../google/requests/compute/insert_address.rb | 2 +- lib/fog/google/requests/compute/set_tags.rb | 36 +++++++++++++++++++ 5 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 lib/fog/google/requests/compute/set_tags.rb diff --git a/lib/fog/google/compute.rb b/lib/fog/google/compute.rb index 81e103f0c..d9db7bf02 100644 --- a/lib/fog/google/compute.rb +++ b/lib/fog/google/compute.rb @@ -23,7 +23,7 @@ module Fog request :list_snapshots request :get_server - request :get_disk + request :get_address request :get_disk request :get_firewall request :get_image @@ -53,6 +53,7 @@ module Fog request :insert_snapshot request :set_metadata + request :set_tags model_path 'fog/google/models/compute' model :server diff --git a/lib/fog/google/requests/compute/delete_address.rb b/lib/fog/google/requests/compute/delete_address.rb index 7cca569cb..3f01c2ec7 100644 --- a/lib/fog/google/requests/compute/delete_address.rb +++ b/lib/fog/google/requests/compute/delete_address.rb @@ -4,7 +4,7 @@ module Fog class Mock - def delete_address(address_name) + def delete_address(address_name,region_name) Fog::Mock.not_implemented end @@ -13,7 +13,7 @@ module Fog class Real def delete_address(address_name,region_name) - api_method = @compute.addresss.delete + api_method = @compute.addresses.delete parameters = { 'project' => @project, 'address' => address_name, diff --git a/lib/fog/google/requests/compute/get_address.rb b/lib/fog/google/requests/compute/get_address.rb index 170a0ff83..26d26e61c 100644 --- a/lib/fog/google/requests/compute/get_address.rb +++ b/lib/fog/google/requests/compute/get_address.rb @@ -13,7 +13,7 @@ module Fog class Real def get_address(address_name,region_name) - api_method = @compute.addresss.get + api_method = @compute.addresses.get parameters = { 'project' => @project, 'address' => address_name, diff --git a/lib/fog/google/requests/compute/insert_address.rb b/lib/fog/google/requests/compute/insert_address.rb index 5a5b82fe3..0504638a6 100644 --- a/lib/fog/google/requests/compute/insert_address.rb +++ b/lib/fog/google/requests/compute/insert_address.rb @@ -13,7 +13,7 @@ module Fog class Real def insert_address(address_name,region_name) - api_method = @compute.addresss.insert + api_method = @compute.addresses.insert parameters = { 'project' => @project, 'region' => region_name diff --git a/lib/fog/google/requests/compute/set_tags.rb b/lib/fog/google/requests/compute/set_tags.rb new file mode 100644 index 000000000..a95717718 --- /dev/null +++ b/lib/fog/google/requests/compute/set_tags.rb @@ -0,0 +1,36 @@ +module Fog + module Compute + class Google + + class Mock + + def set_tags(instance, zone, tags=[]) + Fog::Mock.not_implemented + end + + end + + class Real + + def set_tags(instance, zone, tags=[]) + api_method = @compute.instance.set_tags + parameters = { + 'project' => @project, + 'instance' => instance, + 'zone' => zone, + } + body_object = { + "items" => tags + } + result = self.build_result( + api_method, + parameters, + body_object=body_object) + response = self.build_response(result) + end + + end + + end + end +end