Dashboards Component
Used to sync dashboards from a source instance to a destination instance of Swimlane
sync_dashboard
This method syncs a single dashboard from a source instance to a destination instance.
This class first checks to see if the provided dashboard already exists on the destination instance. If it does not exist then we attempt to add the dashboard to the destination instance.
If it already exists on the destination instance we first check it against all destination
instance dashboards. This check involves comparing the provided source dashboard dict with
the uid
and name
of a destination instance dashboard.
If a match is found we then check if the version is the same. If it is, we simply skip processing this dashboard.
If a match is found but the versions are different we first ensure that all the reports in the dashboard are on the destination instance. Once that is complete, we modify the dashboard to remove unneeded keys and then update it as provided by the source instance.
def sync_dashboard(self, dashboard: dict)
sync
This method is used to sync all dashboards from a source instance to a destination instance
def sync(self)
Dashboard Model
Dashboard
__attrs_init__(self, workspaces, timelineEnabled, minTimelineDate, maxTimelineDate, createdDate, modifiedDate, uid, version, id, name, disabled, description=None, allowed=[], permissions={}, createdByUser={}, modifiedByUser={}, timelineFilters={}, items=[])
special
Method generated by attrs for class Dashboard.
Source code in aqueduct/models/dashboard.py
def __attrs_init__(self, workspaces, timelineEnabled, minTimelineDate, maxTimelineDate, createdDate, modifiedDate, uid, version, id, name, disabled, description=attr_dict['description'].default, allowed=attr_dict['allowed'].default, permissions=attr_dict['permissions'].default, createdByUser=attr_dict['createdByUser'].default, modifiedByUser=attr_dict['modifiedByUser'].default, timelineFilters=attr_dict['timelineFilters'].default, items=attr_dict['items'].default):
self.workspaces = workspaces
self.timelineEnabled = timelineEnabled
self.minTimelineDate = minTimelineDate
self.maxTimelineDate = maxTimelineDate
self.createdDate = createdDate
self.modifiedDate = modifiedDate
self.uid = uid
self.version = version
self.id = id
self.name = name
self.disabled = disabled
self.description = description
self.allowed = allowed
self.permissions = permissions
self.createdByUser = createdByUser
self.modifiedByUser = modifiedByUser
self.timelineFilters = timelineFilters
self.items = items
self.__attrs_post_init__()
ReportItems
__init__(self, cardType, id, name, row, col, sizeX, sizeY, reportId=NOTHING, autoRefreshMilliseconds=NOTHING, description=NOTHING, measure=NOTHING, dateFilter=NOTHING, appsFilter=NOTHING, colorScheme=NOTHING, src=NOTHING)
special
Method generated by attrs for class ReportItems.
Source code in aqueduct/models/dashboard.py
def __init__(self, cardType, id, name, row, col, sizeX, sizeY, reportId=NOTHING, autoRefreshMilliseconds=NOTHING, description=NOTHING, measure=NOTHING, dateFilter=NOTHING, appsFilter=NOTHING, colorScheme=NOTHING, src=NOTHING):
self.cardType = cardType
self.id = id
self.name = name
self.row = row
self.col = col
self.sizeX = sizeX
self.sizeY = sizeY
if reportId is not NOTHING:
self.reportId = reportId
else:
self.reportId = __attr_factory_reportId()
if autoRefreshMilliseconds is not NOTHING:
self.autoRefreshMilliseconds = autoRefreshMilliseconds
else:
self.autoRefreshMilliseconds = __attr_factory_autoRefreshMilliseconds()
if description is not NOTHING:
self.description = description
else:
self.description = __attr_factory_description()
if measure is not NOTHING:
self.measure = measure
else:
self.measure = __attr_factory_measure()
if dateFilter is not NOTHING:
self.dateFilter = dateFilter
else:
self.dateFilter = __attr_factory_dateFilter()
if appsFilter is not NOTHING:
self.appsFilter = appsFilter
else:
self.appsFilter = __attr_factory_appsFilter()
if colorScheme is not NOTHING:
self.colorScheme = colorScheme
else:
self.colorScheme = __attr_factory_colorScheme()
if src is not NOTHING:
self.src = src
else:
self.src = __attr_factory_src()