Sha256: 58b071ff28be6ba63df71833aa595e2f0ae967cd8eea404ca1eecf86d5478e03

Contents?: true

Size: 721 Bytes

Versions: 24

Compression:

Stored size: 721 Bytes

Contents

module Aptible
  module CLI
    module Subcommands
      module Operation
        def self.included(thor)
          thor.class_eval do
            include Helpers::Token
            include Helpers::Operation

            desc 'operation:cancel OPERATION_ID', 'Cancel a running operation'
            define_method 'operation:cancel' do |operation_id|
              o = Aptible::Api::Operation.find(operation_id, token: fetch_token)
              raise "Operation ##{operation_id} not found" if o.nil?

              m = "Requesting cancellation on #{prettify_operation(o)}..."
              CLI.logger.info m
              o.update!(cancelled: true)
            end
          end
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
aptible-cli-0.19.3 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.19.2 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.19.1 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.19.0 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.18.3 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.18.2 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.18.1 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.18.0 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.17.2 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.17.1 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.17.0 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.16.9 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.16.8 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.16.7 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.16.6 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.16.5 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.16.4 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.16.3 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.16.2 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.16.1 lib/aptible/cli/subcommands/operation.rb