Class: ThreeScaleToolbox::Commands::ServiceCommand::DeleteSubcommand

Inherits:
Cri::CommandRunner
  • Object
show all
Includes:
ThreeScaleToolbox::Command
Defined in:
lib/3scale_toolbox/commands/service_command/delete_command.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ThreeScaleToolbox::Command

#config, #config_file, #exit_with_message, #fetch_required_option, included, #remotes, #threescale_client, #verbose, #verify_ssl

Class Method Details

.commandObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/3scale_toolbox/commands/service_command/delete_command.rb', line 7

def self.command
  Cri::Command.define do
    name        'delete'
    usage       'delete <remote> <service-id_or_system-name>'
    summary     'Delete a service'
    description 'Delete a service'
    runner DeleteSubcommand

    param   :remote
    param   :service_id_or_system_name
  end
end

Instance Method Details

#runObject



20
21
22
23
# File 'lib/3scale_toolbox/commands/service_command/delete_command.rb', line 20

def run
  service.delete
  puts "Service with id: #{service.id} deleted"
end