diff --git a/cid/common.py b/cid/common.py index 9fad1ab4..91dc1f56 100644 --- a/cid/common.py +++ b/cid/common.py @@ -323,7 +323,12 @@ def load_catalog(self, catalog_url): ''' load additional resources from catalog ''' try: - catalog = yaml.safe_load(self.get_page(catalog_url).text) + if 'https://' in catalog_url: + text = self.get_page(catalog_url).text + else: + with open(catalog_url, encoding='utf-8') as catalog_file: + text = catalog_file.read() + catalog = yaml.safe_load(text) except (requests.exceptions.RequestException, yaml.error.MarkedYAMLError) as exc: logger.warning(f'Failed to load a catalog url: {exc}') logger.debug(exc, exc_info=True) diff --git a/dashboards/catalog.yaml b/dashboards/catalog.yaml index 4a673c99..c50a9344 100644 --- a/dashboards/catalog.yaml +++ b/dashboards/catalog.yaml @@ -4,7 +4,8 @@ Resources: - Url: data-transfer/DataTransfer-Cost-Analysis-Dashboard.yaml - Url: aws-marketplace/aws-marketplace-spg.yaml - Url: extended-support-cost-projection/extended-support-cost-projection.yaml - - Url: graviton-opportunities-dashboard/graviton_dashboard.yaml + - Url: graviton-savings-dashboard/graviton_savings_dashboard.yaml + - Url: graviton-savings-dashboard/graviton_legacy.yaml # deprecated - Url: health-events/health-events.yaml - Url: scad-containers-cost-allocation/scad-containers-cost-allocation.yaml - Url: aws-feeds/aws-feeds.yaml diff --git a/dashboards/graviton-savings-dashboard/graviton_legacy.yaml b/dashboards/graviton-savings-dashboard/graviton_legacy.yaml new file mode 100644 index 00000000..65927ac1 --- /dev/null +++ b/dashboards/graviton-savings-dashboard/graviton_legacy.yaml @@ -0,0 +1,14 @@ +dashboards: + GRAVITON_DASHBOARD: + dependsOn: + datasets: + - graviton_ec2_view + - graviton_elasticache_view + - graviton_opensearch_view + - graviton_rds_view + name: Graviton Opportunities Dashboard + deprecationNotice: "This version is deprecated. Delete it and install 'graviton-savings' instead." + dashboardId: graviton-opportunities + category: Advanced + theme: MIDNIGHT + data: '{}' diff --git a/dashboards/graviton-opportunities-dashboard/graviton_dashboard.yaml b/dashboards/graviton-savings-dashboard/graviton_savings_dashboard.yaml similarity index 99% rename from dashboards/graviton-opportunities-dashboard/graviton_dashboard.yaml rename to dashboards/graviton-savings-dashboard/graviton_savings_dashboard.yaml index 72f07e99..f5ad2df8 100644 --- a/dashboards/graviton-opportunities-dashboard/graviton_dashboard.yaml +++ b/dashboards/graviton-savings-dashboard/graviton_savings_dashboard.yaml @@ -1,13 +1,13 @@ dashboards: - GRAVITON_DASHBOARD: + GRAVITON_SAVINGS_DASHBOARD: dependsOn: datasets: - graviton_ec2_view - graviton_elasticache_view - graviton_opensearch_view - graviton_rds_view - name: Graviton Opportunities Dashboard - dashboardId: graviton-opportunities + name: Graviton Savings Dashboard + dashboardId: graviton-savings category: Advanced theme: MIDNIGHT data: |-