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
kontena-cli-1.4.1.rc1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.1.pre1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.3.5 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.3.5.rc1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.rc2 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.rc1 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre14 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre13 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre12 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre11 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre10 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre9 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre8 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre7 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre6 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre5 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre4 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre3 lib/kontena/cli/vault/read_command.rb
kontena-cli-1.4.0.pre2 lib/kontena/cli/vault/read_command.rb