Rudder API
Download OpenAPI specification: openapi.yml [blocked]
Introduction
Rudder exposes a REST API, enabling the user to interact with Rudder without using the webapp, for example in scripts or cronjobs.
Versioning
Each time the API is extended with new features (new functions, new parameters, new responses, ...), it will be assigned a new version number. This will allow you
to keep your existing scripts (based on previous behavior). Versions will always be integers (no 2.1 or 3.3, just 2, 3, 4, ...) or latest.
You can change the version of the API used by setting it either within the url or in a header:
- the URL: each URL is prefixed by its version id, like
/api/version/function.
- the HTTP headers. You can add the X-API-Version header to your request. The value needs to be an integer or
latest.
In the future, we may declare some versions as deprecated, in order to remove them in a later version of Rudder, but we will never remove any versions without warning, or without a safe period of time to allow migration from previous versions.
Existing versions
Response format
All responses from the API are in the JSON format.
-
Success responses are sent with the 200 HTTP (Success) code
-
Error responses are sent with a HTTP error code (mostly 5xx...)
HTTP method
Rudder's REST API is based on the usage of . We use them to indicate what action will be done by the request. Currently, we use four of them:
-
GET: search or retrieve information (get rule details, get a group, ...)
-
PUT: add new objects (create a directive, clone a Rule, ...)
-
DELETE: remove objects (delete a node, delete a parameter, ...)
-
POST: update existing objects (update a directive, reload a group, ...)
Parameters
General parameters
Some parameters are available for almost all API functions. They will be described in this section. They must be part of the query and can't be submitted in a JSON form.
Available for all requests
Available for modification requests (PUT/POST/DELETE)
Passing parameters
Parameters to the API can be sent:
-
As part of the URL for resource identification
-
As data for POST/PUT requests
-
Directly in JSON format
-
As request arguments
-
As part of the URL for resource identification
Parameters in URLs are used to indicate which resource you want to interact with. The function will not work if this resource is missing.
CAUTION: To avoid surprising behavior, do not put a '/' at the end of an URL: it would be interpreted as '/[empty string parameter]' and redirected to '/index', likely not what you wanted to do.
Sending data for POST/PUT requests
Directly in JSON format
JSON format is the preferred way to interact with Rudder API for creating or updating resources.
You'll also have to set the Content-Type header to application/json (without it the JSON content would be ignored).
In a curl POST request, that header can be provided with the -H parameter:
The supplied file must contain a valid JSON: strings need quotes, booleans and integers don't, etc.
The (human readable) format is:
Here is an example with inlined data:
You can also pass a supply the JSON in a file:
Note that the general parameters view in the previous chapter cannot be passed in a JSON, and you will need to pass them a URL parameters if you want them to be taken into account (you can't mix JSON and request parameters):
Request parameters
In some cases, when you have little, simple data to update, JSON can feel bloated. In such cases, you can use request parameters. You will need to pass one parameter for each data you want to change.
Parameters follow the following schema:
You can pass parameters by two means:
- As query parameters: At the end of your url, put a ? then your first parameter and then a & before next parameters. In that case, parameters need to be encoded]
- As request data: You can pass those parameters in the request data, they won't figure in the URL, making it lighter to read, You can pass a file that contains data.
# Version 10curl -X GET -H "X-API-Token: yourToken" https://rudder.example.com/rudder/api/10/rules# Latestcurl -X GET -H "X-API-Token: yourToken" https://rudder.example.com/rudder/api/latest/rules# Wrong (not an integer) => 404 not foundcurl -X GET -H "X-API-Token: yourToken" https://rudder.example.com/rudder/api/3.14/rules# Version 10curl -X GET -H "X-API-Token: yourToken" -H "X-API-Version: 10" https://rudder.example.com/rudder/api/rules# Wrong => Error response indicating which versions are availablecurl -X GET -H "X-API-Token: yourToken" -H "X-API-Version: 3.14" https://rudder.example.com/rudder/api/rules{ "action": "The name of the called function", "id": "The ID of the element you want, if relevant", "result": "The result of your action: success or error", "data": "Only present if this is a success and depends on the function, it's usually a JSON object", "errorDetails": "Only present if this is an error, it contains the error message"}# Get the Rule of ID "id"curl -H "X-API-Token: yourToken" https://rudder.example.com/rudder/api/latest/rules/idcurl -X POST -H "Content-Type: application/json" ...{ "key1": "value1", "key2": false, "key3": 42}# Update the Rule 'id' with a new name, disabled, and setting it one directivecurl -X POST -H "X-API-Token: yourToken" -H "Content-Type: application/json"https://rudder.example.com/rudder/api/rules/latest/{id} -d '{ "displayName": "new name", "enabled": false, "directives": "directiveId"}'# Update the Rule 'id' with a new name, disabled, and setting it one directivecurl -X POST -H "X-API-Token: yourToken" -H "Content-Type: application/json" https://rudder.example.com/rudder/api/rules/latest/{id} -d @jsonParam# Update the Rule 'id' with a new name, disabled, and setting it one directive with reason message "Reason used"curl -X POST -H "X-API-Token: yourToken" -H "Content-Type: application/json" "https://rudder.example.com/rudder/api/rules/latest/{id}?reason=Reason used" -d @jsonParam -d "reason=Reason ignored"key=value# Update the Rule 'id' with a new name, disabled, and setting it one directivecurl -X POST -H "X-API-Token: yourToken" https://rudder.example.com/rudder/api/rules/latest/{id}?"displayName=my new name"&"enabled=false"&"directives=aDirectiveId"# Update the Rule 'id' with a new name, disabled, and setting it one directive (in file directive-info.json)curl -X POST -H "X-API-Token: yourToken"https://rudder.example.com/rudder/api/rules/latest/{id} -d "displayName=my new name" -d "enabled=false" -d @directive-info.json- Homepage
- https://api.apis.guru/v2/specs/rudder.example.local/16.json
- Provider
- rudder.example.local
- OpenAPI version
- 3.0.3
- Spec (JSON)
- https://api.apis.guru/v2/specs/rudder.example.local/16/openapi.json
- Spec (YAML)
- https://api.apis.guru/v2/specs/rudder.example.local/16/openapi.yaml
Tools (136)
Extracted live via the executor SDK.
-
apiInfo.apiGeneralInformationsList all endpoints and their version
-
apiInfo.apiInformationsGet the description and the list of supported version for one API endpoint
-
apiInfo.apiSubInformationsGet all endpoints in the given section with their supported version.
-
archives.exportGet a ZIP archive or rules, directives, techniques and groups with optionally their dependencies
-
archives.importImport a ZIP archive of techniques, directives, groups and rules in a saved in a normalized format into Rudder
-
branding.getBrandingConfGet all web interface customization parameters
-
branding.reloadBrandingConfReload the configuration from file
-
branding.updateBRandingConfchange color, logo, label etc.
-
changeRequests.acceptChangeRequestAccept a change request
-
changeRequests.changeRequestDetailsGet a change request details
-
changeRequests.declineChangeRequestRefuse a change request
-
changeRequests.listChangeRequestsList all change requests
-
changeRequests.listUsersList all validated and unvalidated users
-
changeRequests.removeValidatedUserThe user is again subject to workflow validation
-
changeRequests.saveWorkflowUserAdd and remove user from validated users
-
changeRequests.updateChangeRequestUpdate a change request
-
compliance.getGlobalComplianceGet current global compliance of a Rudder server
-
compliance.getNodeComplianceGet current compliance of a node of a Rudder server
-
compliance.getNodesComplianceGet current compliance of all the nodes of a Rudder server
-
compliance.getRuleComplianceGet current compliance of a rule of a Rudder server
-
compliance.getRulesComplianceGet current compliance of all the rules of a Rudder server
-
cve.checkCveTrigger a CVE check
-
cve.getAllCveGet all CVE details
-
cve.getCveCheckConfigurationGet CVE check config
-
cve.getCveListGet CVE details, from a list passed as parameter
-
cve.getLastCveCheckGet last CVE check result
-
cve.readCvEfromFsUpdate CVE database from file system
-
cve.updateCveUpdate CVE database from remote source
-
cve.updateCveCheckConfigurationUpdate cve check config
-
dataSources.createDataSourceCreate a new data source
-
dataSources.deleteDataSourceDelete a data source configuration
-
dataSources.getAllDataSourcesGet the configuration of all present data sources
-
dataSources.getDataSourceGet the configuration of a data source
-
dataSources.reloadAllDatasourcesAllNodesUpdate properties from all data source on all nodes. The call is asynchronous.
-
dataSources.reloadAllDatasourcesOneNodeUpdate properties from all data sources on one nodes. The call is asynchronous.
-
dataSources.reloadOneDatasourceAllNodesUpdate properties from all data source on all nodes. The call is asynchronous.
-
dataSources.reloadOneDatasourceOneNodeUpdate properties from a data source on one nodes. The call is asynchronous.
-
dataSources.updateDataSourceUpdate the configuration of a data source
-
directives.checkDirectiveCheck that update on a directive is valid
-
directives.createDirectiveCreate a new directive from provided parameters. You can specify a source directive to clone it.
-
directives.deleteDirectiveDelete a directive
-
directives.directiveDetailsGet all information about a given directive
-
directives.listDirectivesList all directives
-
directives.updateDirectiveUpdate directive information
-
groups.createGroupCreate a new group based in provided parameters
-
groups.createGroupCategoryCreate a new group category
-
groups.deleteGroupUpdate detailed information about a group
-
groups.deleteGroupCategoryDelete a group category. It must have no child groups and no children categories.
-
groups.getGroupCategoryDetailsGet detailed information about a group category
-
groups.getGroupTreeGet all available groups and their categories in a tree
-
groups.groupDetailsGet detailed information about a group
-
groups.listGroupsList all groups
-
groups.reloadGroupRecompute the content of a group
-
groups.updateGroupUpdate detailed information about a group
-
groups.updateGroupCategoryUpdate detailed information about a group category
-
inventories.fileWatcherRestartRestart the inventory watcher if necessary
-
inventories.fileWatcherStartStart the inventory watcher if necessary
-
inventories.fileWatcherStopStop the inventory watcher if necessary
-
inventories.queueInformationProvide information about the current state of the inventory processor
-
inventories.uploadInventoryUpload an inventory to the web application
-
nodes.applyNodeThis API allows to trigger an agent run on the target node. Response is a stream of the actual agent run on the node.
-
nodes.applyPolicyAllNodesThis API allows to trigger an agent run on all nodes. Response contains a json stating if agent could be started on each node, but not if the run went fine and do not display any output from it. You can see the result of the run in Rudder web interface or in the each agent logs.
-
nodes.changePendingNodeStatusAccept or refuse a pending node
-
nodes.createNodesUse the provided array of node information to create new nodes
-
nodes.deleteNodeRemove a node from the Rudder server. It won't be managed anymore.
-
nodes.getNodesStatusGet acceptation status (pending, accepted, deleted, unknown) of a list of nodes
-
nodes.listAcceptedNodesGet information about the nodes managed by the target server
-
nodes.listPendingNodesGet information about the nodes pending acceptation
-
nodes.nodeDetailsGet details about a given node
-
nodes.nodeInheritedPropertiesThis API returns all node properties for a node, including group inherited ones.
-
nodes.updateNodeUpdate node settings and properties
-
parameters.createParameterCreate a new global parameter
-
parameters.deleteParameterDelete an existing parameter
-
parameters.listParametersGet the current value of all the global parameters
-
parameters.parameterDetailsGet the current value of a given parameter
-
parameters.updateParameterUpdate the properties of a parameter
-
rules.createRuleCreate a new rule. You can specify a source rule to clone it.
-
rules.createRuleCategoryCreate a new rule category
-
rules.deleteRuleDelete a rule.
-
rules.deleteRuleCategoryDelete a group category. It must have no child groups and no children categories.
-
rules.getRuleCategoryDetailsGet detailed information about a rule category
-
rules.getRuleTreeGet all available rules and their categories in a tree
-
rules.listRulesList all rules
-
rules.ruleDetailsGet the details of a rule
-
rules.updateRuleUpdate the details of a rule
-
rules.updateRuleCategoryUpdate detailed information about a rule category
-
scaleOutRelay.demoteToNodeDemote a relay to a simple node.
-
scaleOutRelay.promoteToRelayPromote a node to relay
-
secretManagement.addSecretAdd a secret
-
secretManagement.deleteSecretRemove the secret by his unique name
-
secretManagement.getAllSecretsGet the list of all secrets without their value
-
secretManagement.getSecretGet one secret by his unique name
-
secretManagement.updateSecretUpdate a secret and override the value, the name cannot be overridden
-
settings.getAllowedNetworksGet the list of allowed networks for a policy server
-
settings.getAllSettingsGet the current value of all the settings
-
settings.getSettingGet the current value of a specific setting
-
settings.modifyAllowedNetworksAdd or delete allowed networks for a policy server
-
settings.modifySettingSet the current value of a specific setting
-
settings.setAllowedNetworksSet the list of allowed networks for a policy server
-
status.noneAn unauthenticated API to check if Rudder web application is up and running. Be careful: this API does not follow other Rudder's API convention:
- it is not versioned, so the path is just
/api/status; - it returns a plain text message.
- it is not versioned, so the path is just
-
system.createArchiveCreate new archive of the given kind
-
system.getHealthcheckResultRun and get the result of all checks
-
system.getStatusGet information about current server status
-
system.getSystemInfoGet information about the server version
-
system.getZipArchiveGet an archive of the given kind as a zip
-
system.listArchivesList configuration archives
-
system.purgeSoftwareStart the software cleaning batch asynchronously.
-
system.regeneratePoliciesTrigger a full policy generation
-
system.reloadAllReload both techniques and dynamic groups
-
system.reloadGroupsReload dynamic groups
-
system.reloadTechniquesReload techniques from local technique library
-
system.restoreArchiveRestore an archive of the given kind for the given moment
-
system.updatePoliciesUpdate configuration policies if needed
-
techniques.createTechniqueCreate a new technique in Rudder from a technique in the technique editor
-
techniques.deleteTechniqueDelete a technique from technique editor
-
techniques.getTechniqueAllVersionGet each Technique's versions with their metadata by ID
-
techniques.getTechniqueAllVersionIdGet Technique metadata
-
techniques.getTechniquesResourcesGet currently deployed resources of a technique
-
techniques.listTechniquesList all technique with their versions
-
techniques.listTechniquesDirectivesList all directives based on all version of a technique
-
techniques.listTechniquesVersionsList all techniques version
-
techniques.listTechniqueVersionDirectivesList all directives based on a version of a technique
-
techniques.methodsGet all generic methods metadata
-
techniques.postReloadReload all techniques metadata from file system
-
techniques.reloadMethodsReload methods metadata from file system
-
techniques.techniqueCategoriesGet all technique categories
-
techniques.techniqueRevisionsGet revisions for given technique
-
techniques.updateTechniqueUpdate technique created with technique editor
-
userManagement.addUserAdd a new user
-
userManagement.deleteUserDelete the user and his permissions
-
userManagement.getRoleGet all available roles and their rights
-
userManagement.getUserInfoGet the list of all present users and their permissions
-
userManagement.reloadUserConfReload the users from the file system, in the configuration file
-
userManagement.updateUserRename, change password (pre-hashed or not) and change permission of an user. If a parameter is empty, it will be ignored.
-
openapi.previewSpecPreview an OpenAPI document before adding it as a source
-
openapi.addSourceAdd an OpenAPI source and register its operations as tools