rules.json Attributes

The rules.json file attributes are:

AttributeRequiredDescription
constantsNoContainer attribute only - array of constants to be defined, can be empty if no constants are needed
constants –> nameNoUnique name for a constant, used to reference the constant in other places
constants –> valueNoValue of the constant
rulesNoContainer attribute only - array of rules to be defined, can be empty if no rules are needed
labelNo 
rules –> nameYesUnique name for a rule
rules –> conditionNoIf condition is met, then the rule will run, if the condition is not met, the rule will not run.
rules –> appliesToYesContainer attribute only - array of assets the rule should be be applied to (dashboards, dataflow, recipes, schemas, XMDs)
rules –> appliesTo –> nameNo. Best practice is to specify name. If null, defaults to *, and rule applies to all template assets.Name of asset (can be * in case of dashboards for all dashboards); must match the “name” defined in the template-info for the asset
rules –> appliesTo –> typeNo. Best practice is to specify type. If null, defaults to *, and rule applies to all asset types*Type of asset (dashboard, workflow, lens, schema, xmd)
rules –> actionsYesContainer attribute only - array of actions the rule should invoke (one or more action is necessary)
rules –> actions –> actionYesType of action - set, add, delete, put, replace
rules –> actions –> descriptionNoDescription of the rule action - for maintainability
rules –> actions –> pathYesJSONPath to take the action on
rules –> actions –> valueNoValue needed for set/add/put, defines the value to put in the JSONPath
rules –> actions –> indexNoIndex needed for add action only
rules –> actions –> keyNoKey needed for put action only

See Also