Sha256: 9cec955b6697078ad7fb85ad5408663893a8fdd8cceb3a738853115bcad37183

Contents?: true

Size: 927 Bytes

Versions: 13

Compression:

Stored size: 927 Bytes

Contents

module ThreeScaleToolbox
  module Commands
    module ServiceCommand
      class ListSubcommand < Cri::CommandRunner
        include ThreeScaleToolbox::Command

        FIELDS = %w[id name system_name]

        def self.command
          Cri::Command.define do
            name        'list'
            usage       'list <remote>'
            summary     'List all services'
            description 'List all services'

            ThreeScaleToolbox::CLI.output_flag(self)
            param :remote

            runner ListSubcommand
          end
        end

        def run
          printer.print_collection remote.list_services
        end

        private

        def remote
          @remote ||= threescale_client(arguments[:remote])
        end

        def printer
          # keep backwards compatibility
          options.fetch(:output, CLI::CustomTablePrinter.new(FIELDS))
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
3scale_toolbox-1.0.1 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-1.0.0 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.20.0 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.19.3 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.19.2 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.19.1 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.19.0 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.18.3 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.18.2 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.18.0 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.17.1 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.17.0 lib/3scale_toolbox/commands/service_command/list_command.rb
3scale_toolbox-0.16.0 lib/3scale_toolbox/commands/service_command/list_command.rb