class MU::Config::Job

Basket of Kittens config schema and parser logic. See modules/mu/providers/*/job.rb

Public Class Methods

schema() click to toggle source

Base configuration schema for a scheduled job @return [Hash]

# File modules/mu/config/job.rb, line 22
def self.schema
  {
    "type" => "object",
    "additionalProperties" => false,
    "description" => "A cloud provider-specific facility for triggered or scheduled tasks, such as AWS CloudWatch Events or Google Cloud Scheduler.",
    "properties" => {
      "name" => {
        "type" => "string"
      },
      "region" => MU::Config.region_primitive,
      "credentials" => MU::Config.credentials_primitive,
      "description" => {
        "type" => "string",
        "description" => "Human-readable description field for this job (this will field be overriden with the Mu deploy id on most providers unless +scrub_mu_isms+ is set)"
      },
      "schedule" => {
        "type" => "object",
        "description" => "A schedule on which to invoke this task, typically unix crontab style.",
        "properties" => {
          "minute" => {
            "type" => "string",
            "description" => "The minute of the hour at which to invoke this job, typically an integer between 0 and 59. This will be validated by the cloud provider, where other more human-readable values may be supported.",
            "default" => "0"
          },
          "hour" => {
            "type" => "string",
            "description" => "The hour at which to invoke this job, typically an integer between 0 and 23. This will be validated by the cloud provider, where other more human-readable values may be supported.",
            "default" => "*"
          },
          "day_of_month" => {
            "type" => "string",
            "description" => "The day of the month which to invoke this job, typically an integer between 1 and 31. This will be validated by the cloud provider, where other more human-readable values may be supported.",
            "default" => "*"
          },
          "month" => {
            "type" => "string",
            "description" => "The month in which to invoke this job, typically an integer between 1 and 12. This will be validated by the cloud provider, where other more human-readable values may be supported.",
            "default" => "*"
          },
          "day_of_week" => {
            "type" => "string",
            "description" => "The day of the week on which to invoke this job, typically an integer between 0 and 6. This will be validated by the cloud provider, where other more human-readable values may be supported.",
            "default" => "*"
          },
          "year" => {
            "type" => "string",
            "description" => "The year in which to invoke this job. Not honored by all cloud providers.",
            "default" => "*"
          }
        }
      }
    }
  }
end
validate(_job, _configurator) click to toggle source

Generic pre-processing of {MU::Config::BasketofKittens::jobs}, bare and unvalidated. @param _job [Hash]: The resource to process and validate @param _configurator [MU::Config]: The overall deployment configurator of which this resource is a member @return [Boolean]: True if validation succeeded, False otherwise

# File modules/mu/config/job.rb, line 81
def self.validate(_job, _configurator)
  ok = true

  ok
end