Sha256: da805fe28d28b85e0eb1a18180158444c8afcedaf72e58e150b83e15e160aa83

Contents?: true

Size: 718 Bytes

Versions: 107

Compression:

Stored size: 718 Bytes

Contents

module Kontena::Cli::Vault
  class ReadCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    parameter "NAME", "Secret name"

    option '--value', :flag, 'Just output the value'
    option '--return', :flag, 'Return the value', hidden: true

    def execute
      require_api_url
      require_current_grid

      token = require_token
      result = client(token).get("secrets/#{current_grid}/#{name}")
      return result['value'] if self.return?
      if self.value?
        puts result['value']
      else
        puts "#{result['name']}:"
        puts "  created_at: #{result['created_at']}"
        puts "  value: #{result['value']}"
      end
    end
  end
end

Version data entries

107 entries across 107 versions & 2 rubygems

Version Path
krates-1.6.1 lib/kontena/cli/vault/read_command.rb
krates-1.6.0 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.4 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.4.rc1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.3 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.2 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.0 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.0.rc1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.0.pre5 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.0.pre4 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.0.pre3 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.0.pre2 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.5.0.pre1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.3 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.3.rc1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.2 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.2.rc1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.2.pre1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.1 lib/kontena/cli/vault/read_command.rb