Sha256: 3f2a1060b4f2edd91677398df23d578eeec78c3172a65376e23b6721e7221562

Contents?: true

Size: 618 Bytes

Versions: 13

Compression:

Stored size: 618 Bytes

Contents

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

    def execute
      require_api_url
      require_current_grid

      token = require_token
      result = client(token).get("grids/#{current_grid}/secrets")

      column_width_paddings = '%-54s %-25.25s %-25.25s'
      puts column_width_paddings % ['NAME', 'CREATED AT', 'UPDATED AT']
      result['secrets'].sort_by { |s| s['name'] }.each do |secret|
        puts column_width_paddings % [secret['name'], secret['created_at'], secret['updated_at']]
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.4 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.3 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.2 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.1 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.0 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/vault/list_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/vault/list_command.rb