Sha256: cfcf29cf32d322bdcdeb111866d586614922945ddf5c283f9380a2c31aee7ac4

Contents?: true

Size: 949 Bytes

Versions: 87

Compression:

Stored size: 949 Bytes

Contents

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

    banner "Show details of a volume"

    parameter 'VOLUME', 'Volume'

    requires_current_master
    requires_current_master_token

    def execute
      vol = client.get("volumes/#{current_grid}/#{volume}")
      puts "#{vol['name']}:"
      puts "  id: #{vol['id']}"
      puts "  created: #{vol['created_at']}"
      puts "  scope: #{vol['scope']}"
      puts "  driver: #{vol['driver']}"
      puts "  driver_opts:"
      vol['driver_opts'].each do |k,v|
        puts "    #{k}: #{v}"
      end
      puts "  instances:"
      vol['instances'].each do |instance|
        puts "    - name: #{instance['name']}"
        puts "      node: #{instance['node']}"
      end
      puts "  services:"
      vol['services'].each do |service|
        puts "    - #{service['id']}"
      end

    end

  end
end

Version data entries

87 entries across 87 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/cli/volumes/show_command.rb
krates-1.7.10 lib/kontena/cli/volumes/show_command.rb
krates-1.7.9 lib/kontena/cli/volumes/show_command.rb
krates-1.7.8 lib/kontena/cli/volumes/show_command.rb
krates-1.7.7 lib/kontena/cli/volumes/show_command.rb
krates-1.7.6 lib/kontena/cli/volumes/show_command.rb
krates-1.7.5 lib/kontena/cli/volumes/show_command.rb
krates-1.7.4 lib/kontena/cli/volumes/show_command.rb
krates-1.7.3 lib/kontena/cli/volumes/show_command.rb
krates-1.7.2 lib/kontena/cli/volumes/show_command.rb
krates-1.7.1 lib/kontena/cli/volumes/show_command.rb
krates-1.7.0 lib/kontena/cli/volumes/show_command.rb
krates-1.6.9 lib/kontena/cli/volumes/show_command.rb
krates-1.6.8 lib/kontena/cli/volumes/show_command.rb
krates-1.6.7 lib/kontena/cli/volumes/show_command.rb
krates-1.6.6 lib/kontena/cli/volumes/show_command.rb
krates-1.6.5 lib/kontena/cli/volumes/show_command.rb
krates-1.6.4 lib/kontena/cli/volumes/show_command.rb
krates-1.6.3 lib/kontena/cli/volumes/show_command.rb
krates-1.6.2 lib/kontena/cli/volumes/show_command.rb