Sha256: 27b23dc2ae4ca940cde376a88777151039b27793943656a862b15c599fc51b23

Contents?: true

Size: 560 Bytes

Versions: 4

Compression:

Stored size: 560 Bytes

Contents

module Kontena::Cli::Volumes
  class ListCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions


    requires_current_master
    requires_current_master_token

    def execute
      volumes = client.get("volumes/#{current_grid}")['volumes']
      columns = '%-25.25s %-25.25s %-25.25s %-25.25s'
      puts columns % ['NAME', 'SCOPE', 'DRIVER', 'CREATED AT']
      volumes.each do |volume|
        puts columns % [volume['name'], volume['scope'], volume['driver'], volume['created_at']]
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
kontena-cli-1.2.0.rc1 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.2.0.pre3 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.2.0.pre2 lib/kontena/cli/volumes/list_command.rb
kontena-cli-1.2.0.pre1 lib/kontena/cli/volumes/list_command.rb