Class: Kontena::Plugin::Cloud::Token::ListCommand

Inherits:
Command
  • Object
show all
Includes:
Cli::Common, Cli::TableGenerator::Helper
Defined in:
lib/kontena/plugin/cloud/token/list_command.rb

Constant Summary

Constants included from CloudCommand

CloudCommand::PLATFORM_NOT_SELECTED_ERROR

Instance Method Summary collapse

Methods included from CloudCommand

#verify_current_grid, #verify_current_master, #verify_current_master_token

Instance Method Details

#executeObject



7
8
9
10
11
12
# File 'lib/kontena/plugin/cloud/token/list_command.rb', line 7

def execute
  tokens = cloud_client.get('/user/personal_access_tokens')['data']
  print_table(tokens) do |row|
    row.merge!(row['attributes'])
  end
end

#fieldsObject



14
15
16
17
18
19
20
# File 'lib/kontena/plugin/cloud/token/list_command.rb', line 14

def fields
  {
    id: 'id',
    created: 'created-at',
    name: 'name'
  }
end