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.7.11 lib/kontena/cli/vault/read_command.rb
krates-1.7.10 lib/kontena/cli/vault/read_command.rb
krates-1.7.9 lib/kontena/cli/vault/read_command.rb
krates-1.7.8 lib/kontena/cli/vault/read_command.rb
krates-1.7.7 lib/kontena/cli/vault/read_command.rb
krates-1.7.6 lib/kontena/cli/vault/read_command.rb
krates-1.7.5 lib/kontena/cli/vault/read_command.rb
krates-1.7.4 lib/kontena/cli/vault/read_command.rb
krates-1.7.3 lib/kontena/cli/vault/read_command.rb
krates-1.7.2 lib/kontena/cli/vault/read_command.rb
krates-1.7.1 lib/kontena/cli/vault/read_command.rb
krates-1.7.0 lib/kontena/cli/vault/read_command.rb
krates-1.6.9 lib/kontena/cli/vault/read_command.rb
krates-1.6.8 lib/kontena/cli/vault/read_command.rb
krates-1.6.7 lib/kontena/cli/vault/read_command.rb
krates-1.6.6 lib/kontena/cli/vault/read_command.rb
krates-1.6.5 lib/kontena/cli/vault/read_command.rb
krates-1.6.4 lib/kontena/cli/vault/read_command.rb
krates-1.6.3 lib/kontena/cli/vault/read_command.rb
krates-1.6.2 lib/kontena/cli/vault/read_command.rb