Class: CloudstackStats::Collect
- Inherits:
-
Object
- Object
- CloudstackStats::Collect
- Defined in:
- lib/cloudstack_stats/collect.rb
Instance Method Summary collapse
- #account_stats ⇒ Object
-
#initialize(settings) ⇒ Collect
constructor
A new instance of Collect.
- #project_stats ⇒ Object
Constructor Details
#initialize(settings) ⇒ Collect
Returns a new instance of Collect.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/cloudstack_stats/collect.rb', line 8 def initialize(settings) @settings = settings.dup @config ||= CloudstackClient::Configuration.load(@settings) @cs ||= CloudstackClient::Client.new( @config[:url], @config[:api_key], @config[:secret_key] ) @cs.debug = true if @settings[:debug] @cs end |
Instance Method Details
#account_stats ⇒ Object
20 21 22 23 24 25 |
# File 'lib/cloudstack_stats/collect.rb', line 20 def account_stats { type: "account", stats: @cs.list_accounts() } end |
#project_stats ⇒ Object
27 28 29 30 31 32 |
# File 'lib/cloudstack_stats/collect.rb', line 27 def project_stats { type: "project", stats: @cs.list_projects() } end |