Class: Renuo::Cli::Commands::SetupUptimerobot

Inherits:
Object
  • Object
show all
Defined in:
lib/renuo/cli/commands/setup_uptimerobot.rb

Constant Summary collapse

CONTACT_GROUP_IDS =
"2811620_0_0-6298845_0_0-5223624_0_0"
HTTPS_MONITORING =
1
STATUS_PAUSED =
0

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ SetupUptimerobot

Returns a new instance of SetupUptimerobot.



18
19
20
21
22
# File 'lib/renuo/cli/commands/setup_uptimerobot.rb', line 18

def initialize(args)
  abort("No project name given.") if args.nil?
  @api_key = ask_for_api_key
  @url = validate_url(args)
end

Instance Method Details

#runObject



24
25
26
27
28
29
# File 'lib/renuo/cli/commands/setup_uptimerobot.rb', line 24

def run
  robot_obj = monitoring_call(:new, create_robot_params)
  validate_new_project(robot_obj)
  response = monitoring_call(:edit, edit_robot_params(robot_obj["monitor"]["id"]))
  final_command_status(response)
end