Class: Kontena::Plugin::Cloud::Image::ShowCommand

Inherits:
Command
  • Object
show all
Includes:
Cli::Common, Common, Util
Defined in:
lib/kontena/plugin/cloud/image/show_command.rb

Constant Summary

Constants included from CloudCommand

CloudCommand::PLATFORM_NOT_SELECTED_ERROR

Instance Method Summary collapse

Methods included from Common

#default_org, #image_distribution_url, #image_registry_client, #image_registry_url

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/image/show_command.rb', line 12

def execute
  repo = Kontena::Cli::Models::ImageRepo.new(image_registry_client.get("/repositories/#{name}")['data'])
  puts "#{name}:"
  puts "  created: #{ time_ago(repo.created_at.to_i)}"
  puts "  updated: #{ time_ago(repo.updated_at.to_i)}"
  puts "  pulls: #{repo.pulls}"
  puts "  pushes: #{repo.pushs}"
end