BazeField Services

<back to all web services

GetAllocation

Allocations API
Requires Authentication
The following routes are available for this service:
GET/allocations/{Id}
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Bazefield.Allocations.WebService
Imports Bazefield.Allocations.DataModel.Entities
Imports Bazefield.WindAssets.Entity
Imports Bazefield.Domain.Event.Entity

Namespace Global

    Namespace Bazefield.Allocations.DataModel.Entities

        Public Partial Class Allocation
            Public Overridable Property Id As Integer
            Public Overridable Property TurbineId As Integer
            Public Overridable Property ObjectId As String
            Public Overridable Property TurbineName As String
            Public Overridable Property TurbineTitle As String
            Public Overridable Property SourceId As Integer
            Public Overridable Property SourceName As String
            Public Overridable Property RootCause As String
            Public Overridable Property TriggeredByAlarm As TriggerAlarm
            Public Overridable Property Category As AllocationCategoryWithType
            Public Overridable Property Categories As List(Of AllocationCategoryWithType)
            Public Overridable Property Start As Date
            Public Overridable Property [End] As Date
            Public Overridable Property Start_Local As DateTimeOffset
            Public Overridable Property End_Local As DateTimeOffset
            Public Overridable Property Duration As TimeSpan
            Public Overridable Property LastModified As Date
            Public Overridable Property IsUnclassified As Boolean
            Public Overridable Property ManualOverrideLoss As Boolean?
            Public Overridable Property ResponseTime As Date?
            Public Overridable Property LostProduction As Double?
            Public Overridable Property LostProdutionFiltered As Double?
            Public Overridable Property LostMoney As Double?
            Public Overridable Property LostMoneyFiltered As Double?
            Public Overridable Property Properties As List(Of AllocationPropertyValue)
            Public Overridable Property Finished As Boolean
            Public Overridable Property Manual As Boolean
            Public Overridable Property Overridden As Boolean
            Public Overridable Property Reallocated As Boolean
            Public Overridable Property Pending As Boolean
            Public Overridable Property ChangeLog As String
            Public Overridable Property LastComment As Comment
            Public Overridable Property Exported As String
            Public Overridable Property Labels As List(Of Label)
            Public Overridable Property Suspect As Boolean?
            Public Overridable Property Uncertain As Boolean
            Public Overridable Property EventId As Integer?
            Public Overridable Property HasEvent As Boolean
            Public Overridable Property HoldCategory As Boolean
            Public Overridable Property Approved As Boolean
            Public Overridable Property SfId As String
            Public Overridable Property FirstAlarmSfId As String
            Public Overridable Property RootCauseAlarmId As Integer?
        End Class

        Public Partial Class AllocationPropertyValue
            Public Overridable Property Name As String
            Public Overridable Property DisplayName As String
            Public Overridable Property Value As Double
            Public Overridable Property LimitedValue As Double?
            Public Overridable Property Unit As String
            Public Overridable Property IsOverride As Boolean
            Public Overridable Property Description As String
        End Class

        Public Partial Class TriggerAlarm
            Public Overridable Property Alarm As Alarm
            Public Overridable Property Start As Date
            Public Overridable Property [End] As Date?
            Public Overridable Property LogId As Integer
            Public Overridable Property SfId As String
        End Class
    End Namespace

    Namespace Bazefield.Allocations.WebService

        Public Partial Class GetAllocation
            Public Overridable Property Id As Integer
        End Class
    End Namespace

    Namespace Bazefield.Domain.Event.Entity

        Public Partial Class AllocationCategory
            Public Overridable Property Id As Integer
            Public Overridable Property Name As String
            Public Overridable Property Acronym As String
            Public Overridable Property Color As String
            Public Overridable Property Uncategorized As Boolean
            Public Overridable Property Available As Boolean
            Public Overridable Property TypeId As Integer
            Public Overridable Property Group As String
            Public Overridable Property SortIndex As Byte
            Public Overridable Property Priority As Integer
            Public Overridable Property Enabled As Boolean
            Public Overridable Property Performance As Byte
            Public Overridable Property Excluded As Integer
            Public Overridable Property ParentCategoryId As Integer?
            Public Overridable Property ParentCategoryName As String
            Public Overridable Property Code As String
            Public Overridable Property VariantAlias As String
            Public Overridable Property Attributes As Dictionary(Of String, String)
        End Class

        Public Partial Class AllocationCategoryWithType
            Inherits AllocationCategory
            Public Overridable Property AllocationType As AllocationType
        End Class

        Public Partial Class AllocationType
            Public Overridable Property Id As Integer
            Public Overridable Property Name As String
            Public Overridable Property Acronym As String
            Public Overridable Property Version As String
            Public Overridable Property Description As String
            Public Overridable Property SortOrder As Integer
            Public Overridable Property LinkedTypeId As Integer?
            Public Overridable Property SubType As Boolean?
            Public Overridable Property GroupName As String
            Public Overridable Property DefaultVisible As Boolean
            Public Overridable Property DomainId As Integer?
            Public Overridable Property Disabled As Boolean
            Public Overridable Property Matrix As String
            Public Overridable Property Certified As Boolean?
            Public Overridable Property AllocationTypeClassId As Integer
            Public Overridable Property VariantOfAbstractTypeId As Integer?
        End Class
    End Namespace

    Namespace Bazefield.WindAssets.Entity

        Public Partial Class Alarm
            Public Overridable Property Id As Integer
            Public Overridable Property Code As Integer
            Public Overridable Property AlarmCode As AlarmCode
            Public Overridable Property Name As String
            Public Overridable Property BrakePrg As Integer
            Public Overridable Property CanTriggerAllocation As Boolean
            Public Overridable Property Description As String
            Public Overridable Property Remarks As String
            Public Overridable Property ResetPrg As Char
            Public Overridable Property IsOkAlarm As Boolean
            Public Overridable Property Meta As Dictionary(Of String, String)
            Public Overridable Property AlarmType As Byte
            Public Overridable Property Type As String
        End Class

        Public Partial Class AlarmCode
            Public Overridable Property EventNumber As Integer
            Public Overridable Property Parameter1 As Integer?
            Public Overridable Property VendorEventType As String
        End Class

        Public Partial Class Comment
            Public Overridable Property Id As Integer
            Public Overridable Property TurbineId As Integer?
            Public Overridable Property TurbineName As String
            Public Overridable Property TimeStamp As Date
            Public Overridable Property Text As String
            Public Overridable Property CreatedBy As String
            Public Overridable Property CreatedById As Decimal?
            Public Overridable Property LastModified As Date
            Public Overridable Property Type As CommentType
            Public Overridable Property External As Boolean?
            Public Overridable Property Sticky As Boolean?
            Public Overridable Property AllocationId As Integer?
            Public Overridable Property AlarmLogId As Integer?
            Public Overridable Property AlarmId As Integer?
            Public Overridable Property CommandId As Integer?
            Public Overridable Property RelatedInfo As String
            Public Overridable Property Cleared As Boolean
            Public Overridable Property Labels As List(Of Label)
            Public Overridable Property ObjectId As String
            Public Overridable Property RelatedStart As Date?
            Public Overridable Property RelatedEnd As Date?
        End Class

        Public Enum CommentType
            Turbine
            Allocation
            Alarm
        End Enum

        Public Partial Class Label
            Public Overridable Property Id As Integer
            Public Overridable Property Name As String
            Public Overridable Property Color As String
            Public Overridable Property Type As LabelType?
        End Class

        Public Enum LabelType
            Allocation = 1
            Other = 2
            Alarm = 3
            [Case] = 4
        End Enum
    End Namespace
End Namespace

VB.NET GetAllocation DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + 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: P739710DT15H34M52.3053665S,
	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
}