public OptionsParser(IIpAddressProcessor ipOptions, IOperatingSystemProcessor operatingSystemProcessor, IHostNameProcessor hostNameProcessor, IScript script) { _ipOptions = ipOptions; _operatingSystemProcessor = operatingSystemProcessor; _hostNameProcessor = hostNameProcessor; _script = script; }
public void GetOperatingSystem(IOperatingSystemProcessor operatingSystemProcessor) { Get["/os"] = parameters => { var operatingSystem = operatingSystemProcessor.GetOperatingSystem(); var operatingSystemOutput = new MachineInformationResults { output = operatingSystem }; return(Response.AsJson(operatingSystemOutput)); }; }
public void GetOperatingSystem(IOperatingSystemProcessor operatingSystemProcessor) { Get["/os"] = parameters => { try { var operatingSystem = operatingSystemProcessor.GetOperatingSystem(); var operatingSystemOutput = new MachineInformationResults { result = operatingSystem }; return(Response.AsJson(operatingSystemOutput)); } catch (Exception e) { return(HttpStatusCode.InternalServerError); } }; }
public OperatingSystemEndpoint(IOperatingSystemProcessor operatingSystemProcessor) { GetOperatingSystem(operatingSystemProcessor); }