[PATCH aeolus-cli 2/4] list and delete commands extended to support hwps

Samridh samridh90 at gmail.com
Fri Jun 29 08:36:05 UTC 2012


---
 lib/aeolus_cli/command/delete_command.rb |   15 ++++++++++++++-
 lib/aeolus_cli/command/list_command.rb   |   19 ++++++++++++++++++-
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/lib/aeolus_cli/command/delete_command.rb b/lib/aeolus_cli/command/delete_command.rb
index 1fb12f2..c9f8a89 100644
--- a/lib/aeolus_cli/command/delete_command.rb
+++ b/lib/aeolus_cli/command/delete_command.rb
@@ -74,7 +74,20 @@ module Aeolus
           handle_exception(e)
         end
       end
-
+      
+      def hardware_profile
+        begin
+          h = Aeolus::CLI::HardwareProfile.new({:id => @options[:hwp]})
+          if response = h.destroy
+            puts "Hardware profile: " + @options[:hwp].to_s + " Deleted Successfully"
+            puts ""
+            exit(0)
+          end
+        rescue => e
+          handle_exception(e)
+        end
+      end
+            
       private
       def print_provider_content(content_xml)
         h = Hash.from_xml(content_xml)
diff --git a/lib/aeolus_cli/command/list_command.rb b/lib/aeolus_cli/command/list_command.rb
index 479b961..6e268f0 100644
--- a/lib/aeolus_cli/command/list_command.rb
+++ b/lib/aeolus_cli/command/list_command.rb
@@ -36,7 +36,24 @@ module Aeolus
           handle_exception(e)
         end
       end
-
+      
+      def hardwareProfiles
+        begin
+          headers = ActiveSupport::OrderedHash.new
+          headers[:id] = "ID"
+          headers[:name] = "Name"
+          headers[:memory] = "Memory"
+          headers[:storage] = "Storage"
+          headers[:cpu] = "CPU"
+          headers[:architecture] = "architecture"
+          collection = Aeolus::CLI::HardwareProfile.all
+          print_collection(collection, headers)
+          quit(0)
+        rescue => e
+          handle_exception(e)
+        end     
+      end
+      
       def builds
         begin
           headers = ActiveSupport::OrderedHash.new
-- 
1.7.7.6




More information about the aeolus-devel mailing list