Class: Kontena::Plugin::Cloud::Region::ListCommand

Inherits:
Command
  • Object
show all
Includes:
Cli::Common, Cli::TableGenerator::Helper
Defined in:
lib/kontena/plugin/cloud/region/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/region/list_command.rb', line 7

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

#fieldsObject



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

def fields
  {
    id: 'id',
    name: 'name'
  }
end