Module: ForemanTasks
- Extended by:
- Algebrick::Matching, Algebrick::TypeCheck
- Defined in:
- app/controllers/foreman_tasks/api/tasks_controller.rb,
lib/foreman_tasks.rb,
lib/foreman_tasks/engine.rb,
lib/foreman_tasks/cleaner.rb,
lib/foreman_tasks/dynflow.rb,
lib/foreman_tasks/version.rb,
lib/foreman_tasks/triggers.rb,
lib/foreman_tasks/task_error.rb,
app/models/foreman_tasks/lock.rb,
app/models/foreman_tasks/task.rb,
lib/foreman_tasks/authorizer_ext.rb,
lib/foreman_tasks/dynflow/daemon.rb,
lib/foreman_tasks/test_extensions.rb,
lib/foreman_tasks/dynflow/persistence.rb,
app/helpers/foreman_tasks/tasks_helper.rb,
lib/foreman_tasks/dynflow/configuration.rb,
app/models/foreman_tasks/task/summarizer.rb,
app/models/foreman_tasks/task/dynflow_task.rb,
lib/foreman_tasks/dynflow/console_authorizer.rb,
app/controllers/foreman_tasks/tasks_controller.rb,
app/models/foreman_tasks/task/status_explicator.rb,
app/models/foreman_tasks/concerns/action_subject.rb,
app/models/foreman_tasks/concerns/action_triggering.rb,
app/models/foreman_tasks/concerns/host_action_subject.rb,
app/models/foreman_tasks/task/task_cancelled_exception.rb,
app/models/foreman_tasks/concerns/architecture_action_subject.rb,
app/controllers/foreman_tasks/concerns/hosts_controller_extension.rb
Overview
Copyright 2013 Red Hat, Inc.
This software is licensed to you under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License (GPLv2) or (at your option) any later version. There is NO WARRANTY for this software, express or implied, including the implied warranties of MERCHANTABILITY, NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 along with this software; if not, see www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
Defined Under Namespace
Modules: Api, AuthorizerExt, Concerns, TasksHelper, TestExtensions, Triggers
Classes: Cleaner, Dynflow, Engine, Lock, Task, TaskError, TasksController
Constant Summary
collapse
- VERSION =
"0.7.6"
Class Method Summary
collapse
-
.async_task(action, *args, &block) ⇒ Object
-
.delay(action, delay_options, *args) ⇒ Object
-
.dynflow ⇒ Object
-
.sync_task(action, *args, &block) ⇒ Object
-
.table_name_prefix ⇒ Object
-
.trigger(action, *args, &block) ⇒ Object
-
.trigger_task(async, action, *args, &block) ⇒ Object
Instance Method Summary
collapse
Class Method Details
.async_task(action, *args, &block) ⇒ Object
34
35
36
|
# File 'lib/foreman_tasks.rb', line 34
def self.async_task(action, *args, &block)
trigger_task true, action, *args, &block
end
|
.delay(action, delay_options, *args) ⇒ Object
44
45
46
47
|
# File 'lib/foreman_tasks.rb', line 44
def self.delay(action, delay_options, *args)
result = dynflow.world.delay action, delay_options, *args
ForemanTasks::Task::DynflowTask.find_by_external_id!(result.id)
end
|
.sync_task(action, *args, &block) ⇒ Object
38
39
40
41
42
|
# File 'lib/foreman_tasks.rb', line 38
def self.sync_task(action, *args, &block)
trigger_task(false, action, *args, &block).tap do |task|
raise TaskError.new(task) if task.execution_plan.error?
end
end
|
.table_name_prefix ⇒ Object
110
111
112
|
# File 'lib/foreman_tasks/engine.rb', line 110
def self.table_name_prefix
"foreman_tasks_"
end
|
.trigger(action, *args, &block) ⇒ Object
17
18
19
|
# File 'lib/foreman_tasks.rb', line 17
def self.trigger(action, *args, &block)
dynflow.world.trigger action, *args, &block
end
|
.trigger_task(async, action, *args, &block) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/foreman_tasks.rb', line 21
def self.trigger_task(async, action, *args, &block)
Match! async, true, false
match trigger(action, *args, &block),
(on ::Dynflow::World::PlaningFailed.(error: ~any) do |error|
raise error
end),
(on ::Dynflow::World::Triggered.(execution_plan_id: ~any, future: ~any) do |id, finished|
finished.wait if async == false
ForemanTasks::Task::DynflowTask.find_by_external_id!(id)
end)
end
|
Instance Method Details
#use_relative_model_naming ⇒ Object
114
115
116
|
# File 'lib/foreman_tasks/engine.rb', line 114
def use_relative_model_naming
true
end
|