Rudder relay exposes an internal API, enabling the agents and other services to interact with the relay.
Apache proxies the remote-run, shared-files, and shared-folder routes from
https://relay.example.com/rudder/relay-api/ to http://localhost:3030/rudder/relay-api/1/.
Apache serves policy files for every managed node at
https://relay.example.com/policies/{nodeId}/{path}. The path is relative to that node's policy
directory, for example rules/cfengine-community/promises.cf for CFEngine or
rules/dsc/rudder.zip for the Windows DSC archive.
The relay API is authenticated on a case-by-case basis:
Remote run is only accessible to requests from the IP of the relay's own policy server
Shared files checks file signature based on known public keys from nodes
Shared folder is only available to nodes in the authorized networks
System routes are available on the local relay API.
Policies downloads require the node's client certificate and access from an authorized network.
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, ...).
On the local relay API, versioned routes use /rudder/relay-api/{version}/{action}. The Apache policy download URL is unversioned.
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.
| Version | Rudder version it appeared in | Description |
|---|---|---|
| (none) | 3.2 | Unversioned API providing remote-run, shared-files and shared-folder |
| 1 | 6.0 | First relay API with a version |
The System API and future endpoints use JSON with the following schema:
{
"action": The name of the called function,
"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 information about the relay service
| result | string Enum: "success" "error" Result of the request |
| action | string Value: "getSystemInfo" The id of the action |
object Information about the service |
curl http://localhost:3030/rudder/relay-api/1/system/info
{- "result": "success",
- "action": "getSystemInfo",
- "data": {
- "rudder": {
- "major-version": "6.0",
- "full-version": "6.0.4"
}
}
}Reload relay configuration and data files
| result required | string Enum: "success" "error" Result of the request |
| action required | string Value: "getSystemInfo" The id of the action |
curl --request POST http://localhost:3030/rudder/relay-api/1/system/reload
{- "result": "success",
- "action": "getSystemInfo"
}Get information about current relay service status
| result | string Enum: "success" "error" Result of the request |
| action | string Value: "getStatus" The id of the action |
object Status of the service |
curl http://localhost:3030/rudder/relay-api/1/system/status
{- "result": "success",
- "action": "getStatus",
- "data": {
- "database": {
- "status": "success",
- "details": "string"
}, - "configuration": {
- "status": "error",
- "details": "configuration parsing error: missing field `node_id` for key `general` at line 45 column 1"
}
}
}Apache serves the ZIP archive to the corresponding node on the policy server's HTTPS virtual host.
| nodeId required | string <uuid> Example: 4ac35ef0-582d-468d-8c95-cd3f2ee333f9 Id of the target node |
curl --output rudder.zip --cert "C:\...\etc\ssl\localhost.cert:Rudder-dsc passphrase" --key "C:\...\etc\ssl\localhost.priv" https://rudder.example.com/policies/3c0781e1-b59f-4b7e-a85b-819297dfce1d/rules/dsc/rudder.zip
Apache serves files from each managed node's policy directory over HTTPS.
| nodeId required | string <uuid> Example: 4ac35ef0-582d-468d-8c95-cd3f2ee333f9 Id of the target node |
| path required | string Example: rules/cfengine-community/promises.cf File path relative to the node's policy directory. Use a slash between directory names. |
Trigger the agent on all of the managed nodes (if port 5309 is open to the node). WARNING: When running the agent, the /tmp folder may not be the global one but a private one, specific to the relay service. You should not rely on /tmp content in your policies but use /var/rudder/tmp instead.
| asynchronous | boolean Default: false Return early or wait for the end of the agent run |
| keep_output | boolean Default: false Forward agent output |
| conditions | string <comma-separated conditions> Default: "" Conditions passed as parameter to make it available during agent run, separated by a comma, each condition must match |
| classes | string Deprecated alias for |
| nodes | string <comma separated node ids> Nodes to trigger run on, used only when calling |
curl --request POST https://rudder.example.com/rudder/relay-api/remote-run/all --data keep_output=true
Trigger the agent on a list of managed nodes (if port 5309 is open to the node). WARNING: When running the agent, the /tmp folder may not be the global one but a private one, specific to the relay service. You should not rely on /tmp content in your policies but use /var/rudder/tmp instead.
| asynchronous | boolean Default: false Return early or wait for the end of the agent run |
| keep_output | boolean Default: false Forward agent output |
| conditions | string <comma-separated conditions> Default: "" Conditions passed as parameter to make it available during agent run, separated by a comma, each condition must match |
| classes | string Deprecated alias for |
| nodes | string <comma separated node ids> Nodes to trigger run on, used only when calling |
curl --request POST https://rudder.example.com/rudder/relay-api/remote-run/nodes --data keep_output=true
Trigger the agent on a managed node (if port 5309 is open to the node). WARNING: When running the agent, the /tmp folder may not be the global one but a private one, specific to the relay service. You should not rely on /tmp content in your policies but use /var/rudder/tmp instead.
| nodeId required | string <uuid> Example: 4ac35ef0-582d-468d-8c95-cd3f2ee333f9 Id of the target node |
| asynchronous | boolean Default: false Return early or wait for the end of the agent run |
| keep_output | boolean Default: false Forward agent output |
| conditions | string <comma-separated conditions> Default: "" Conditions passed as parameter to make it available during agent run, separated by a comma, each condition must match |
| classes | string Deprecated alias for |
| nodes | string <comma separated node ids> Nodes to trigger run on, used only when calling |
curl --request POST https://rudder.example.com/rudder/relay-api/remote-run/nodes/2fc7a3a2-4050-4209-afe9-1c5ebc9ce2c8 --data keep_output=true