| GET | /allocations/{Id} |
|---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
open class GetAllocation
{
open var id:Int? = null
}
open class Allocation
{
open var id:Int? = null
open var turbineId:Int? = null
open var objectId:String? = null
open var turbineName:String? = null
open var turbineTitle:String? = null
open var sourceId:Int? = null
open var sourceName:String? = null
open var rootCause:String? = null
open var triggeredByAlarm:TriggerAlarm? = null
open var category:AllocationCategoryWithType? = null
open var categories:ArrayList<AllocationCategoryWithType>? = null
open var start:Date? = null
open var end:Date? = null
open var start_Local:Date? = null
open var end_Local:Date? = null
open var duration:TimeSpan? = null
open var lastModified:Date? = null
open var isUnclassified:Boolean? = null
open var manualOverrideLoss:Boolean? = null
open var responseTime:Date? = null
open var lostProduction:Double? = null
open var lostProdutionFiltered:Double? = null
open var lostMoney:Double? = null
open var lostMoneyFiltered:Double? = null
open var properties:ArrayList<AllocationPropertyValue>? = null
open var finished:Boolean? = null
open var manual:Boolean? = null
open var overridden:Boolean? = null
open var reallocated:Boolean? = null
open var pending:Boolean? = null
open var changeLog:String? = null
open var lastComment:Comment? = null
open var exported:String? = null
open var labels:ArrayList<Label>? = null
open var suspect:Boolean? = null
open var uncertain:Boolean? = null
open var eventId:Int? = null
open var hasEvent:Boolean? = null
open var holdCategory:Boolean? = null
open var approved:Boolean? = null
open var sfId:String? = null
open var firstAlarmSfId:String? = null
open var rootCauseAlarmId:Int? = null
}
open class TriggerAlarm
{
open var alarm:Alarm? = null
open var start:Date? = null
open var end:Date? = null
open var logId:Int? = null
open var sfId:String? = null
}
open class Alarm
{
open var id:Int? = null
open var code:Int? = null
open var alarmCode:AlarmCode? = null
open var name:String? = null
open var brakePrg:Int? = null
open var canTriggerAllocation:Boolean? = null
open var description:String? = null
open var remarks:String? = null
open var resetPrg:String? = null
open var isOkAlarm:Boolean? = null
open var meta:HashMap<String,String>? = null
open var alarmType:Short? = null
@SerializedName("type") open var Type:String? = null
}
open class AlarmCode
{
open var eventNumber:Int? = null
open var parameter1:Int? = null
open var vendorEventType:String? = null
}
open class AllocationCategoryWithType : AllocationCategory()
{
open var allocationType:AllocationType? = null
}
open class AllocationCategory
{
open var id:Int? = null
open var name:String? = null
open var acronym:String? = null
open var color:String? = null
open var uncategorized:Boolean? = null
open var available:Boolean? = null
open var typeId:Int? = null
open var group:String? = null
open var sortIndex:Short? = null
open var priority:Int? = null
open var enabled:Boolean? = null
open var performance:Short? = null
open var excluded:Int? = null
open var parentCategoryId:Int? = null
open var parentCategoryName:String? = null
open var code:String? = null
open var variantAlias:String? = null
open var attributes:HashMap<String,String>? = null
}
open class AllocationType
{
open var id:Int? = null
open var name:String? = null
open var acronym:String? = null
open var version:String? = null
open var description:String? = null
open var sortOrder:Int? = null
open var linkedTypeId:Int? = null
open var subType:Boolean? = null
open var groupName:String? = null
open var defaultVisible:Boolean? = null
open var domainId:Int? = null
open var disabled:Boolean? = null
open var matrix:String? = null
open var certified:Boolean? = null
open var allocationTypeClassId:Int? = null
open var variantOfAbstractTypeId:Int? = null
}
open class AllocationPropertyValue
{
open var name:String? = null
open var displayName:String? = null
open var value:Double? = null
open var limitedValue:Double? = null
open var unit:String? = null
open var isOverride:Boolean? = null
open var description:String? = null
}
open class Comment
{
open var id:Int? = null
open var turbineId:Int? = null
open var turbineName:String? = null
open var timeStamp:Date? = null
open var text:String? = null
open var createdBy:String? = null
open var createdById:BigDecimal? = null
open var lastModified:Date? = null
@SerializedName("type") open var Type:CommentType? = null
@SerializedName("external") open var External:Boolean? = null
open var sticky:Boolean? = null
open var allocationId:Int? = null
open var alarmLogId:Int? = null
open var alarmId:Int? = null
open var commandId:Int? = null
open var relatedInfo:String? = null
open var cleared:Boolean? = null
open var labels:ArrayList<Label>? = null
open var objectId:String? = null
open var relatedStart:Date? = null
open var relatedEnd:Date? = null
}
enum class CommentType
{
Turbine,
Allocation,
Alarm,
}
open class Label
{
open var id:Int? = null
open var name:String? = null
open var color:String? = null
@SerializedName("type") open var Type:LabelType? = null
}
enum class LabelType(val value:Int)
{
Allocation(1),
Other(2),
Alarm(3),
Case(4),
}
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.
GET /allocations/{Id} HTTP/1.1
Host: monitoring.ox2.com
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: 0,
turbineId: 0,
objectId: String,
turbineName: String,
turbineTitle: String,
sourceId: 0,
sourceName: String,
rootCause: String,
triggeredByAlarm:
{
alarm:
{
id: 0,
code: 0,
name: String,
brakePrg: 0,
canTriggerAllocation: False,
description: String,
remarks: String,
resetPrg: ,
isOkAlarm: False,
meta:
{
String: String
},
alarmType: 0,
type: Warning
},
start: 0001-01-01,
end: 0001-01-01,
logId: 0,
sfId: String
},
category:
{
allocationType:
{
id: 0,
name: String,
acronym: String,
version: String,
description: String,
sortOrder: 0,
linkedTypeId: 0,
subType: False,
groupName: String,
defaultVisible: False,
domainId: 0,
disabled: False,
matrix: String,
certified: False,
allocationTypeClassId: 0,
variantOfAbstractTypeId: 0
},
id: 0,
name: String,
acronym: String,
color: String,
uncategorized: False,
available: False,
typeId: 0,
group: String,
sortIndex: 0,
priority: 0,
enabled: False,
performance: 0,
excluded: 0,
parentCategoryId: 0,
parentCategoryName: String,
code: String,
variantAlias: String,
attributes:
{
String: String
}
},
categories:
[
{
allocationType:
{
id: 0,
name: String,
acronym: String,
version: String,
description: String,
sortOrder: 0,
linkedTypeId: 0,
subType: False,
groupName: String,
defaultVisible: False,
domainId: 0,
disabled: False,
matrix: String,
certified: False,
allocationTypeClassId: 0,
variantOfAbstractTypeId: 0
},
id: 0,
name: String,
acronym: String,
color: String,
uncategorized: False,
available: False,
typeId: 0,
group: String,
sortIndex: 0,
priority: 0,
enabled: False,
performance: 0,
excluded: 0,
parentCategoryId: 0,
parentCategoryName: String,
code: String,
variantAlias: String,
attributes:
{
String: String
}
}
],
start: 0001-01-01,
end: 0001-01-01,
start_Local: 0001-01-01T00:00:00.0000000+00:00,
end_Local: 0001-01-01T00:00:00.0000000+00:00,
duration: P739710DT15H34M23.9008484S,
lastModified: 0001-01-01,
isUnclassified: False,
manualOverrideLoss: False,
responseTime: 0001-01-01,
lostProduction: 0,
lostProdutionFiltered: 0,
lostMoney: 0,
lostMoneyFiltered: 0,
properties:
[
{
}
],
finished: False,
manual: False,
overridden: False,
reallocated: False,
pending: False,
changeLog: String,
lastComment:
{
id: 0,
turbineId: 0,
turbineName: String,
timeStamp: 0001-01-01,
text: String,
createdBy: String,
createdById: 0,
lastModified: 0001-01-01,
type: Turbine,
external: False,
sticky: False,
allocationId: 0,
alarmLogId: 0,
alarmId: 0,
commandId: 0,
relatedInfo: String,
cleared: False,
labels:
[
{
id: 0,
name: String,
color: String,
type: 0
}
],
objectId: String,
relatedStart: 0001-01-01,
relatedEnd: 0001-01-01
},
exported: String,
labels:
[
{
id: 0,
name: String,
color: String,
type: 0
}
],
suspect: False,
uncertain: False,
eventId: 0,
hasEvent: False,
holdCategory: False,
approved: False,
sfId: String,
firstAlarmSfId: String,
rootCauseAlarmId: 0
}