deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject git commit: EC2: Added the 'metrics' feature to enable CloudWatch in EC2
Date Wed, 06 Jun 2012 12:10:00 GMT
Updated Branches:
  refs/heads/master 04edc295d -> 49d0960f8


EC2: Added the 'metrics' feature to enable CloudWatch in EC2


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/49d0960f
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/49d0960f
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/49d0960f

Branch: refs/heads/master
Commit: 49d0960f82459ccb258ca663e7cc7f4009daa2ee
Parents: 04edc29
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Thu May 31 10:28:03 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Wed Jun 6 14:08:37 2012 +0200

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |    4 ++++
 server/lib/deltacloud/drivers/features.rb       |    7 +++++++
 server/views/instances/new.html.haml            |    5 +++++
 3 files changed, 16 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/49d0960f/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 6454cce..8a61b9c 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -37,6 +37,7 @@ module Deltacloud
         feature :instances, :authentication_key
         feature :instances, :firewalls
         feature :instances, :instance_count
+        feature :instances, :metrics
         feature :images, :owner_id
         feature :images, :image_name
         feature :images, :image_description
@@ -228,6 +229,9 @@ module Deltacloud
           if opts[:user_data]
             instance_options[:user_data] = Base64::decode64(opts[:user_data])
           end
+          if opts[:metrics] and !opts[:metrics].empty?
+            instance_options[:monitoring_enabled] = true
+          end
           instance_options[:key_name] = opts[:keyname] if opts[:keyname]
           instance_options[:availability_zone] = opts[:realm_id] if opts[:realm_id]
           instance_options[:instance_type] = opts[:hwp_id] if opts[:hwp_id] && opts[:hwp_id].length
> 0

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/49d0960f/server/lib/deltacloud/drivers/features.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/features.rb b/server/lib/deltacloud/drivers/features.rb
index c2af8cb..7e98749 100644
--- a/server/lib/deltacloud/drivers/features.rb
+++ b/server/lib/deltacloud/drivers/features.rb
@@ -58,6 +58,13 @@ module Deltacloud
         end
       end
 
+      feature :metrics, :for => :instances do
+        description "Enable more detailed monitoring and metrics reporting for the instance"
+        operation :create do
+          param :metrics, :string, :optional
+        end
+      end
+
       feature :user_name, :for => :instances do
         description "Allow to set user-defined name for the instance"
         operation :create do

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/49d0960f/server/views/instances/new.html.haml
----------------------------------------------------------------------
diff --git a/server/views/instances/new.html.haml b/server/views/instances/new.html.haml
index c846e16..6c8e130 100644
--- a/server/views/instances/new.html.haml
+++ b/server/views/instances/new.html.haml
@@ -42,6 +42,11 @@
             %label{ :for => :instance_count} # of instances to be launched:
             %input{ :type => :text, :id => :instance_count, :name => :instance_count,
:value => '1' }
 
+        - if driver.class.has_feature?(:instances, :metrics)
+          %div{ 'data-role' => :fieldcontain }
+            %label{ :for => :metrics} Enable metrics for this instance
+            %input{ :type => :checkbox, :id => :metrics, :name => :metrics, :checked
=> 'false' }
+
         - if driver.class.has_feature?(:instances, :authentication_key)
           %div{ 'data-role' => :fieldcontain }
             %label{ :for => :keyname, :class => 'ui-input-text'} Instance SSH key:


Mime
View raw message