v2

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

Update a rule details

Update the details of a rule

post/rules/{ruleId}

Path parameters

ruleIdstring uuid required
Example:9a1773c9-0889-40b6-be89-f6504443ac1b

Id of the target rule

Request body

idstring uuid

Rule id

displayNamestring

Rule name

shortDescriptionstring

One line rule description

longDescriptionstring

Rule documentation

categorystring uuid

The parent category id.

directivesstring[]

Directives linked to the rule

enabledboolean

Is the rule enabled

systemboolean

If true it is an internal Rudder rule

tagsobject[]

Example request

{
  "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'updateRule' 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",
        "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"
          }
        ]
      }
    ]
  }
}