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

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

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ SetupUptimerobot

Returns a new instance of SetupUptimerobot.



14
15
16
17
18
# File 'lib/renuo/cli/commands/setup_uptimerobot.rb', line 14

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

Instance Method Details

#runObject



20
21
22
23
24
25
# File 'lib/renuo/cli/commands/setup_uptimerobot.rb', line 20

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