From 1ca42cb6599d2bd409560213d8c0a2c770ad2a50 Mon Sep 17 00:00:00 2001 From: "geemus (Wesley Beary)" Date: Tue, 13 Apr 2010 21:40:30 -0700 Subject: [PATCH] [terremark] remove hardcoded cpu/memory options in instantiate vapp --- .../terremark/requests/instantiate_vapp_template.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/fog/terremark/requests/instantiate_vapp_template.rb b/lib/fog/terremark/requests/instantiate_vapp_template.rb index b83a06887..d632974bd 100644 --- a/lib/fog/terremark/requests/instantiate_vapp_template.rb +++ b/lib/fog/terremark/requests/instantiate_vapp_template.rb @@ -6,7 +6,9 @@ module Fog # # ==== Parameters # * vdc_id<~Integer> - Id of vdc to instantiate template in - # + # * options<~Hash>: + # * cpus<~Integer>: Number of cpus in [1, 2, 4, 8], defaults to 1 + # * memory<~Integer>: Amount of memory either 512 or a multiple of 1024, defaults to 512 # ==== Returns # * response<~Excon::Response>: # * body<~Hash>: @@ -19,7 +21,10 @@ module Fog # * 'type'<~String> - type of item # * 'description'<~String> - Description of catalog # * 'name'<~String> - Name of catalog - def instantiate_vapp_template(name) + def instantiate_vapp_template(name, options = {}) + options['cpus'] ||= 1 + options['memory'] ||= 512 + # FIXME: much cheating to commence vdc_id = default_vdc_id network_id = default_network_id @@ -68,12 +73,12 @@ module Fog 1 3 - 1 + #{options['cpus']} 2 4 - 512 + #{options['memory']}