class Beetle::Exec

Overview

Instances of this class are not created directly but rather by the Server object from the JSON payload associated with the /exec request.

The fields in the JSON payload are:

The server listening on webhook_url should accept the JSON encoded JobExec payload as a POST request.

If webhook_url is populated the error_400_on_threshold_exceeded value is ignored.

For example (payload for a /exec request):

{
    "name": "charges_local",
    "params": {
        "sc_mc": "mc"
    }
}

Here's an example of accessing the run-time parameters:

abstract class BCaaSTask < Beetle::Task
  def sc_mc
    ret = "mc"
    if p = @params
      if v = p["sc_mc"]?
        v = v.downcase
        v = "sc" unless v == "mc"
        ret = v
      end
    end
    ret
  end
end

Included Modules

Defined in:

beetle/exec.cr

Constructors

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]