v2

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

Update a directive details

Update directive information

post/directives/{directiveId}

Path parameters

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

Id of the directive

Request body

idstring uuid

Directive id

displayNamestring

Human readable name of the directive

shortDescriptionstring

One line directive description

longDescriptionstring markdown

Description of the technique (rendered as markdown)

techniqueNamestring

Directive id

techniqueVersionstring

Directive id

priorityinteger

Directive priority. 0 has highest priority.

enabledboolean

Is the directive enabled

systemboolean

If true it is an internal Rudder directive

policyMode'enforce' | 'audit'

Policy mode of the directive

tagsobject[]
parametersobject

Directive parameters (depends on the source technique)

Example request

{
  "id": "91252ea2-feb2-412d-8599-c6945fee02c4",
  "displayName": "91252ea2-feb2-412d-8599-c6945fee02c4",
  "shortDescription": "91252ea2-feb2-412d-8599-c6945fee02c4",
  "longDescription": "# Documentation\n* [Ticket link](https://tickets.example.com/issues/3456)",
  "techniqueName": "userManagement",
  "techniqueVersion": "8.0",
  "priority": 5,
  "enabled": true,
  "policyMode": "audit",
  "tags": [
    {
      "customer": "MyCompany"
    }
  ],
  "parameters": {
    "name": "sections",
    "sections": [
      {
        "section": {
          "name": "File to manage",
          "vars": [
            {
              "var": {
                "name": "FILE_AND_FOLDER_MANAGEMENT_ACTION",
                "value": "copy"
              }
            },
            {
              "var": {
                "name": "FILE_AND_FOLDER_MANAGEMENT_SOURCE",
                "value": "/vagrant/node.sh"
              }
            },
            {
              "var": {
                "name": "FILE_AND_FOLDER_MANAGEMENT_SYMLINK_ENFORCE",
                "value": "false"
              }
            }
          ],
          "sections": [
            {
              "section": {
                "name": "File",
                "vars": [
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_PATH",
                      "value": "/root/test"
                    }
                  }
                ]
              }
            },
            {
              "section": {
                "name": "File cleaning options",
                "vars": [
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_DELETION_DAYS",
                      "value": "0"
                    }
                  },
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_DELETION_OPTION",
                      "value": "none"
                    }
                  },
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_DELETION_PATTERN",
                      "value": ".*"
                    }
                  }
                ]
              }
            },
            {
              "section": {
                "name": "Permissions",
                "vars": [
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_CHECK_PERMISSIONS",
                      "value": "false"
                    }
                  },
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_GROUP",
                      "value": ""
                    }
                  },
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_OWNER",
                      "value": ""
                    }
                  },
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_PERM",
                      "value": "000"
                    }
                  },
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_RECURSIVE",
                      "value": "1"
                    }
                  }
                ]
              }
            },
            {
              "section": {
                "name": "Post-modification hook",
                "vars": [
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_COMMAND",
                      "value": ""
                    }
                  },
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_RUN",
                      "value": "false"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}

Response

Directives information

result'success' | 'error' required

Result of the request

action'updateDirective' required

The id of the action

Example response

{
  "data": {
    "directives": [
      {
        "id": "91252ea2-feb2-412d-8599-c6945fee02c4",
        "displayName": "91252ea2-feb2-412d-8599-c6945fee02c4",
        "shortDescription": "91252ea2-feb2-412d-8599-c6945fee02c4",
        "longDescription": "# Documentation\n* [Ticket link](https://tickets.example.com/issues/3456)",
        "techniqueName": "userManagement",
        "techniqueVersion": "8.0",
        "priority": 5,
        "enabled": true,
        "policyMode": "audit",
        "tags": [
          {
            "customer": "MyCompany"
          }
        ],
        "parameters": {
          "name": "sections",
          "sections": [
            {
              "section": {
                "name": "File to manage",
                "vars": [
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_ACTION",
                      "value": "copy"
                    }
                  },
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_SOURCE",
                      "value": "/vagrant/node.sh"
                    }
                  },
                  {
                    "var": {
                      "name": "FILE_AND_FOLDER_MANAGEMENT_SYMLINK_ENFORCE",
                      "value": "false"
                    }
                  }
                ],
                "sections": [
                  {
                    "section": {
                      "name": "File",
                      "vars": [
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_MANAGEMENT_PATH",
                            "value": "/root/test"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "section": {
                      "name": "File cleaning options",
                      "vars": [
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_DELETION_DAYS",
                            "value": "0"
                          }
                        },
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_DELETION_OPTION",
                            "value": "none"
                          }
                        },
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_DELETION_PATTERN",
                            "value": ".*"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "section": {
                      "name": "Permissions",
                      "vars": [
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_MANAGEMENT_CHECK_PERMISSIONS",
                            "value": "false"
                          }
                        },
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_MANAGEMENT_GROUP",
                            "value": ""
                          }
                        },
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_MANAGEMENT_OWNER",
                            "value": ""
                          }
                        },
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_MANAGEMENT_PERM",
                            "value": "000"
                          }
                        },
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_MANAGEMENT_RECURSIVE",
                            "value": "1"
                          }
                        }
                      ]
                    }
                  },
                  {
                    "section": {
                      "name": "Post-modification hook",
                      "vars": [
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_COMMAND",
                            "value": ""
                          }
                        },
                        {
                          "var": {
                            "name": "FILE_AND_FOLDER_MANAGEMENT_POST_HOOK_RUN",
                            "value": "false"
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}