GlideSystemRunLevel - Global

  • Release version: Xanadu
  • Updated August 1, 2024
  • 1 minute to read
  • 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.

    GlideSystemRunLevel – getCurrentLevel()

    Retrieves the current system run level.

    Table 1. Parameters
    Name Type Description
    None
    Table 2. Returns
    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.

    Table 3. Parameters
    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.
    Table 4. Returns
    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