Sha256: d1470ca7861971622dd7d3525413a3692a8ab18731e0e1eb9265c38ad70579d8
Contents?: true
Size: 1.01 KB
Versions: 3
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true module Command class Ps < Base NAME = "ps" OPTIONS = [ app_option(required: true), location_option, workload_option ].freeze DESCRIPTION = "Shows running replicas in app" LONG_DESCRIPTION = <<~DESC - Shows running replicas in app DESC EXAMPLES = <<~EX ```sh # Shows running replicas in app, for all workloads. cpl ps -a $APP_NAME # Shows running replicas in app, for a specific workload. cpl ps -a $APP_NAME -w $WORKLOAD_NAME ``` EX WITH_INFO_HEADER = false def call cp.fetch_gvc! location = config.location workloads = [config.options[:workload]] if config.options[:workload] workloads ||= config[:app_workloads] + config[:additional_workloads] workloads.each do |workload| cp.fetch_workload!(workload) result = cp.workload_get_replicas(workload, location: location) result["items"].each { |replica| puts replica } end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
cpl-1.4.0 | lib/command/ps.rb |
cpl-1.3.0 | lib/command/ps.rb |
cpl-1.2.0 | lib/command/ps.rb |