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