Sha256: c2accf2a8b50ee889f46d779e9002f5741ed63d207945e6fdfbd0fc007e7b56f
Contents?: true
Size: 701 Bytes
Versions: 14
Compression:
Stored size: 701 Bytes
Contents
require_relative 'common' module Kontena::Cli::Stacks class ListCommand < Clamp::Command include Kontena::Cli::Common include Kontena::Cli::GridOptions include Common COLUMNS = "%-30s %-10s %-10s".freeze def execute require_api_url require_token list_stacks end private def list_stacks response = client(token).get("stacks/#{current_grid}") titles = ['NAME', 'SERVICES', 'STATE'] puts COLUMNS % titles response['stacks'].each do |stack| vars = [ stack['name'], stack['grid_services'].size, stack['state'] ] puts COLUMNS % vars end end end end
Version data entries
14 entries across 14 versions & 1 rubygems