public IActionResult Get()
        {
            var healthViloationMessage = _healthService.GetHealthViolationMessage();

            if (healthViloationMessage != null)
            {
                return(StatusCode(
                           (int)HttpStatusCode.InternalServerError,
                           ErrorResponse.Create($"Service is unhealthy: {healthViloationMessage}")));
            }

            // NOTE: Feel free to extend IsAliveResponse, to display job-specific indicators
            return(Ok(new IsAliveResponse
            {
                Name = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationName,
                Version = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion,
                Env = Environment.GetEnvironmentVariable("ENV_INFO"),
#if DEBUG
                IsDebug = true,
#else
                IsDebug = false,
#endif
                IssueIndicators = _healthService.GetHealthIssues()
                                  .Select(i => new IsAliveResponse.IssueIndicator
                {
                    Type = i.Type,
                    Value = i.Value
                })
            }));
        }
        public IActionResult Get()
        {
            var healthViloationMessage = _healthService.GetHealthViolationMessage();

            if (healthViloationMessage != null)
            {
                return(StatusCode(
                           (int)HttpStatusCode.InternalServerError,
                           new Models.ErrorResponse {
                    ErrorMessage = $"Service is unhealthy: {healthViloationMessage}"
                }));
            }

            return(Ok(new Models.IsAliveResponse
            {
                Name = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationName,
                Version = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion,
                Env = Program.EnvInfo,
#if DEBUG
                IsDebug = true,
#else
                IsDebug = false,
#endif
                IssueIndicators = _healthService.GetHealthIssues()
                                  .Select(i => new Models.IsAliveResponse.IssueIndicator
                {
                    Type = i.Type,
                    Value = i.Value
                })
            }));
        }
        public IActionResult Get()
        {
            var healthViloationMessage = _healthService.GetHealthViolationMessage();

            if (healthViloationMessage != null)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, new ErrorResponse
                {
                    ErrorMessage = $"Job is unhealthy: {healthViloationMessage}"
                }));
            }

            // NOTE: Feel free to extend IsAliveResponse, to display job-specific indicators
            return(Ok(new IsAliveResponse
            {
                Name = AppEnvironment.Name,
                Version = AppEnvironment.Version,
                Env = Program.EnvInfo,
#if DEBUG
                IsDebug = true,
#else
                IsDebug = false,
#endif
                IssueIndicators = _healthService.GetHealthIssues()
                                  .Select(i => new IsAliveResponse.IssueIndicator
                {
                    Type = i.Type,
                    Value = i.Value
                })
            }));
        }
        public IActionResult Get()
        {
            var healthViloationMessage = _healthService.GetHealthViolationMessage();

            if (healthViloationMessage != null)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, new ErrorResponse
                {
                    ErrorMessage = $"Job is unhealthy: {healthViloationMessage}"
                }));
            }

            // NOTE: Feel free to extend IsAliveResponse, to display job-specific indicators
            return(Ok(new IsAliveResponse
            {
                Name = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationName,
                Version = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application
                          .ApplicationVersion,
                Env = Program.EnvInfo,
//#$if DEBUG
                IsDebug = true,
//#$else
                //$#$//IsDebug = false,
//#$endif
                IssueIndicators = _healthService.GetHealthIssues()
                                  .Select(i => new IsAliveResponse.IssueIndicator
                {
                    Type = i.Type,
                    Value = i.Value
                })
            }));
        }
        public IActionResult Get()
        {
            var healthViloationMessage = _healthService.GetHealthViolationMessage();

            if (healthViloationMessage != null)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, new ErrorResponse
                {
                    ErrorMessage = $"Job is unhealthy: {healthViloationMessage}"
                }));
            }

            // NOTE: Feel free to extend IsAliveResponse, to display job-specific health status
            return(Ok(new IsAliveResponse
            {
                Version = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion,
                Env = Environment.GetEnvironmentVariable("ENV_INFO"),
                HealthWarning = _healthService.GetHealthWarningMessage() ?? "No",
#if (examples)
                // NOTE: Health status information example:
                LastFooStartedMoment = _healthService.LastFooStartedMoment,
                LastFooDuration = _healthService.LastFooDuration,
                MaxHealthyFooDuration = _healthService.MaxHealthyFooDuration
#endif
            }));
        }
Ejemplo n.º 6
0
        public IActionResult Get()
        {
            var healthViloationMessage = _healthService.GetHealthViolationMessage();

            if (healthViloationMessage != null)
            {
                return(StatusCode(
                           (int)HttpStatusCode.InternalServerError,
                           BlockchainWalletsErrorResponse.Create($"Service is unhealthy: {healthViloationMessage}")));
            }

            // NOTE: Feel free to extend IsAliveResponse, to display job-specific indicators
            return(Ok(new IsAliveResponse
            {
                Name = PlatformServices.Default.Application.ApplicationName,
                Version = PlatformServices.Default.Application.ApplicationVersion,
                Env = Program.EnvInfo,
#if DEBUG
                IsDebug = true,
#else
                IsDebug = false,
#endif
                IssueIndicators = _healthService.GetHealthIssues()
                                  .Select(i => new IsAliveResponse.IssueIndicator
                {
                    Type = i.Type,
                    Value = i.Value
                })
            }));
        }
Ejemplo n.º 7
0
        public IActionResult Get()
        {
            var healthViloationMessage = _healthService.GetHealthViolationMessage();

            if (healthViloationMessage != null)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, new ErrorResponse
                {
                    ErrorMessage = $"Job is unhealthy: {healthViloationMessage}"
                }));
            }

            // NOTE: Feel free to extend IsAliveResponse, to display job-specific health status
            return(Ok(new IsAliveResponse
            {
                Version = Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion,
                Env = Environment.GetEnvironmentVariable("ENV_INFO"),
            }));
        }