class OpenStudioCloudWatch
Constants
- VALID_OPTIONS
Attributes
private_key_file_name[RW]
security_groups[RW]
Public Class Methods
new(options = {})
click to toggle source
# File lib/openstudio/lib/openstudio_cloud_watch.rb, line 46 def initialize(options = {}) # store an instance variable with the proxy for passing to instances for use in scp/ssh @proxy = options[:proxy] || nil # need to remove the prxoy information here @aws = Aws::CloudWatch::Client.new(options[:credentials]) end
Public Instance Methods
estimated_charges()
click to toggle source
# File lib/openstudio/lib/openstudio_cloud_watch.rb, line 54 def estimated_charges end_time = Time.now.utc start_time = end_time - 86400 resp = @aws.get_metric_statistics( dimensions: [ { name: 'ServiceName', value: 'AmazonEC2' }, { name: 'Currency', value: 'USD' } ], metric_name: 'EstimatedCharges', namespace: 'AWS/Billing', start_time: start_time.iso8601, end_time: end_time.iso8601, period: 300, statistics: ['Maximum'] ) resp.data || [] end