Defaults

The Defaults object in the JSON code allows you to define default parameter values for all objects at once.

SiteStandard is not supported as a global-level default. You must specify it on the folder level.

For example:

{"Defaults": {"Folder": {"SiteStandard": "Site Standard_1"}}}

The following example shows how to define scheduling criteria using the When parameter. This configures all jobs to run according to the same scheduling criteria. Note that if you also set a specific value at the job level, the job-level value overrides the value in the global-level Defaults section:

Copy
{
    "Defaults" : {
        "Host" : "HOST",
        "When" : {
            "WeekDays":["MON","TUE"],
            "FromTime":"1500",
            "ToTime":"1800"       
        }
    }
}

The following example shows how to define defaults for all objects of type Job:*:

Copy
{
    "Defaults" : {
        "Job": {
            "Host" : "HOST",
            "When" : {
                "WeekDays":["MON","TUE"],
                "FromTime":"1500",
                "ToTime":"1800"       
            }
        }
    }
 
}

The following example shows how to define defaults at the folder level that override defaults at the global level:

Copy
{
    "Folder1": {
         "Type": "Folder",
         "Defaults" : {
          "Job:Hadoop": {
              "Host" : "HOST1",
              "When" : {
                "WeekDays":["MON","TUE"],
                "FromTime":"1500",
                "ToTime":"1800"       
             }
           }
         }
    }
}

The following example shows how to define defaults that are user-defined objects, that is, objects with a Type property and a user-defined name. In this example, defaults are defined for an object named actionIfSuccess of type If. For each job that succeeds, an email is sent:

Copy
{
    "Defaults" : {
        "Job": {
            "Host" : "HOST",
            "actionIfSuccess" : {
                "Type": "If",
                "CompletionStatus":"OK",
                "mailTeam": {
                  "Type": "Mail",
                  "Message": "Job %%JOBNAME succeeded",
                  "Subject": "Success",
                  "To": "[email protected]"
                }
            }
        }
    }
}