Sha256: 73d1a7ed5dbb889eb356910158646289b6cf9749d95bd753f2be5ca680cff099

Contents?: true

Size: 690 Bytes

Versions: 14

Compression:

Stored size: 690 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?

              puts "Requesting cancellation on #{prettify_operation(o)}..."
              o.update!(cancelled: true)
            end
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
aptible-cli-0.14.1 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.14.0 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.13.0 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.12.0 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.11.2 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.11.1 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.11.0 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.10.0 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.9.0 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.8.6 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.8.5 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.8.4 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.8.3 lib/aptible/cli/subcommands/operation.rb
aptible-cli-0.8.2 lib/aptible/cli/subcommands/operation.rb