role.get

    The method allows to retrieve roles according to the given parameters.

    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.

    Parameters

    The method supports the following parameters.

    (integer/array) Returns either:

    • an array of objects;
    • the count of retrieved objects, if the countOutput parameter has been used.

    Examples

    Retrieving role data

    Request:

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "roleid": "3",
    6. "name": "Super admin role",
    7. "type": "3",
    8. "readonly": "1",
    9. "rules": {
    10. "ui": [
    11. {
    12. "name": "monitoring.dashboard",
    13. "status": "1"
    14. },
    15. {
    16. "name": "monitoring.problems",
    17. "status": "1"
    18. },
    19. {
    20. "name": "monitoring.hosts",
    21. "status": "1"
    22. },
    23. {
    24. "name": "monitoring.latest_data",
    25. "status": "1"
    26. },
    27. {
    28. "name": "monitoring.maps",
    29. "status": "1"
    30. },
    31. {
    32. "name": "monitoring.services",
    33. "status": "1"
    34. },
    35. {
    36. "name": "inventory.overview",
    37. "status": "1"
    38. },
    39. {
    40. "name": "inventory.hosts",
    41. "status": "1"
    42. },
    43. {
    44. "name": "reports.availability_report",
    45. "status": "1"
    46. },
    47. {
    48. "name": "reports.top_triggers",
    49. "status": "1"
    50. },
    51. {
    52. "name": "monitoring.discovery",
    53. "status": "1"
    54. },
    55. {
    56. "name": "reports.notifications",
    57. "status": "1"
    58. },
    59. {
    60. "name": "reports.scheduled_reports",
    61. "status": "1"
    62. },
    63. "status": "1"
    64. },
    65. {
    66. "name": "configuration.templates",
    67. "status": "1"
    68. },
    69. {
    70. "name": "configuration.hosts",
    71. "status": "1"
    72. },
    73. {
    74. "name": "configuration.maintenance",
    75. "status": "1"
    76. },
    77. {
    78. "name": "configuration.actions",
    79. "status": "1"
    80. },
    81. {
    82. "name": "configuration.discovery",
    83. "status": "1"
    84. },
    85. {
    86. "name": "reports.system_info",
    87. "status": "1"
    88. },
    89. {
    90. "name": "reports.audit",
    91. "status": "1"
    92. },
    93. {
    94. "name": "reports.action_log",
    95. "status": "1"
    96. },
    97. {
    98. "name": "configuration.event_correlation",
    99. "status": "1"
    100. },
    101. {
    102. "name": "administration.general",
    103. "status": "1"
    104. },
    105. {
    106. "name": "administration.proxies",
    107. "status": "1"
    108. },
    109. {
    110. "name": "administration.authentication",
    111. "status": "1"
    112. },
    113. {
    114. "name": "administration.user_groups",
    115. "status": "1"
    116. },
    117. {
    118. "name": "administration.user_roles",
    119. "status": "1"
    120. },
    121. {
    122. "name": "administration.users",
    123. "status": "1"
    124. },
    125. {
    126. "name": "administration.media_types",
    127. "status": "1"
    128. },
    129. {
    130. "name": "administration.scripts",
    131. "status": "1"
    132. "name": "administration.queue",
    133. "status": "1"
    134. }
    135. ],
    136. "ui.default_access": "1",
    137. "services.read.mode": "1",
    138. "services.read.list": [],
    139. "services.read.tag": {
    140. "tag": "",
    141. "value": ""
    142. },
    143. "services.write.mode": "1",
    144. "services.write.list": [],
    145. "services.write.tag": {
    146. "tag": "",
    147. "value": ""
    148. },
    149. "modules": [],
    150. "modules.default_access": "1",
    151. "api.access": "1",
    152. "api.mode": "0",
    153. "api": [],
    154. "actions": [
    155. {
    156. "name": "edit_dashboards",
    157. "status": "1"
    158. },
    159. {
    160. "name": "edit_maps",
    161. "status": "1"
    162. },
    163. {
    164. "name": "acknowledge_problems",
    165. "status": "1"
    166. },
    167. {
    168. "name": "close_problems",
    169. "status": "1"
    170. },
    171. {
    172. "name": "change_severity",
    173. "status": "1"
    174. },
    175. {
    176. "name": "add_problem_comments",
    177. "status": "1"
    178. },
    179. {
    180. "name": "execute_scripts",
    181. "status": "1"
    182. },
    183. {
    184. "name": "manage_api_tokens",
    185. "status": "1"
    186. },
    187. {
    188. "name": "edit_maintenance",
    189. "status": "1"
    190. },
    191. {
    192. "name": "manage_scheduled_reports",
    193. "status": "1"
    194. }
    195. ],
    196. "actions.default_access": "1"
    197. }
    198. }
    199. ],
    200. }

    Source