system.kanoa.dashboard.addDashboard(dashboardInfo, userId)
Create a new dashboard.
Parameters
dashboardInfo Dictionary
| - dashboardDescription | String | Some information about the dashboard. |
| - dashboardName | String | The name of the dashboard. This must be unique within the folder. |
| - enabled | Boolean | |
| - folderId | Integer | The id of the folder this dashboard is going into. Use None if the dashboard is going onto the root. |
| - iconColor | String | The color of the icon for this dashboard. |
| - iconPath | String | The path to the icon for this dashboard. |
| - private | Boolean | Indicates if the dashboard is private or public. True for private, False for public |
| - roles | List of Strings | An array of roles that are able to view this dashboard. |
| - showOnMobile | Boolean | Indicates if the dashboard should be shown on mobile devices. |
| - sortOrder | Integer | Determines where within the folder the dashboard is placed relative to other dashboards. If the same as another dashboard, then sorted by name. |
userId Integer: Id of user executing the function
Returns
dashboardId Integer
message String None if successful
Example
dashboardInfo = {
"dashboardDescription": "Downtime By Asset",
"dashboardName": "Asset Downtime",
"enabled": True,
"folderId": 1,
"iconColor": "#AC5F00",
"iconPath": "kanoa/maintenance",
"private": False,
"roles": None,
"showOnMobile": false,
"sortOrder": None
}
userId = 123
dashboardId, msg = system.kanoa.dashboard.addDashboard(dashboardInfo, userId)
if msg: system.perspective.sendMessage('showFailerToast', msg)
else: system.perspective.sendMessage('showSuccessfulToast', 'Dashboard has been saved')