GlideSystemRunLevel- Global
The GlideSystemRunLevel API provides methods to get and set the current system run level.
Setting the system run level allows applications to change or limit their features based on operational toggles. For more information about using operational toggles, see Operational toggles.
The system run level can be set to one of the defined system run levels.
- Fully Operational
- Slightly Degraded
- Moderately Degraded
- Severely Degraded
The system run level set on one node is synchronized to all nodes in the instance.
The admin role is required to use this API.
Parent Topic:Server API reference
GlideSystemRunLevel – getCurrentLevel()
Retrieves the current system run level.
| Name | Type | Description |
|---|---|---|
| None |
| Type | Description |
|---|---|
| String | The current system run level.Possible values: - fully\_operational - slightly\_degraded - moderately\_degraded - severely\_degraded |
Gets the current system run level.
var currentRunLevel = sn_run_level.GlideSystemRunLevel.getCurrentLevel();
gs.info(currentRunLevel);
Output:
fully_operational
GlideSystemRunLevel – switchLevel(String newLevel)
Switches the system run level.
| Name | Type | Description |
|---|---|---|
| newLevel | String | The ID value of the new system run level. This value is from the ID field in the System Run Level [sys_run_level] table. |
| Type | Description |
|---|---|
| String | ID of the previous system run level.Possible values: - fully\_operational - slightly\_degraded - moderately\_degraded - severely\_degraded |
Sets the system run level to Slightly Degraded.
sn_run_level.GlideSystemRunLevel.switchLevel('slightly_degraded');
Output:
SystemRunLevel requested to change from: fully_operational to: slightly_degraded