Sha256: e09e2834be09c351e63c9fba006dc5d0a35ea68509303a7b1bc00c69f7cf9cee

Contents?: true

Size: 631 Bytes

Versions: 54

Compression:

Stored size: 631 Bytes

Contents

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


    banner "Removes a volume"
    parameter 'VOLUME', 'Volume'
    option "--force", :flag, "Force remove", default: false, attribute_name: :forced

    requires_current_master
    requires_current_master_token

    def execute
      confirm_command(volume) unless forced?

      spinner "Removing volume #{pastel.cyan(volume)} " do
        remove_volume(volume)
      end
    end

    def remove_volume(volume)
      client.delete("volumes/#{current_grid}/#{volume}")
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
kontena-cli-1.4.3 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.3.rc1 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.2 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.2.rc1 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.2.pre1 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.1 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.1.rc1 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.1.pre1 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.3.5 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.0 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.0.rc2 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.0.rc1 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.0.pre14 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.0.pre13 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.0.pre12 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.0.pre11 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.0.pre10 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.0.pre9 lib/kontena/cli/volumes/remove_command.rb
kontena-cli-1.4.0.pre8 lib/kontena/cli/volumes/remove_command.rb