Module custom-role
User-defined role API.
If you want to implement your own role it must conform this API.
Functions
init (opts) | Role initialization callback. |
stop (opts) | Role shutdown callback. |
validate_config (conf_new, conf_old) | Validate clusterwide configuration callback. |
apply_config (conf, opts) | Apply clusterwide configuration callback. |
Fields
role_name | Displayed role name. |
hidden | Hidden role flag. |
permanent | Permanent role flag. |
Functions
- init (opts)
-
Role initialization callback.
Called when role is enabled on an instance.
Caused either by editing topology or instance restart.
Parameters:
- opts
- is_master boolean
- opts
- stop (opts)
-
Role shutdown callback.
Called when role is disabled on an instance.
Parameters:
- opts
- is_master boolean
- opts
- validate_config (conf_new, conf_old)
-
Validate clusterwide configuration callback.
Parameters:
- apply_config (conf, opts)
-
Apply clusterwide configuration callback.
Parameters:
- conf table Clusterwide configuration
- opts
- is_master boolean
Fields
- role_name
-
Displayed role name.
When absent, module name is used instead.
- role_name string
- hidden
-
Hidden role flag. aren't listed in
cartridge.admin.get_replicasets().roles
and therefore in WebUI. Hidden roled are supposed to be a dependency for another role.- hidden boolean
- permanent
-
Permanent role flag.
Permanent roles will be enabled on every instance in cluster.
Implies
hidden = true
.- permanent boolean