Class: ThreeScaleToolbox::Commands::ApplicationCommand::Delete::DeleteSubcommand

Inherits:
Cri::CommandRunner
  • Object
show all
Includes:
ThreeScaleToolbox::Command
Defined in:
lib/3scale_toolbox/commands/application_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



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/3scale_toolbox/commands/application_command/delete_command.rb', line 8

def self.command
  Cri::Command.define do
    name        'delete'
    usage       'delete [opts] <remote> <application>'
    summary     'delete application'
    description <<-HEREDOC
    Delete application'
    \n Application param allows:
    \n * User_key (API key)
    \n * App_id (from app_id/app_key pair) or Client ID (for OAuth and OpenID Connect authentication modes)
    \n * Application internal id
    HEREDOC

    param       :remote
    param       :application_ref

    runner DeleteSubcommand
  end
end

Instance Method Details

#runObject



28
29
30
31
# File 'lib/3scale_toolbox/commands/application_command/delete_command.rb', line 28

def run
  application.delete
  puts "Application id: #{application.id} deleted"
end