Ejemplo n.º 1
0
        private async Task <bool> ExecuteAsync()
        {
            using (var client = new GrafanaClient(Host, AccessToken))
            {
                var deploy = new DeployImporter(
                    client,
                    Tag,
                    DashboardDirectory,
                    DataSourceDirectory,
                    NotificationDirectory,
                    Environments.Select(e => e.ItemSpec).ToArray(),
                    Log);

                try
                {
                    await deploy.ImportFromGrafana(DashboardId);
                }
                catch (HttpRequestException e)
                {
                    Log.LogErrorFromException(e,
                                              showStackTrace: false,
                                              showDetail: false,
                                              file: "MonitoringImport");
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        private async Task <bool> ExecuteAsync()
        {
            using (var client = new GrafanaClient(Host, AccessToken))
            {
                var deploy = new DeployImporter(
                    grafanaClient: client,
                    sourceTagValue: Tag,
                    dashboardDirectory: DashboardDirectory,
                    datasourceDirectory: DataSourceDirectory,
                    notificationDirectory: NotificationDirectory,
                    environments: Environments.Select(e => e.ItemSpec).ToArray(),
                    parametersFilePath: ParametersFile,
                    environment: Environment,
                    log: Log);

                try
                {
                    await deploy.ImportFromGrafana(DashboardId);
                }
                catch (HttpRequestException e)
                {
                    Log.LogErrorFromException(e,
                                              showStackTrace: false,
                                              showDetail: false,
                                              file: "MonitoringImport");
                    return(false);
                }
            }

            return(true);
        }