示例#1
0
        public async Task <IActionResult> SystemTextState(string systemName)
        {
            var apiMessage = new ApiMessage <string>();

            try
            {
                var isUp = await _statusService.CheckSpecificSystem(
                    await _systemService.GetDescriptorByName(systemName)
                    );

                apiMessage.Data   = isUp ? "Graceful" : "Down";
                apiMessage.Status = true;
                apiMessage.Messages.Push($"Text state for {systemName}");
                return(Ok(apiMessage));
            }
            catch (Exception e)
            {
                apiMessage.Status = false;
                apiMessage.Messages.Push(e.Message);
                return(StatusCode(StatusCodes.Status500InternalServerError, apiMessage));
            }
        }