/* Options: Date: 2024-09-19 23:41:08 SwiftVersion: 5.0 Version: 6.50 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: http://identity.extremereach.com //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: HealthCheckRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/healthcheck", "GET") public class HealthCheckRequest : IReturn, Codable { public typealias Return = HealthCheckResponse /** * The mode used to determine what level of health check to perform. */ // @ApiMember(DataType="ExecutionMode", Description="The mode used to determine what level of health check to perform.", IsRequired=true, ParameterType="query") public var executionMode:ExecutionMode /** * The type of server that will be used to determine which monitors will be run. */ // @ApiMember(DataType="ServerType", Description="The type of server that will be used to determine which monitors will be run.", IsRequired=true, ParameterType="query") public var serverType:ServerType /** * Indicates whether or not to include server state information in the response. */ // @ApiMember(DataType="boolean", Description="Indicates whether or not to include server state information in the response.", ParameterType="query") public var includeServerStateInformation:Bool /** * Indicates whether or not to suppress returning error codes. This will always return a 200 code to the caller, which is required for PRTG to process the JSON response properly. */ // @ApiMember(DataType="boolean", Description="Indicates whether or not to suppress returning error codes. This will always return a 200 code to the caller, which is required for PRTG to process the JSON response properly.", ParameterType="query") public var suppressErrorCodes:Bool /** * Indicates whether or not to suppress deployment-related errors. */ // @ApiMember(DataType="boolean", Description="Indicates whether or not to suppress deployment-related errors.", ParameterType="query") public var suppressDeploymentErrors:Bool required public init(){} } public class HealthCheckResponse : Codable { public var serverState:ServerState public var status:MonitoringStatus public var statusMessage:String public var correlationId:String public var failedMonitorCount:Int public var monitorSummaries:[MonitorSummary] = [] public var executionMetrics:MonitorExecutionMetrics required public init(){} } public enum ExecutionMode : Int, Codable { case Basic = 1 case Standard = 2 case Advanced = 3 } public enum ServerType : Int, Codable { case App = 1 case Sql = 2 case FtpApi = 3 case Ftp = 4 case Batch = 5 case Identity = 6 case Qc = 7 case XcodeV = 8 case XcodeC = 9 case MsgVast = 10 case AsgVast = 11 case Mongo = 12 case Agents = 13 } public class ServerState : Codable { public var serverName:String public var totalRamInMb:Double? public var availableRamInMb:Double? public var usedCpuPercent:Double? required public init(){} } public enum MonitoringStatus : Int, Codable { case Success = 1 case Failure = 2 } public class MonitorSummary : Codable { public var monitorName:String public var status:MonitoringStatus public var results:[MonitoringResult] = [] public var errorMessages:[String] = [] required public init(){} } public class MonitorExecutionMetrics : Codable { public var startDateTime:Date public var endDateTime:Date @TimeSpan public var duration:TimeInterval required public init(){} } public class MonitoringResult : Codable { public var monitoringName:String public var status:MonitoringStatus public var statusMessage:String public var errorMessages:[String] = [] required public init(){} }