diff --git a/autogole-api/packaging/files/etc/rtmon.yaml b/autogole-api/packaging/files/etc/rtmon.yaml index ac34814..2cd3529 100644 --- a/autogole-api/packaging/files/etc/rtmon.yaml +++ b/autogole-api/packaging/files/etc/rtmon.yaml @@ -28,6 +28,8 @@ template_links: url: 'https://autogole-grafana.nrp-nautilus.io/d/D7xOxim4z/full-dtn-monitoring-variable?orgId=1&refresh=1m' - title: 'All Switches Monitoring $$REPLACEMESITENAME$$' url: 'https://autogole-grafana.nrp-nautilus.io/d/efe9ac84-9df5-47a4-bea8-67a196771a0d/switch-monitoring?orgId=1&refresh=1m&var-Sitename=$$REPLACEMESITENAME$$&var-switch=All' + - title: 'SENSE-O WebUI for Instance' + url: 'https://$$REPLACEMESENSEODOMAIN$$:8443/StackV-web/portal/details/$$REPLACEMEDELTAUUID$$' # Override URL for the NSI,ESnet,Fabric mermaid diagrams. Most of those RMs report everything in a single SwitchingSubnet # and we need to override it to show the actual topology (joint, or not). Additionally - most of those have no site name or diff --git a/autogole-api/src/python/RTMonLibs/Template.py b/autogole-api/src/python/RTMonLibs/Template.py index 6bd2e52..32cbf91 100644 --- a/autogole-api/src/python/RTMonLibs/Template.py +++ b/autogole-api/src/python/RTMonLibs/Template.py @@ -288,12 +288,17 @@ def _clean(self): self.annotationids = [] self.nextid = 0 - def __getTitlesUrls(self, site, link): + def __getTitlesUrls(self, site, link, **kwargs): """Get Titles and URLs""" title = link.get('title', "Link-Title-Not-Present-in-Config") url = link.get('url', "https://link-not-present-in-config") title = title.replace("$$REPLACEMESITENAME$$", site) url = url.replace("$$REPLACEMESITENAME$$", site) + uuid = kwargs.get('referenceUUID', None) + senseodomain = kwargs.get('orchestrator', None) + if uuid and senseodomain: + url = url.replace("$$REPLACEMESENSEODOMAIN$$", senseodomain) + url = url.replace("$$REPLACEMEDELTAUUID$$", uuid) return title, url def _getNextID(self, recordAnnotations=False): @@ -348,7 +353,7 @@ def t_addRow(self, *_args, **kwargs): out["id"] = self._getNextRowID() return out - def t_addLinks(self, *_args): + def t_addLinks(self, *_args, **kwargs): """Add Links to the Dashboard""" if not self.config.get('template_links', []): return [] @@ -373,7 +378,7 @@ def t_addLinks(self, *_args): tmpcopy["url"] = f"{self.config['grafana_host']}/d/{self.dashboards[site]['uid']}" ret.append(tmpcopy) for link in self.config['template_links']: - title, url = self.__getTitlesUrls(site, link) + title, url = self.__getTitlesUrls(site, link, **kwargs) if url not in addedUrls: tmpcopy = copy.deepcopy(out) tmpcopy["title"] = title @@ -622,7 +627,7 @@ def t_createTemplate(self, *args, **kwargs): orig_args = copy.deepcopy(args) self.generated['panels'] += self.t_createMermaid(*orig_args) # Add Links on top of the page - self.generated['links'] = self.t_addLinks(*args) + self.generated['links'] = self.t_addLinks(*args, **kwargs) # Add Debug Info (manifest, instance) self.generated['panels'] += self.t_addDebug(*args) # Add Host Flow