Class: VagrantPlugins::OneAndOne::Command::ListMonitorPolicies
- Inherits:
-
Object
- Object
- VagrantPlugins::OneAndOne::Command::ListMonitorPolicies
- Includes:
- Utils
- Defined in:
- lib/vagrant-oneandone/command/list_monitor_policies.rb
Instance Method Summary collapse
Methods included from Utils
#display_table, #fog_oneandone
Instance Method Details
#execute ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vagrant-oneandone/command/list_monitor_policies.rb', line 9 def execute = OptionParser.new do |o| o. = I18n.t('vagrant_1and1.command.list_monitor_policies') o.separator '' o.separator 'Usage: vagrant oneandone monitors [<api_key>]' o.separator '' end argv = () return unless argv compute = fog_oneandone(argv[0]) rows = [] compute.monitoring_policies.all.each do |mp| rows << [mp.id, mp.name, mp.email, mp.state, mp.agent ? 'yes' : 'no'] end display_table(@env, %w(ID Name Email State Agent), rows) end |