Class: CloudstackStats::Cli
- Inherits:
-
Thor
- Object
- Thor
- CloudstackStats::Cli
- Includes:
- Thor::Actions
- Defined in:
- lib/cloudstack_stats/cli.rb
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
exit with return code 1 in case of a error.
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
exit with return code 1 in case of a error
54 55 56 |
# File 'lib/cloudstack_stats/cli.rb', line 54 def self.exit_on_failure? true end |
Instance Method Details
#accounts ⇒ Object
82 83 84 85 86 87 88 89 90 |
# File 'lib/cloudstack_stats/cli.rb', line 82 def accounts say "Collect stats...", :yellow stats = Collect.new().account_stats say "Write stats to influxdb...", :yellow Feed.new().write(stats) {|stat, res| print_status(stat, res)} rescue => e say "ERROR: ", :red puts e. end |
#projects ⇒ Object
68 69 70 71 72 73 74 75 76 |
# File 'lib/cloudstack_stats/cli.rb', line 68 def projects say "Collect stats...", :yellow stats = Collect.new().project_stats say "Write stats to influxdb...", :yellow Feed.new().write(stats) {|stat, res| print_status(stat, res)} rescue => e say "ERROR: ", :red puts e. end |
#version ⇒ Object
59 60 61 |
# File 'lib/cloudstack_stats/cli.rb', line 59 def version say "cloudstack_stats v#{CloudstackStats::VERSION}" end |