ClusterRole
Defines a cluster node role with enabled tasks and listeners.
This object can be configured from the WebUI under Settings › Cluster › Roles
Fields
name
Type:
String· read-onlyUnique identifier for the role
description
Type:
String?Description of the role
tasks
Type:
ClusterTaskGroup· requiredWhich tasks are enabled for this cluster role
listeners
Type:
ClusterListenerGroup· requiredWhich network listeners are enabled for this cluster role
JMAP API
The ClusterRole object is available via the urn:stalwart:jmap capability.
x:ClusterRole/get
This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysClusterRoleGet permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:ClusterRole/get",
{
"ids": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
x:ClusterRole/set
This is a standard Foo/set method as defined in RFC 8620, Section 5.3.
Supports create, update, and destroy operations in a single call.
Create
This operation requires the sysClusterRoleCreate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:ClusterRole/set",
{
"create": {
"new1": {
"description": "Example",
"listeners": {
"@type": "EnableAll"
},
"tasks": {
"@type": "EnableAll"
}
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
Update
This operation requires the sysClusterRoleUpdate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:ClusterRole/set",
{
"update": {
"id1": {
"description": "updated value"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
Destroy
This operation requires the sysClusterRoleDestroy permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:ClusterRole/set",
{
"destroy": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
x:ClusterRole/query
This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysClusterRoleQuery permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:ClusterRole/query",
{
"filter": {
"name": "example"
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
The x:ClusterRole/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
name | text |
CLI
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
Fetch
stalwart-cli get cluster-role id1
Create
stalwart-cli create cluster-role \
--field description=Example \
--field 'tasks={"@type":"EnableAll"}' \
--field 'listeners={"@type":"EnableAll"}'
Query
stalwart-cli query cluster-role
stalwart-cli query cluster-role --where name=example
Update
stalwart-cli update cluster-role id1 --field description='Updated'
Delete
stalwart-cli delete cluster-role --ids id1
Nested types
ClusterTaskGroup
Defines which cluster tasks are enabled for a cluster role.
EnableAll: Enable all tasks. No additional fields.DisableAll: Disable all tasks. No additional fields.EnableSome: Enable some tasks. Carries the fields ofClusterTaskGroupProperties.DisableSome: Disable some tasks. Carries the fields ofClusterTaskGroupProperties.
ClusterTaskGroupProperties
Specifies which tasks are enabled or disabled.
taskTypes
Type:
ClusterTaskType[]Tasks to enable or disable for this group
ClusterListenerGroup
Defines which network listeners are enabled for a cluster role.
EnableAll: Enable all network listeners. No additional fields.DisableAll: Disable all network listeners. No additional fields.EnableSome: Enable some network listeners. Carries the fields ofClusterListenerGroupProperties.DisableSome: Disable some network listeners. Carries the fields ofClusterListenerGroupProperties.
ClusterListenerGroupProperties
Specifies which listeners are enabled or disabled.
listenerIds
Type:
Id<NetworkListener>[]List of network listeners to enable or disable for this group
Enums
ClusterTaskType
| Value | Label |
|---|---|
storeMaintenance | Store Maintenance |
accountMaintenance | Account Maintenance |
metricsCalculate | Calculate Metrics |
metricsPush | Push Metrics |
pushNotifications | Push Notifications |
searchIndexing | Search Indexing |
spamClassifierTraining | Spam Classifier Training |
outboundMta | Outbound Email MTA |
taskQueueProcessing | Task Queue Processing |
taskScheduler | Task Scheduling |