action rudder_create_rule { label: "Create a rule" description: "Create a new rule. You can specify a source rule to clone it." provider: rudder method: PUT path: "/rules" encoding: json input: { type: "object" properties: { category: { type: "string" format: "uuid" description: "The parent category id. If provided, the new rule will be in this parent category" } directives: { type: "array" description: "Directives linked to the rule" items: { type: "string" description: "Directive id" } } displayName: { type: "string" description: "Rule name" } enabled: { type: "boolean" description: "Is the rule enabled" } id: { type: "string" format: "uuid" description: "Rule id" } longDescription: { type: "string" description: "Rule documentation" } shortDescription: { type: "string" description: "One line rule description" } source: { type: "string" format: "uuid" description: "The id of the rule the clone will be based onto. If this parameter if provided, the new rule will be a clone of this source. Other value will override values from the source." } system: { type: "boolean" description: "If true it is an internal Rudder rule" } tags: { type: "array" items: { type: "object" properties: { name: { type: "string" description: "Value of the `name` key" } } } } targets: { type: "array" description: "Node and special groups targeted by that rule" items: { type: "object" required: ["include", "exclude"] properties: { exclude: { type: "object" description: "list of groups to exclude from rule application" properties: { or: { type: "array" items: { type: "string" description: "Node and special groups targeted by that rule" enum: ["special:all", "special:all_exceptPolicyServers", "special:all_policyServers", "policyServer:${policyServerId}", "group:${nodeGroupId}"] } } } } include: { type: "object" description: "list of groups to include in rule application" properties: { or: { type: "array" items: { type: "object" additionalProperties: true } } } } } } } } } output: { type: "object" required: ["action", "data", "result"] properties: { action: { type: "string" description: "The id of the action" enum: ["createRule"] } data: { type: "object" required: ["rules"] properties: { rules: { type: "array" items: { type: "object" properties: { directives: { type: "array" description: "Directives linked to the rule" items: { type: "string" description: "Directive id" } } displayName: { type: "string" description: "Rule name" } enabled: { type: "boolean" description: "Is the rule enabled" } id: { type: "string" format: "uuid" description: "Rule id" } longDescription: { type: "string" description: "Rule documentation" } shortDescription: { type: "string" description: "One line rule description" } system: { type: "boolean" description: "If true it is an internal Rudder rule" } tags: { type: "array" items: { type: "object" properties: { name: { type: "string" description: "Value of the `name` key" } } } } targets: { type: "array" description: "Node and special groups targeted by that rule" items: { type: "object" required: ["include", "exclude"] properties: { exclude: { type: "object" description: "list of groups to exclude from rule application" properties: { or: { type: "array" items: { type: "object" additionalProperties: true } } } } include: { type: "object" description: "list of groups to include in rule application" properties: { or: { type: "array" items: { type: "object" additionalProperties: true } } } } } } } } } } } } result: { type: "string" description: "Result of the request" enum: ["success", "error"] } } } }