Sha256: 52b4b1f041c6f6136d2cb9560cf5f45b8202c84676b219106ee781c55214db98

Contents?: true

Size: 599 Bytes

Versions: 22

Compression:

Stored size: 599 Bytes

Contents

module Kontena::Cli::Vault
  class WriteCommand < Clamp::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    parameter 'NAME', 'Secret name'
    parameter '[VALUE]', 'Secret value'

    def execute
      require_api_url
      require_current_grid

      token = require_token
      secret = value
      if secret.to_s == ''
        secret = STDIN.read
      end
      abort('No value provided') if secret.to_s == ''
      data = {
          name: name,
          value: secret
      }
      client(token).post("grids/#{current_grid}/secrets", data)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

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