private void GetHostname(IHostNameProcessor hostnameProcessor) { Get["/hostname{fullyQualified}"] = parameters => { try { var fullyQualifiedQuery = this.Bind <fullyQualifiedModel>(); var hostname = hostnameProcessor.GetHostName(); if (fullyQualifiedQuery.fullyQualified) { hostname = hostnameProcessor.GetFullyQualifiedHostName(); } var HostNameOutput = new MachineInformationResults { result = hostname }; return(Response.AsJson(HostNameOutput)); } catch (Exception e) { return(HttpStatusCode.InternalServerError); } }; }
public void GetIPEndpoint(IIpAddressProcessor ipAddressProcessor) { Get["/ip"] = parameters => { var ipAddress = ipAddressProcessor.GetIPAddress(); var ipAdressOutput = new MachineInformationResults { output = ipAddress }; return(Response.AsJson(ipAdressOutput)); }; }
public void GetOperatingSystem(IOperatingSystemProcessor operatingSystemProcessor) { Get["/os"] = parameters => { var operatingSystem = operatingSystemProcessor.GetOperatingSystem(); var operatingSystemOutput = new MachineInformationResults { output = operatingSystem }; return(Response.AsJson(operatingSystemOutput)); }; }
private void GetHostname(IHostNameProcessor hostnameProcessor) { Get["/hostname{fullyQualified}"] = parameters => { var fullyQualifiedQuery = this.Bind <fullyQualifiedModel>(); var hostname = hostnameProcessor.GetHostName(); if (fullyQualifiedQuery.fullyQualified) { hostname = hostnameProcessor.GetFullyQualifiedHostName(); } var HostNameOutput = new MachineInformationResults { output = hostname }; return(Response.AsJson(HostNameOutput)); }; }
public void GetIPEndpoint(IIpAddressProcessor ipAddressProcessor) { Get["/ip"] = parameters => { try { var ipAddress = ipAddressProcessor.GetIPAddress(); var ipAdressOutput = new MachineInformationResults { result = ipAddress }; return(Response.AsJson(ipAdressOutput)); } catch (Exception e) { return(HttpStatusCode.InternalServerError); } }; }
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); } }; }