v2

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

Create a directive

Create a new directive from provided parameters. You can specify a source directive to clone it.

put/directives

Request body

sourcestring uuid

The id of the directive the clone will be based onto. If this parameter if provided, the new directive will be a clone of this source. Other value will override values from the source.

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

tagsobject[]
parametersobject

Directive parameters (depends on the source technique)

Example request

{
  "source": "b9f6d98a-28bc-4d80-90f7-d2f14269e215",
  "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,
  "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'createDirective' 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"
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}