Sha256: ac3d0499000032130ff028fc3a9c7f70a0cf4d6b15a9d9eabee5fbaf899c9233

Contents?: true

Size: 625 Bytes

Versions: 10

Compression:

Stored size: 625 Bytes

Contents

require_relative 'services_helper'

module Kontena::Cli::Services
  class ListCommand < Clamp::Command
    include Kontena::Cli::Common
    include ServicesHelper

    def execute
      require_api_url
      token = require_token

      grids = client(token).get("grids/#{current_grid}/services")
      puts "%-30.30s %-40.40s %-10s %-8s" % ['NAME', 'IMAGE', 'INSTANCES', 'STATEFUL']
      grids['services'].each do |service|
        state = service['stateful'] ? 'yes' : 'no'
        puts "%-30.30s %-40.40s %-10.10s %-8s" % [service['name'], service['image'], service['container_count'], state]
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kontena-cli-0.9.3 lib/kontena/cli/services/list_command.rb
kontena-cli-0.9.2 lib/kontena/cli/services/list_command.rb
kontena-cli-0.9.1 lib/kontena/cli/services/list_command.rb
kontena-cli-0.9.0 lib/kontena/cli/services/list_command.rb
kontena-cli-0.8.4 lib/kontena/cli/services/list_command.rb
kontena-cli-0.8.3 lib/kontena/cli/services/list_command.rb
kontena-cli-0.8.2 lib/kontena/cli/services/list_command.rb
kontena-cli-0.8.1 lib/kontena/cli/services/list_command.rb
kontena-cli-0.8.0.1 lib/kontena/cli/services/list_command.rb
kontena-cli-0.8.0 lib/kontena/cli/services/list_command.rb