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 Mar 29, 2024
1 parent 4b9bc10 commit 08ea5b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/controllers/api/request_tasks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
module Api
class RequestTasksController < BaseController
include Api::Mixins::ResourceCancel

# execute queues the work.
# this is typically called from within the workflow
def execute_resource(type, id, _data)
api_resource(type, id, "Executing") do |task|
raise BadRequestError, "Resource must be approved. state is #{task.state}" unless task.approved?
task.execute_queue
end
end
end
end
2 changes: 2 additions & 0 deletions config/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,8 @@
:post:
- :name: cancel
:identifier: miq_request_control
- :name: execute
:identifier: miq_request_control
:subcollection_actions:
:get:
- :name: read
Expand Down

0 comments on commit 08ea5b9

Please sign in to comment.