Sha256: 3f4ad34e0aecce91877f7e919f942206465c69c85a493593c1ec99ae9ab34164
Contents?: true
Size: 1.05 KB
Versions: 22
Compression:
Stored size: 1.05 KB
Contents
require 'ey-core/cli/subcommand' module Ey module Core module Cli class Servers < Subcommand title "servers" summary "List servers you have access to" option :account, short: 'c', long: 'account', description: 'Filter by account name or id', argument: 'Account' option :environment, short: "-e", long: "environment", description: "Filter by environment.", argument: "environment" def handle puts TablePrint::Printer. new(servers, [{id: {width: 10}}, :role, :provisioned_id]). table_print end private def servers if option(:account) core_client.servers.all(account: core_account) elsif environment = option(:environment) (core_client.environments.get(environment) || core_client.environments.first(name: environment)).servers.all else core_client.servers.all end end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems