public async Task <ApiResult <object> > Status([FromServices] OneBoxService eos) { string chainId = null; if (_status == LaunchStatus.Active) { chainId = await eos.RetriveChainIdAsync(); } return(ApiResult <object>(new { Status = _status.ToString(), ChainId = chainId, LogStreamId = eos.GetOneBoxProcId() })); }
public ApiResult Stop(bool?safeMode, [FromServices] OneBoxService eos) { if (_status != LaunchStatus.Active && _status != LaunchStatus.Launching) { return(ApiResult(409, $"The EOS is under {_status} status.")); } if (safeMode.HasValue && safeMode.Value) { eos.GracefulShutdown(); } else { eos.ForceShutdown(); } _status = LaunchStatus.NotLaunched; return(ApiResult(200, "Succeeded")); }