POST | /optimizer/tod |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports powerDev.Optimization.ServiceModel
Imports powerDev.Common.Models
Imports powerDev.Common.Types
Namespace Global
Namespace powerDev.Common.Models
Public Partial Class AnnualRateItem
Public Overridable Property Year As Integer
Public Overridable Property Value As Decimal
End Class
Public Partial Class TodOptimizerRequestBase
Public Overridable Property ProjectId As Guid
Public Overridable Property ChargeDischargeLimit As Decimal
Public Overridable Property BatteryCapacity As Decimal
Public Overridable Property ChargeEfficiency As Decimal
Public Overridable Property DischargeEfficiency As Decimal
Public Overridable Property ParaciticLossesOperation As Decimal
Public Overridable Property ParaciticLossesResting As Decimal
Public Overridable Property HVACLosses As Decimal
Public Overridable Property AcCablingLosses As Decimal
Public Overridable Property TransformatorLosses As Decimal
Public Overridable Property ThermalLosses As Decimal
Public Overridable Property UnavailabilityLoss As Decimal
Public Overridable Property OtherLosses As Decimal
Public Overridable Property EnableCapacity As Boolean
Public Overridable Property EnergySchedule As IEnumerable(Of AnnualRateItem)
Public Overridable Property CapacitySchedule As IEnumerable(Of AnnualRateItem)
Public Overridable Property YoyFactors As IEnumerable(Of YoyFactorOptimizarItem)
Public Overridable Property Data As IEnumerable(Of TodOptimizerRequestItem)
Public Overridable Property ApiActionId As Guid
End Class
Public Partial Class TodOptimizerRequestItem
Public Overridable Property Year As Integer
Public Overridable Property Month As Integer
Public Overridable Property Hour As Integer
Public Overridable Property WeekDay As Integer
Public Overridable Property EnergyPrice As Decimal
Public Overridable Property CapacityPrice As Decimal
End Class
Public Partial Class TodOptimizerResponse
Public Sub New()
TestItems = New List(Of TodOptimizerResponseItem)
End Sub
Public Overridable Property Status As ApiResponseStatus
Public Overridable Property Message As String
Public Overridable Property ApiActionId As Guid
Public Overridable Property TestItems As List(Of TodOptimizerResponseItem)
End Class
Public Partial Class TodOptimizerResponseItem
Inherits TodOptimizerRequestItem
Public Overridable Property ChargeState As Decimal
Public Overridable Property Charging As Decimal
Public Overridable Property Loss As Decimal
Public Overridable Property ChargeRate As Decimal
End Class
Public Partial Class YoyFactorOptimizarItem
Public Overridable Property Year As Integer
Public Overridable Property Factor As Decimal
End Class
End Namespace
Namespace powerDev.Common.Types
Public Enum ApiResponseStatus
Undefined = 0
Success = 1
Pending = 10
Failed = 100
End Enum
End Namespace
Namespace powerDev.Optimization.ServiceModel
Public Partial Class TODOptimizerRequest
Inherits TodOptimizerRequestBase
End Class
End Namespace
End Namespace
VB.NET TODOptimizerRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /optimizer/tod HTTP/1.1
Host: dev-optimization.power.dev
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
projectId: 00000000000000000000000000000000,
chargeDischargeLimit: 0,
batteryCapacity: 0,
chargeEfficiency: 0,
dischargeEfficiency: 0,
paraciticLossesOperation: 0,
paraciticLossesResting: 0,
hvacLosses: 0,
acCablingLosses: 0,
transformatorLosses: 0,
thermalLosses: 0,
unavailabilityLoss: 0,
otherLosses: 0,
enableCapacity: False,
apiActionId: 00000000000000000000000000000000
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { status: Undefined, message: String, apiActionId: 00000000000000000000000000000000, testItems: [ { chargeState: 0, charging: 0, loss: 0, chargeRate: 0, year: 0, month: 0, hour: 0, weekDay: 0, energyPrice: 0, capacityPrice: 0 } ] }