Sha256: 9add25ab3771d81b69fb56df79bc6e5a024fa179e78c09f07d074d6fd1a9ef29

Contents?: true

Size: 833 Bytes

Versions: 8

Compression:

Stored size: 833 Bytes

Contents

# frozen_string_literal: true

module Command
  class PsStop < Base
    NAME = "ps:stop"
    OPTIONS = [
      app_option(required: true),
      workload_option
    ].freeze
    DESCRIPTION = "Stops workloads in app"
    LONG_DESCRIPTION = <<~HEREDOC
      - Stops workloads in app
    HEREDOC
    EXAMPLES = <<~HEREDOC
      ```sh
      # Stops all workloads in app.
      cpl ps:stop -a $APP_NAME

      # Stops a specific workload in app.
      cpl ps:stop -a $APP_NAME -w $WORKLOAD_NAME
      ```
    HEREDOC

    def call
      workloads = [config.options[:workload]] if config.options[:workload]
      workloads ||= config[:app_workloads] + config[:additional_workloads]

      workloads.each do |workload|
        cp.workload_set_suspend(workload, true)
        progress.puts "#{workload} stopped"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cpl-0.4.1 lib/command/ps_stop.rb
cpl-0.4.0 lib/command/ps_stop.rb
cpl-0.3.3 lib/command/ps_stop.rb
cpl-0.3.2 lib/command/ps_stop.rb
cpl-0.3.1 lib/command/ps_stop.rb
cpl-0.3.0 lib/command/ps_stop.rb
cpl-0.2.0 lib/command/ps_stop.rb
cpl-0.1.0 lib/command/ps_stop.rb