class WarpEngine::Api::Admin::OperationsController
Runs the REST operations of the Admin API. Every operation in WarpEngine::AdminApi::Registry is routed here with its key in the operation route default.
Constants
- IGNORED_PARAMS
-
Request parameters Rails adds for routing, removed before the parameters reach an operation.
Public Instance Methods
Source
# File app/controllers/warp_engine/api/admin/operations_controller.rb, line 19 def execute operation = WarpEngine::AdminApi::Registry.find(params[:operation]) raise WarpEngine::AdminApi::Error.not_found if operation.nil? throttle! if current_principal result = WarpEngine::AdminApi::Runner.call( operation, principal: current_principal, params: operation_params, base_url: engine_base_url, via: :http ) if result.status == 204 head :no_content else render json: result.payload, status: result.status end end
Any Admin API operation route, for example GET <admin path>/softwares.
Looks up the operation (404 when unknown), applies the rate limit when a principal is present, and runs it through WarpEngine::AdminApi::Runner with the request parameters. Renders the result payload as JSON with the result’s status, or 204 with no body. Authentication and scope checks are the runner’s.