Rudder relay exposes an internal API, enabling the agents and other services to interact with the relay.
A part of the API (everything but the System
category) is exposed publicly on the relay
at https://relay.example.com/rudder/relay-api/
(which is a reverse proxy of
http://localhost:3030/rudder/relay-api/1/
).
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 is only accessible to local clients and do not permit access to private information nor modification abilities
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, ...).
You can change the version of the API used by setting in the URL: each URL is prefixed by its version id, like /relay-api/version/action
.
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"
}
}
}
Downloads an archive containing the policies to apply to the given node
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
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