Sha256: f5472ede7a081e4f6a379e5cdb31948e0ab99bd3739758a2cc448f1fb0d29a38

Contents?: true

Size: 525 Bytes

Versions: 5

Compression:

Stored size: 525 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Etcd
  class SetCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions
    include Common

    parameter "KEY", "Etcd key"
    parameter "VALUE", "Etcd value"

    def execute
      require_api_url
      token = require_token
      validate_key

      data = {value: value}
      response = client(token).post("etcd/#{current_grid}/#{key}", data)
      if response['error']
        abort response['error']
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kontena-cli-0.16.0.pre5 lib/kontena/cli/etcd/set_command.rb
kontena-cli-0.16.0.pre4 lib/kontena/cli/etcd/set_command.rb
kontena-cli-0.16.0.pre3 lib/kontena/cli/etcd/set_command.rb
kontena-cli-0.16.0.pre2 lib/kontena/cli/etcd/set_command.rb
kontena-cli-0.16.0.pre1 lib/kontena/cli/etcd/set_command.rb