Skip to content

Commit

Permalink
Add MiqTask#deliver and execute
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrock committed Feb 23, 2024
1 parent cc03158 commit 947bbdd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/controllers/api/request_tasks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
module Api
class RequestTasksController < BaseController
include Api::Mixins::ResourceCancel

# NOTE: deliver setups the workflow and puts into the queue
# execute does the actual work (called from the workflow)
def execute_resource(type, id, data)
api_resource(type, id, "Executing") do |task|
task.execute_queue
end
end

# this kicks off the workflow surrounding this request
# for an automate/workflow task,
def deliver_resource(type, id, data)
api_resource(type, id, "Executing") do |task|
task.deliver_queue
end
end
end
end
4 changes: 4 additions & 0 deletions config/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,10 @@
:post:
- :name: cancel
:identifier: miq_request_control
- :name: deliver
:identifier: miq_request_control
- :name: execute
:identifier: miq_request_control
:subcollection_actions:
:get:
- :name: read
Expand Down

0 comments on commit 947bbdd

Please sign in to comment.