| GET | /allocations/{Id} |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class GetAllocation
{
public Integer id = null;
public Integer getId() { return id; }
public GetAllocation setId(Integer value) { this.id = value; return this; }
}
public static class Allocation
{
public Integer id = null;
public Integer turbineId = null;
public String objectId = null;
public String turbineName = null;
public String turbineTitle = null;
public Integer sourceId = null;
public String sourceName = null;
public String rootCause = null;
public TriggerAlarm triggeredByAlarm = null;
public AllocationCategoryWithType category = null;
public ArrayList<AllocationCategoryWithType> categories = null;
public Date start = null;
public Date end = null;
public Date start_Local = null;
public Date end_Local = null;
public TimeSpan duration = null;
public Date lastModified = null;
public Boolean isUnclassified = null;
public Boolean manualOverrideLoss = null;
public Date responseTime = null;
public Double lostProduction = null;
public Double lostProdutionFiltered = null;
public Double lostMoney = null;
public Double lostMoneyFiltered = null;
public ArrayList<AllocationPropertyValue> properties = null;
public Boolean finished = null;
public Boolean manual = null;
public Boolean overridden = null;
public Boolean reallocated = null;
public Boolean pending = null;
public String changeLog = null;
public Comment lastComment = null;
public String exported = null;
public ArrayList<Label> labels = null;
public Boolean suspect = null;
public Boolean uncertain = null;
public Integer eventId = null;
public Boolean hasEvent = null;
public Boolean holdCategory = null;
public Boolean approved = null;
public String sfId = null;
public String firstAlarmSfId = null;
public Integer rootCauseAlarmId = null;
public Integer getId() { return id; }
public Allocation setId(Integer value) { this.id = value; return this; }
public Integer getTurbineId() { return turbineId; }
public Allocation setTurbineId(Integer value) { this.turbineId = value; return this; }
public String getObjectId() { return objectId; }
public Allocation setObjectId(String value) { this.objectId = value; return this; }
public String getTurbineName() { return turbineName; }
public Allocation setTurbineName(String value) { this.turbineName = value; return this; }
public String getTurbineTitle() { return turbineTitle; }
public Allocation setTurbineTitle(String value) { this.turbineTitle = value; return this; }
public Integer getSourceId() { return sourceId; }
public Allocation setSourceId(Integer value) { this.sourceId = value; return this; }
public String getSourceName() { return sourceName; }
public Allocation setSourceName(String value) { this.sourceName = value; return this; }
public String getRootCause() { return rootCause; }
public Allocation setRootCause(String value) { this.rootCause = value; return this; }
public TriggerAlarm getTriggeredByAlarm() { return triggeredByAlarm; }
public Allocation setTriggeredByAlarm(TriggerAlarm value) { this.triggeredByAlarm = value; return this; }
public AllocationCategoryWithType getCategory() { return category; }
public Allocation setCategory(AllocationCategoryWithType value) { this.category = value; return this; }
public ArrayList<AllocationCategoryWithType> getCategories() { return categories; }
public Allocation setCategories(ArrayList<AllocationCategoryWithType> value) { this.categories = value; return this; }
public Date getStart() { return start; }
public Allocation setStart(Date value) { this.start = value; return this; }
public Date getEnd() { return end; }
public Allocation setEnd(Date value) { this.end = value; return this; }
public Date getStartLocal() { return start_Local; }
public Allocation setStartLocal(Date value) { this.start_Local = value; return this; }
public Date getEndLocal() { return end_Local; }
public Allocation setEndLocal(Date value) { this.end_Local = value; return this; }
public TimeSpan getDuration() { return duration; }
public Allocation setDuration(TimeSpan value) { this.duration = value; return this; }
public Date getLastModified() { return lastModified; }
public Allocation setLastModified(Date value) { this.lastModified = value; return this; }
public Boolean getIsUnclassified() { return isUnclassified; }
public Allocation setIsUnclassified(Boolean value) { this.isUnclassified = value; return this; }
public Boolean isManualOverrideLoss() { return manualOverrideLoss; }
public Allocation setManualOverrideLoss(Boolean value) { this.manualOverrideLoss = value; return this; }
public Date getResponseTime() { return responseTime; }
public Allocation setResponseTime(Date value) { this.responseTime = value; return this; }
public Double getLostProduction() { return lostProduction; }
public Allocation setLostProduction(Double value) { this.lostProduction = value; return this; }
public Double getLostProdutionFiltered() { return lostProdutionFiltered; }
public Allocation setLostProdutionFiltered(Double value) { this.lostProdutionFiltered = value; return this; }
public Double getLostMoney() { return lostMoney; }
public Allocation setLostMoney(Double value) { this.lostMoney = value; return this; }
public Double getLostMoneyFiltered() { return lostMoneyFiltered; }
public Allocation setLostMoneyFiltered(Double value) { this.lostMoneyFiltered = value; return this; }
public ArrayList<AllocationPropertyValue> getProperties() { return properties; }
public Allocation setProperties(ArrayList<AllocationPropertyValue> value) { this.properties = value; return this; }
public Boolean isFinished() { return finished; }
public Allocation setFinished(Boolean value) { this.finished = value; return this; }
public Boolean isManual() { return manual; }
public Allocation setManual(Boolean value) { this.manual = value; return this; }
public Boolean isOverridden() { return overridden; }
public Allocation setOverridden(Boolean value) { this.overridden = value; return this; }
public Boolean isReallocated() { return reallocated; }
public Allocation setReallocated(Boolean value) { this.reallocated = value; return this; }
public Boolean isPending() { return pending; }
public Allocation setPending(Boolean value) { this.pending = value; return this; }
public String getChangeLog() { return changeLog; }
public Allocation setChangeLog(String value) { this.changeLog = value; return this; }
public Comment getLastComment() { return lastComment; }
public Allocation setLastComment(Comment value) { this.lastComment = value; return this; }
public String getExported() { return exported; }
public Allocation setExported(String value) { this.exported = value; return this; }
public ArrayList<Label> getLabels() { return labels; }
public Allocation setLabels(ArrayList<Label> value) { this.labels = value; return this; }
public Boolean isSuspect() { return suspect; }
public Allocation setSuspect(Boolean value) { this.suspect = value; return this; }
public Boolean isUncertain() { return uncertain; }
public Allocation setUncertain(Boolean value) { this.uncertain = value; return this; }
public Integer getEventId() { return eventId; }
public Allocation setEventId(Integer value) { this.eventId = value; return this; }
public Boolean isHasEvent() { return hasEvent; }
public Allocation setHasEvent(Boolean value) { this.hasEvent = value; return this; }
public Boolean isHoldCategory() { return holdCategory; }
public Allocation setHoldCategory(Boolean value) { this.holdCategory = value; return this; }
public Boolean isApproved() { return approved; }
public Allocation setApproved(Boolean value) { this.approved = value; return this; }
public String getSfId() { return sfId; }
public Allocation setSfId(String value) { this.sfId = value; return this; }
public String getFirstAlarmSfId() { return firstAlarmSfId; }
public Allocation setFirstAlarmSfId(String value) { this.firstAlarmSfId = value; return this; }
public Integer getRootCauseAlarmId() { return rootCauseAlarmId; }
public Allocation setRootCauseAlarmId(Integer value) { this.rootCauseAlarmId = value; return this; }
}
public static class TriggerAlarm
{
public Alarm alarm = null;
public Date start = null;
public Date end = null;
public Integer logId = null;
public String sfId = null;
public Alarm getAlarm() { return alarm; }
public TriggerAlarm setAlarm(Alarm value) { this.alarm = value; return this; }
public Date getStart() { return start; }
public TriggerAlarm setStart(Date value) { this.start = value; return this; }
public Date getEnd() { return end; }
public TriggerAlarm setEnd(Date value) { this.end = value; return this; }
public Integer getLogId() { return logId; }
public TriggerAlarm setLogId(Integer value) { this.logId = value; return this; }
public String getSfId() { return sfId; }
public TriggerAlarm setSfId(String value) { this.sfId = value; return this; }
}
public static class Alarm
{
public Integer id = null;
public Integer code = null;
public AlarmCode alarmCode = null;
public String name = null;
public Integer brakePrg = null;
public Boolean canTriggerAllocation = null;
public String description = null;
public String remarks = null;
public String resetPrg = null;
public Boolean isOkAlarm = null;
public HashMap<String,String> meta = null;
public Short alarmType = null;
public String type = null;
public Integer getId() { return id; }
public Alarm setId(Integer value) { this.id = value; return this; }
public Integer getCode() { return code; }
public Alarm setCode(Integer value) { this.code = value; return this; }
public AlarmCode getAlarmCode() { return alarmCode; }
public Alarm setAlarmCode(AlarmCode value) { this.alarmCode = value; return this; }
public String getName() { return name; }
public Alarm setName(String value) { this.name = value; return this; }
public Integer getBrakePrg() { return brakePrg; }
public Alarm setBrakePrg(Integer value) { this.brakePrg = value; return this; }
public Boolean isCanTriggerAllocation() { return canTriggerAllocation; }
public Alarm setCanTriggerAllocation(Boolean value) { this.canTriggerAllocation = value; return this; }
public String getDescription() { return description; }
public Alarm setDescription(String value) { this.description = value; return this; }
public String getRemarks() { return remarks; }
public Alarm setRemarks(String value) { this.remarks = value; return this; }
public String getResetPrg() { return resetPrg; }
public Alarm setResetPrg(String value) { this.resetPrg = value; return this; }
public Boolean getIsOkAlarm() { return isOkAlarm; }
public Alarm setIsOkAlarm(Boolean value) { this.isOkAlarm = value; return this; }
public HashMap<String,String> getMeta() { return meta; }
public Alarm setMeta(HashMap<String,String> value) { this.meta = value; return this; }
public Short getAlarmType() { return alarmType; }
public Alarm setAlarmType(Short value) { this.alarmType = value; return this; }
public String getType() { return type; }
public Alarm setType(String value) { this.type = value; return this; }
}
public static class AlarmCode
{
public Integer eventNumber = null;
public Integer parameter1 = null;
public String vendorEventType = null;
public Integer getEventNumber() { return eventNumber; }
public AlarmCode setEventNumber(Integer value) { this.eventNumber = value; return this; }
public Integer getParameter1() { return parameter1; }
public AlarmCode setParameter1(Integer value) { this.parameter1 = value; return this; }
public String getVendorEventType() { return vendorEventType; }
public AlarmCode setVendorEventType(String value) { this.vendorEventType = value; return this; }
}
public static class AllocationCategoryWithType extends AllocationCategory
{
public AllocationType allocationType = null;
public AllocationType getAllocationType() { return allocationType; }
public AllocationCategoryWithType setAllocationType(AllocationType value) { this.allocationType = value; return this; }
}
public static class AllocationCategory
{
public Integer id = null;
public String name = null;
public String acronym = null;
public String color = null;
public Boolean uncategorized = null;
public Boolean available = null;
public Integer typeId = null;
public String group = null;
public Short sortIndex = null;
public Integer priority = null;
public Boolean enabled = null;
public Short performance = null;
public Integer excluded = null;
public Integer parentCategoryId = null;
public String parentCategoryName = null;
public String code = null;
public String variantAlias = null;
public HashMap<String,String> attributes = null;
public Integer getId() { return id; }
public AllocationCategory setId(Integer value) { this.id = value; return this; }
public String getName() { return name; }
public AllocationCategory setName(String value) { this.name = value; return this; }
public String getAcronym() { return acronym; }
public AllocationCategory setAcronym(String value) { this.acronym = value; return this; }
public String getColor() { return color; }
public AllocationCategory setColor(String value) { this.color = value; return this; }
public Boolean isUncategorized() { return uncategorized; }
public AllocationCategory setUncategorized(Boolean value) { this.uncategorized = value; return this; }
public Boolean isAvailable() { return available; }
public AllocationCategory setAvailable(Boolean value) { this.available = value; return this; }
public Integer getTypeId() { return typeId; }
public AllocationCategory setTypeId(Integer value) { this.typeId = value; return this; }
public String getGroup() { return group; }
public AllocationCategory setGroup(String value) { this.group = value; return this; }
public Short getSortIndex() { return sortIndex; }
public AllocationCategory setSortIndex(Short value) { this.sortIndex = value; return this; }
public Integer getPriority() { return priority; }
public AllocationCategory setPriority(Integer value) { this.priority = value; return this; }
public Boolean isEnabled() { return enabled; }
public AllocationCategory setEnabled(Boolean value) { this.enabled = value; return this; }
public Short getPerformance() { return performance; }
public AllocationCategory setPerformance(Short value) { this.performance = value; return this; }
public Integer getExcluded() { return excluded; }
public AllocationCategory setExcluded(Integer value) { this.excluded = value; return this; }
public Integer getParentCategoryId() { return parentCategoryId; }
public AllocationCategory setParentCategoryId(Integer value) { this.parentCategoryId = value; return this; }
public String getParentCategoryName() { return parentCategoryName; }
public AllocationCategory setParentCategoryName(String value) { this.parentCategoryName = value; return this; }
public String getCode() { return code; }
public AllocationCategory setCode(String value) { this.code = value; return this; }
public String getVariantAlias() { return variantAlias; }
public AllocationCategory setVariantAlias(String value) { this.variantAlias = value; return this; }
public HashMap<String,String> getAttributes() { return attributes; }
public AllocationCategory setAttributes(HashMap<String,String> value) { this.attributes = value; return this; }
}
public static class AllocationType
{
public Integer id = null;
public String name = null;
public String acronym = null;
public String version = null;
public String description = null;
public Integer sortOrder = null;
public Integer linkedTypeId = null;
public Boolean subType = null;
public String groupName = null;
public Boolean defaultVisible = null;
public Integer domainId = null;
public Boolean disabled = null;
public String matrix = null;
public Boolean certified = null;
public Integer allocationTypeClassId = null;
public Integer variantOfAbstractTypeId = null;
public Integer getId() { return id; }
public AllocationType setId(Integer value) { this.id = value; return this; }
public String getName() { return name; }
public AllocationType setName(String value) { this.name = value; return this; }
public String getAcronym() { return acronym; }
public AllocationType setAcronym(String value) { this.acronym = value; return this; }
public String getVersion() { return version; }
public AllocationType setVersion(String value) { this.version = value; return this; }
public String getDescription() { return description; }
public AllocationType setDescription(String value) { this.description = value; return this; }
public Integer getSortOrder() { return sortOrder; }
public AllocationType setSortOrder(Integer value) { this.sortOrder = value; return this; }
public Integer getLinkedTypeId() { return linkedTypeId; }
public AllocationType setLinkedTypeId(Integer value) { this.linkedTypeId = value; return this; }
public Boolean isSubType() { return subType; }
public AllocationType setSubType(Boolean value) { this.subType = value; return this; }
public String getGroupName() { return groupName; }
public AllocationType setGroupName(String value) { this.groupName = value; return this; }
public Boolean isDefaultVisible() { return defaultVisible; }
public AllocationType setDefaultVisible(Boolean value) { this.defaultVisible = value; return this; }
public Integer getDomainId() { return domainId; }
public AllocationType setDomainId(Integer value) { this.domainId = value; return this; }
public Boolean isDisabled() { return disabled; }
public AllocationType setDisabled(Boolean value) { this.disabled = value; return this; }
public String getMatrix() { return matrix; }
public AllocationType setMatrix(String value) { this.matrix = value; return this; }
public Boolean isCertified() { return certified; }
public AllocationType setCertified(Boolean value) { this.certified = value; return this; }
public Integer getAllocationTypeClassId() { return allocationTypeClassId; }
public AllocationType setAllocationTypeClassId(Integer value) { this.allocationTypeClassId = value; return this; }
public Integer getVariantOfAbstractTypeId() { return variantOfAbstractTypeId; }
public AllocationType setVariantOfAbstractTypeId(Integer value) { this.variantOfAbstractTypeId = value; return this; }
}
public static class AllocationPropertyValue
{
public String name = null;
public String displayName = null;
public Double value = null;
public Double limitedValue = null;
public String unit = null;
public Boolean isOverride = null;
public String description = null;
public String getName() { return name; }
public AllocationPropertyValue setName(String value) { this.name = value; return this; }
public String getDisplayName() { return displayName; }
public AllocationPropertyValue setDisplayName(String value) { this.displayName = value; return this; }
public Double getValue() { return value; }
public AllocationPropertyValue setValue(Double value) { this.value = value; return this; }
public Double getLimitedValue() { return limitedValue; }
public AllocationPropertyValue setLimitedValue(Double value) { this.limitedValue = value; return this; }
public String getUnit() { return unit; }
public AllocationPropertyValue setUnit(String value) { this.unit = value; return this; }
public Boolean getIsOverride() { return isOverride; }
public AllocationPropertyValue setIsOverride(Boolean value) { this.isOverride = value; return this; }
public String getDescription() { return description; }
public AllocationPropertyValue setDescription(String value) { this.description = value; return this; }
}
public static class Comment
{
public Integer id = null;
public Integer turbineId = null;
public String turbineName = null;
public Date timeStamp = null;
public String text = null;
public String createdBy = null;
public BigDecimal createdById = null;
public Date lastModified = null;
public CommentType type = null;
public Boolean external = null;
public Boolean sticky = null;
public Integer allocationId = null;
public Integer alarmLogId = null;
public Integer alarmId = null;
public Integer commandId = null;
public String relatedInfo = null;
public Boolean cleared = null;
public ArrayList<Label> labels = null;
public String objectId = null;
public Date relatedStart = null;
public Date relatedEnd = null;
public Integer getId() { return id; }
public Comment setId(Integer value) { this.id = value; return this; }
public Integer getTurbineId() { return turbineId; }
public Comment setTurbineId(Integer value) { this.turbineId = value; return this; }
public String getTurbineName() { return turbineName; }
public Comment setTurbineName(String value) { this.turbineName = value; return this; }
public Date getTimeStamp() { return timeStamp; }
public Comment setTimeStamp(Date value) { this.timeStamp = value; return this; }
public String getText() { return text; }
public Comment setText(String value) { this.text = value; return this; }
public String getCreatedBy() { return createdBy; }
public Comment setCreatedBy(String value) { this.createdBy = value; return this; }
public BigDecimal getCreatedById() { return createdById; }
public Comment setCreatedById(BigDecimal value) { this.createdById = value; return this; }
public Date getLastModified() { return lastModified; }
public Comment setLastModified(Date value) { this.lastModified = value; return this; }
public CommentType getType() { return type; }
public Comment setType(CommentType value) { this.type = value; return this; }
public Boolean isExternal() { return external; }
public Comment setExternal(Boolean value) { this.external = value; return this; }
public Boolean isSticky() { return sticky; }
public Comment setSticky(Boolean value) { this.sticky = value; return this; }
public Integer getAllocationId() { return allocationId; }
public Comment setAllocationId(Integer value) { this.allocationId = value; return this; }
public Integer getAlarmLogId() { return alarmLogId; }
public Comment setAlarmLogId(Integer value) { this.alarmLogId = value; return this; }
public Integer getAlarmId() { return alarmId; }
public Comment setAlarmId(Integer value) { this.alarmId = value; return this; }
public Integer getCommandId() { return commandId; }
public Comment setCommandId(Integer value) { this.commandId = value; return this; }
public String getRelatedInfo() { return relatedInfo; }
public Comment setRelatedInfo(String value) { this.relatedInfo = value; return this; }
public Boolean isCleared() { return cleared; }
public Comment setCleared(Boolean value) { this.cleared = value; return this; }
public ArrayList<Label> getLabels() { return labels; }
public Comment setLabels(ArrayList<Label> value) { this.labels = value; return this; }
public String getObjectId() { return objectId; }
public Comment setObjectId(String value) { this.objectId = value; return this; }
public Date getRelatedStart() { return relatedStart; }
public Comment setRelatedStart(Date value) { this.relatedStart = value; return this; }
public Date getRelatedEnd() { return relatedEnd; }
public Comment setRelatedEnd(Date value) { this.relatedEnd = value; return this; }
}
public static enum CommentType
{
Turbine,
Allocation,
Alarm;
}
public static class Label
{
public Integer id = null;
public String name = null;
public String color = null;
public LabelType type = null;
public Integer getId() { return id; }
public Label setId(Integer value) { this.id = value; return this; }
public String getName() { return name; }
public Label setName(String value) { this.name = value; return this; }
public String getColor() { return color; }
public Label setColor(String value) { this.color = value; return this; }
public LabelType getType() { return type; }
public Label setType(LabelType value) { this.type = value; return this; }
}
public static enum LabelType
{
Allocation(1),
Other(2),
Alarm(3),
Case(4);
private final int value;
LabelType(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
}
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: P739710DT11H21M54.0800095S,
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
}