Sha256: 1f3c010b51553f3af6f403b8f3e0ef9401cb4ac63715e73efe7ed87e3de01d6c

Contents?: true

Size: 699 Bytes

Versions: 22

Compression:

Stored size: 699 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Etcd
  class RemoveCommand < Clamp::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions
    include Common

    parameter "KEY", "Etcd key"

    option "--recursive", :flag, "Remove keys recursively"
    option "--force", :flag, "Force remove", default: false, attribute_name: :forced

    def execute
      require_api_url
      token = require_token
      validate_key
      confirm unless forced?

      data = {}
      data[:recursive] = true if recursive?
      response = client(token).delete("etcd/#{current_grid}/#{key}", data)

      if response['error']
        abort response['error']
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.4 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.3 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.2 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.1 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.0 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.14.7 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.14.6 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.14.5 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.14.4 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.14.3 lib/kontena/cli/etcd/remove_command.rb
kontena-cli-0.14.2 lib/kontena/cli/etcd/remove_command.rb