Sha256: 8be57cfc597f6cc81067948b190bdf5e0ccacb804bf605525f8cc2c53140bbda

Contents?: true

Size: 705 Bytes

Versions: 34

Compression:

Stored size: 705 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Master::Token
  class ShowCommand < Kontena::Command

    parameter "TOKEN_OR_ID", "Access token or access token id"

    include Kontena::Cli::Common
    include Common

    requires_current_master
    requires_current_master_token

    option '--id', :flag, "Only output access token id", hidden: true

    def execute
      data = client.get("/oauth2/tokens/#{token_or_id}")
      output = token_data_to_hash(data)

      if id?
        puts output[:id]
        return
      end

      id = output.delete(:id)
      puts '%s:' % id
      output.each do |key, value|
        puts "  %s: %s" % [key, value.nil? ? '-' : value]
      end
    end
  end
end


Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/cli/master/token/show_command.rb
krates-1.7.10 lib/kontena/cli/master/token/show_command.rb
krates-1.7.9 lib/kontena/cli/master/token/show_command.rb
krates-1.7.8 lib/kontena/cli/master/token/show_command.rb
krates-1.7.7 lib/kontena/cli/master/token/show_command.rb
krates-1.7.6 lib/kontena/cli/master/token/show_command.rb
krates-1.7.5 lib/kontena/cli/master/token/show_command.rb
krates-1.7.4 lib/kontena/cli/master/token/show_command.rb
krates-1.7.3 lib/kontena/cli/master/token/show_command.rb
krates-1.7.2 lib/kontena/cli/master/token/show_command.rb
krates-1.7.1 lib/kontena/cli/master/token/show_command.rb
krates-1.7.0 lib/kontena/cli/master/token/show_command.rb
krates-1.6.9 lib/kontena/cli/master/token/show_command.rb
krates-1.6.8 lib/kontena/cli/master/token/show_command.rb
krates-1.6.7 lib/kontena/cli/master/token/show_command.rb
krates-1.6.6 lib/kontena/cli/master/token/show_command.rb
krates-1.6.5 lib/kontena/cli/master/token/show_command.rb
krates-1.6.4 lib/kontena/cli/master/token/show_command.rb
krates-1.6.3 lib/kontena/cli/master/token/show_command.rb
krates-1.6.2 lib/kontena/cli/master/token/show_command.rb