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 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": "services.services",
    33. "status": "1"
    34. },
    35. {
    36. "name": "services.sla_report",
    37. "status": "1"
    38. },
    39. {
    40. "name": "inventory.overview",
    41. "status": "1"
    42. },
    43. {
    44. "name": "inventory.hosts",
    45. "status": "1"
    46. },
    47. {
    48. "name": "reports.availability_report",
    49. "status": "1"
    50. },
    51. {
    52. "name": "reports.top_triggers",
    53. "status": "1"
    54. },
    55. {
    56. "name": "monitoring.discovery",
    57. "status": "1"
    58. },
    59. {
    60. "name": "services.sla",
    61. "status": "1"
    62. },
    63. {
    64. "name": "reports.scheduled_reports",
    65. "status": "1"
    66. },
    67. {
    68. "name": "reports.notifications",
    69. "status": "1"
    70. },
    71. {
    72. "name": "configuration.template_groups",
    73. "status": "1"
    74. },
    75. {
    76. "name": "configuration.host_groups",
    77. "status": "1"
    78. },
    79. {
    80. "name": "configuration.templates",
    81. "status": "1"
    82. "name": "configuration.hosts",
    83. "status": "1"
    84. },
    85. {
    86. "name": "configuration.maintenance",
    87. "status": "1"
    88. },
    89. {
    90. "name": "configuration.discovery",
    91. "status": "1"
    92. },
    93. {
    94. "name": "configuration.trigger_actions",
    95. "status": "1"
    96. },
    97. {
    98. "name": "configuration.service_actions",
    99. "status": "1"
    100. },
    101. {
    102. "name": "configuration.discovery_actions",
    103. "status": "1"
    104. },
    105. {
    106. "name": "configuration.autoregistration_actions",
    107. "status": "1"
    108. },
    109. {
    110. "name": "configuration.internal_actions",
    111. "status": "1"
    112. },
    113. {
    114. "name": "reports.system_info",
    115. "status": "1"
    116. },
    117. {
    118. "name": "reports.audit",
    119. "status": "1"
    120. },
    121. {
    122. "name": "reports.action_log",
    123. "status": "1"
    124. },
    125. {
    126. "name": "configuration.event_correlation",
    127. "status": "1"
    128. },
    129. {
    130. "name": "administration.media_types",
    131. "status": "1"
    132. },
    133. {
    134. "name": "administration.scripts",
    135. "status": "1"
    136. },
    137. {
    138. "name": "administration.user_groups",
    139. "status": "1"
    140. },
    141. {
    142. "name": "administration.user_roles",
    143. "status": "1"
    144. },
    145. {
    146. "name": "administration.users",
    147. "status": "1"
    148. },
    149. {
    150. "name": "administration.api_tokens",
    151. "status": "1"
    152. },
    153. {
    154. "name": "administration.authentication",
    155. "status": "1"
    156. },
    157. {
    158. "name": "administration.general",
    159. "status": "1"
    160. },
    161. {
    162. "name": "administration.audit_log",
    163. "status": "1"
    164. },
    165. {
    166. "name": "administration.housekeeping",
    167. "status": "1"
    168. },
    169. {
    170. },
    171. {
    172. "name": "administration.macros",
    173. "status": "1"
    174. },
    175. {
    176. "name": "administration.queue",
    177. "status": "1"
    178. }
    179. ],
    180. "ui.default_access": "1",
    181. "services.read.mode": "1",
    182. "services.read.list": [],
    183. "services.read.tag": {
    184. "tag": "",
    185. "value": ""
    186. },
    187. "services.write.mode": "1",
    188. "services.write.list": [],
    189. "services.write.tag": {
    190. "tag": "",
    191. "value": ""
    192. },
    193. "modules": [],
    194. "modules.default_access": "1",
    195. "api.access": "1",
    196. "api.mode": "0",
    197. "api": [],
    198. "actions": [
    199. {
    200. "name": "edit_dashboards",
    201. "status": "1"
    202. },
    203. {
    204. "name": "edit_maps",
    205. "status": "1"
    206. },
    207. {
    208. "name": "acknowledge_problems",
    209. "status": "1"
    210. },
    211. {
    212. "name": "suppress_problems",
    213. "status": "1"
    214. },
    215. {
    216. "name": "close_problems",
    217. "status": "1"
    218. },
    219. {
    220. "name": "change_severity",
    221. "status": "1"
    222. },
    223. {
    224. "name": "add_problem_comments",
    225. "status": "1"
    226. },
    227. {
    228. "name": "execute_scripts",
    229. "status": "1"
    230. },
    231. {
    232. "name": "manage_api_tokens",
    233. "status": "1"
    234. },
    235. {
    236. "name": "edit_maintenance",
    237. "status": "1"
    238. },
    239. {
    240. "name": "manage_scheduled_reports",
    241. "status": "1"
    242. },
    243. {
    244. "name": "manage_sla",
    245. "status": "1"
    246. },
    247. {
    248. "name": "invoke_execute_now",
    249. "status": "1"
    250. }
    251. ],
    252. "actions.default_access": "1"
    253. }
    254. }
    255. ],
    256. "id": 1

    Source