Class: Kontena::Plugin::Cloud::Platform::User::ListCommand

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

Constant Summary

Constants included from CloudCommand

CloudCommand::PLATFORM_NOT_SELECTED_ERROR

Instance Method Summary collapse

Methods included from Common

#cached_platforms, #current_organization, #current_platform, #fetch_platforms, #fetch_platforms_for_org, #find_platform_by_name, #login_to_platform, #parse_platform_name, #platform_config_exists?, #prompt_platform, #require_platform

Methods included from CloudCommand

#verify_current_grid, #verify_current_master, #verify_current_master_token

Instance Method Details

#executeObject



12
13
14
15
16
17
18
19
# File 'lib/kontena/plugin/cloud/platform/user/list_command.rb', line 12

def execute
  require_platform(name)
  platform = find_platform_by_name(current_grid, current_organization)
  platform_users = cloud_client.get("/organizations/#{current_organization}/platforms/#{platform.id}/relationships/users")['data']
  print_table(platform_users) do |row|
    row.merge!(row['attributes'].merge(row['meta']))
  end
end

#fieldsObject



21
22
23
24
25
26
# File 'lib/kontena/plugin/cloud/platform/user/list_command.rb', line 21

def fields
  {
    username: 'username',
    role: 'role'
  }
end