class Kontena::Plugin::Cloud::Organization::ListCommand

Public Instance Methods

execute() click to toggle source
# File lib/kontena/plugin/cloud/organization/list_command.rb, line 9
def execute
  organizations = fetch_organizations
  print_table(organizations.map{|o| o.api_data}) do |row|
    row.merge!(row['attributes'])
    row['name'] = row['name']
    row['account-status'] = row['account-status'] == 'active' ? pastel.green(row['account-status']) : row['account-status']
    row['role'] = row['owner'] ? pastel.cyan('owner') : 'member'
  end
end
fields() click to toggle source
# File lib/kontena/plugin/cloud/organization/list_command.rb, line 19
def fields
  {
    'name' => 'name',
    'account status' => 'account-status',
    'your role' => 'role'
  }
end