sla.getsli

    This method allows to calculate the Service Level Indicator (SLI) data.

    This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

    Partitioning of periods

    The following demonstrates the arrangement of returned period slices based on combinations of parameters.

    (object) Returns the results of the calculation.

    SLI data

    Calculating SLI

    Retrieve SLI on services with IDs “50, 60 and 70” linked to an SLA with ID of “5” for 3 periods starting from Nov 01, 2021.

    Request:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": {
    4. "periods": [
    5. {
    6. "period_from": 1635724800,
    7. "period_to": 1638316800
    8. },
    9. {
    10. "period_from": 1638316800,
    11. "period_to": 1640995200
    12. },
    13. {
    14. "period_from": 1640995200,
    15. "period_to": 1643673600
    16. }
    17. ],
    18. "serviceids": [
    19. 50,
    20. 60,
    21. 70
    22. ],
    23. "sli": [
    24. [
    25. {
    26. "uptime": 1186212,
    27. "downtime": 0,
    28. "sli": 100,
    29. "error_budget": 0,
    30. "excluded_downtimes": [
    31. {
    32. "name": "Excluded Downtime - 1",
    33. "period_from": 1637836212,
    34. "period_to": 1638316800
    35. }
    36. ]
    37. },
    38. "downtime": 0,
    39. "sli": 100,
    40. "error_budget": 0,
    41. "excluded_downtimes": [
    42. {
    43. "name": "Excluded Downtime - 1",
    44. "period_from": 1637836212,
    45. "period_to": 1638316800
    46. }
    47. ]
    48. },
    49. {
    50. "uptime": 1186212,
    51. "downtime": 0,
    52. "sli": 100,
    53. "error_budget": 0,
    54. "excluded_downtimes": [
    55. {
    56. "name": "Excluded Downtime - 1",
    57. "period_from": 1637836212,
    58. "period_to": 1638316800
    59. }
    60. ]
    61. }
    62. ],
    63. [
    64. {
    65. "uptime": 1147548,
    66. "downtime": 0,
    67. "sli": 100,
    68. "error_budget": 0,
    69. "excluded_downtimes": [
    70. {
    71. "name": "Excluded Downtime - 1",
    72. "period_from": 1638439200,
    73. "period_to": 1639109652
    74. }
    75. ]
    76. },
    77. {
    78. "uptime": 1147548,
    79. "downtime": 0,
    80. "sli": 100,
    81. "error_budget": 0,
    82. "excluded_downtimes": [
    83. "period_from": 1638439200,
    84. "period_to": 1639109652
    85. }
    86. ]
    87. },
    88. {
    89. "uptime": 1147548,
    90. "downtime": 0,
    91. "sli": 100,
    92. "error_budget": 0,
    93. "excluded_downtimes": [
    94. {
    95. "name": "Excluded Downtime - 1",
    96. "period_from": 1638439200,
    97. "period_to": 1639109652
    98. }
    99. ]
    100. }
    101. ],
    102. [
    103. {
    104. "uptime": 1674000,
    105. "downtime": 0,
    106. "sli": 100,
    107. "error_budget": 0,
    108. "excluded_downtimes": []
    109. },
    110. {
    111. "uptime": 1674000,
    112. "downtime": 0,
    113. "sli": 100,
    114. "error_budget": 0,
    115. "excluded_downtimes": []
    116. },
    117. {
    118. "uptime": 1674000,
    119. "downtime": 0,
    120. "sli": 100,
    121. "error_budget": 0,
    122. "excluded_downtimes": []
    123. }
    124. ]
    125. ]
    126. },
    127. "id": 1

    CService::getSla() in ui/include/classes/api/services/CService.php.