lib/command/ps.rb in cpl-1.1.2 vs lib/command/ps.rb in cpl-1.2.0
- old
+ new
@@ -3,10 +3,11 @@
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
@@ -18,19 +19,22 @@
# 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: config[:default_location])
+ result = cp.workload_get_replicas(workload, location: location)
result["items"].each { |replica| puts replica }
end
end
end
end