v2

latestOpenAPI 3.1.0CC-BY-SA 2.02026-07-2617789528.6 KB
Rules

Create a rule

Create a new rule. You can specify a source rule to clone it.

put/rules

Request body

sourcestring uuid

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.

idstring uuid

Rule id

displayNamestring

Rule name

shortDescriptionstring

One line rule description

longDescriptionstring

Rule documentation

categorystring uuid

The parent category id. If provided, the new rule will be in this parent category

directivesstring[]

Directives linked to the rule

enabledboolean

Is the rule enabled

systemboolean

If true it is an internal Rudder rule

tagsobject[]

Example request

{
  "source": "b9f6d98a-28bc-4d80-90f7-d2f14269e215",
  "id": "0c1713ae-cb9d-4f7b-abda-ca38c5d643ea",
  "displayName": "Security policy",
  "shortDescription": "Baseline applying CIS guidelines",
  "longDescription": "This rules should be applied to all Linux nodes required basic hardening",
  "category": "38e0c6ea-917f-47b8-82e0-e6a1d3dd62ca",
  "targets": [
    {
      "include": {
        "or": [
          "special:all"
        ]
      },
      "exclude": {
        "or": [
          "policyServer:root",
          "group:cd377524-808b-4b42-8724-6ef308efeac7"
        ]
      }
    }
  ],
  "enabled": true,
  "tags": [
    {
      "customer": "MyCompany"
    }
  ]
}

Response

Rules information

result'success' | 'error' required

Result of the request

action'createRule' required

The id of the action

Example response

{
  "data": {
    "rules": [
      {
        "id": "0c1713ae-cb9d-4f7b-abda-ca38c5d643ea",
        "displayName": "Security policy",
        "shortDescription": "Baseline applying CIS guidelines",
        "longDescription": "This rules should be applied to all Linux nodes required basic hardening",
        "directives": [
          "ff3bf651-3fce-49bc-8bf3-85132fa9b875"
        ],
        "targets": [
          {
            "include": {
              "or": [
                "special:all"
              ]
            },
            "exclude": {
              "or": [
                "policyServer:root",
                "group:cd377524-808b-4b42-8724-6ef308efeac7"
              ]
            }
          }
        ],
        "enabled": true,
        "tags": [
          {
            "customer": "MyCompany"
          }
        ],
        "policyMode": "mixed",
        "status": {
          "value": "Partially applied",
          "details": "Directive 'test parameter name' disabled"
        }
      }
    ]
  }
}