Class: Renuo::Cli::Commands::SetupUptimerobot
- Inherits:
-
Object
- Object
- Renuo::Cli::Commands::SetupUptimerobot
- Defined in:
- lib/renuo/cli/commands/setup_uptimerobot.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ SetupUptimerobot
constructor
A new instance of SetupUptimerobot.
- #run ⇒ Object
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
#run ⇒ Object
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 |