| GET | /allocations/{Id} |
|---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Bazefield.Allocations.WebService;
using Bazefield.Allocations.DataModel.Entities;
using Bazefield.WindAssets.Entity;
using Bazefield.Domain.Event.Entity;
namespace Bazefield.Allocations.DataModel.Entities
{
public partial class Allocation
{
public virtual int Id { get; set; }
public virtual int TurbineId { get; set; }
public virtual string ObjectId { get; set; }
public virtual string TurbineName { get; set; }
public virtual string TurbineTitle { get; set; }
public virtual int SourceId { get; set; }
public virtual string SourceName { get; set; }
public virtual string RootCause { get; set; }
public virtual TriggerAlarm TriggeredByAlarm { get; set; }
public virtual AllocationCategoryWithType Category { get; set; }
public virtual List<AllocationCategoryWithType> Categories { get; set; }
public virtual DateTime Start { get; set; }
public virtual DateTime End { get; set; }
public virtual DateTimeOffset Start_Local { get; set; }
public virtual DateTimeOffset End_Local { get; set; }
public virtual TimeSpan Duration { get; set; }
public virtual DateTime LastModified { get; set; }
public virtual bool IsUnclassified { get; set; }
public virtual bool? ManualOverrideLoss { get; set; }
public virtual DateTime? ResponseTime { get; set; }
public virtual double? LostProduction { get; set; }
public virtual double? LostProdutionFiltered { get; set; }
public virtual double? LostMoney { get; set; }
public virtual double? LostMoneyFiltered { get; set; }
public virtual List<AllocationPropertyValue> Properties { get; set; }
public virtual bool Finished { get; set; }
public virtual bool Manual { get; set; }
public virtual bool Overridden { get; set; }
public virtual bool Reallocated { get; set; }
public virtual bool Pending { get; set; }
public virtual string ChangeLog { get; set; }
public virtual Comment LastComment { get; set; }
public virtual string Exported { get; set; }
public virtual List<Label> Labels { get; set; }
public virtual bool? Suspect { get; set; }
public virtual bool Uncertain { get; set; }
public virtual int? EventId { get; set; }
public virtual bool HasEvent { get; set; }
public virtual bool HoldCategory { get; set; }
public virtual bool Approved { get; set; }
public virtual string SfId { get; set; }
public virtual string FirstAlarmSfId { get; set; }
public virtual int? RootCauseAlarmId { get; set; }
}
public partial class AllocationPropertyValue
{
public virtual string Name { get; set; }
public virtual string DisplayName { get; set; }
public virtual double Value { get; set; }
public virtual double? LimitedValue { get; set; }
public virtual string Unit { get; set; }
public virtual bool IsOverride { get; set; }
public virtual string Description { get; set; }
}
public partial class TriggerAlarm
{
public virtual Alarm Alarm { get; set; }
public virtual DateTime Start { get; set; }
public virtual DateTime? End { get; set; }
public virtual int LogId { get; set; }
public virtual string SfId { get; set; }
}
}
namespace Bazefield.Allocations.WebService
{
public partial class GetAllocation
{
public virtual int Id { get; set; }
}
}
namespace Bazefield.Domain.Event.Entity
{
public partial class AllocationCategory
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual string Acronym { get; set; }
public virtual string Color { get; set; }
public virtual bool Uncategorized { get; set; }
public virtual bool Available { get; set; }
public virtual int TypeId { get; set; }
public virtual string Group { get; set; }
public virtual byte SortIndex { get; set; }
public virtual int Priority { get; set; }
public virtual bool Enabled { get; set; }
public virtual byte Performance { get; set; }
public virtual int Excluded { get; set; }
public virtual int? ParentCategoryId { get; set; }
public virtual string ParentCategoryName { get; set; }
public virtual string Code { get; set; }
public virtual string VariantAlias { get; set; }
public virtual Dictionary<string, string> Attributes { get; set; }
}
public partial class AllocationCategoryWithType
: AllocationCategory
{
public virtual AllocationType AllocationType { get; set; }
}
public partial class AllocationType
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual string Acronym { get; set; }
public virtual string Version { get; set; }
public virtual string Description { get; set; }
public virtual int SortOrder { get; set; }
public virtual int? LinkedTypeId { get; set; }
public virtual bool? SubType { get; set; }
public virtual string GroupName { get; set; }
public virtual bool DefaultVisible { get; set; }
public virtual int? DomainId { get; set; }
public virtual bool Disabled { get; set; }
public virtual string Matrix { get; set; }
public virtual bool? Certified { get; set; }
public virtual int AllocationTypeClassId { get; set; }
public virtual int? VariantOfAbstractTypeId { get; set; }
}
}
namespace Bazefield.WindAssets.Entity
{
public partial class Alarm
{
public virtual int Id { get; set; }
public virtual int Code { get; set; }
public virtual AlarmCode AlarmCode { get; set; }
public virtual string Name { get; set; }
public virtual int BrakePrg { get; set; }
public virtual bool CanTriggerAllocation { get; set; }
public virtual string Description { get; set; }
public virtual string Remarks { get; set; }
public virtual Char ResetPrg { get; set; }
public virtual bool IsOkAlarm { get; set; }
public virtual Dictionary<string, string> Meta { get; set; }
public virtual byte AlarmType { get; set; }
public virtual string Type { get; set; }
}
public partial class AlarmCode
{
public virtual int EventNumber { get; set; }
public virtual int? Parameter1 { get; set; }
public virtual string VendorEventType { get; set; }
}
public partial class Comment
{
public virtual int Id { get; set; }
public virtual int? TurbineId { get; set; }
public virtual string TurbineName { get; set; }
public virtual DateTime TimeStamp { get; set; }
public virtual string Text { get; set; }
public virtual string CreatedBy { get; set; }
public virtual decimal? CreatedById { get; set; }
public virtual DateTime LastModified { get; set; }
public virtual CommentType Type { get; set; }
public virtual bool? External { get; set; }
public virtual bool? Sticky { get; set; }
public virtual int? AllocationId { get; set; }
public virtual int? AlarmLogId { get; set; }
public virtual int? AlarmId { get; set; }
public virtual int? CommandId { get; set; }
public virtual string RelatedInfo { get; set; }
public virtual bool Cleared { get; set; }
public virtual List<Label> Labels { get; set; }
public virtual string ObjectId { get; set; }
public virtual DateTime? RelatedStart { get; set; }
public virtual DateTime? RelatedEnd { get; set; }
}
public enum CommentType
{
Turbine,
Allocation,
Alarm,
}
public partial class Label
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual string Color { get; set; }
public virtual LabelType? Type { get; set; }
}
public enum LabelType
{
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.9011841S,
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
}