| Required role: | TenantReader |
| GET | /timeseries/{TimeSeriesId}/datapoints | Returns all timeseries data | |
|---|---|---|---|
| GET | /api/timeseries/{TimeSeriesId}/datapoints | Returns all timeseries data |
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports CoreService.ServiceModel.Dtos.TimeSeries.Crud
Imports CoreService.ServiceModel.BusinessObjects.TimeSeries
Imports YCO.Dune.Models.Enums
Imports CoreService.ServiceModel.Enums
Imports CoreService.ServiceModel.BusinessObjects.Audit
Imports CoreService.ServiceModel.BusinessObjects.Structure
Imports CoreService.ServiceModel.BusinessObjects.Base
Namespace Global
Namespace CoreService.ServiceModel.BusinessObjects.Audit
Public Partial Class Auditable
Implements IAuditable
<Required>
Public Overridable Property Created As Date Implements IAuditable.Created
<Required>
Public Overridable Property CreateUser As String Implements IAuditable.CreateUser
<Required>
Public Overridable Property CreateUserId As String Implements IAuditable.CreateUserId
<Required>
Public Overridable Property Modified As Date Implements IAuditable.Modified
<Required>
Public Overridable Property ModifyUser As String Implements IAuditable.ModifyUser
<Required>
Public Overridable Property ModifyUserId As String Implements IAuditable.ModifyUserId
<Required>
Public Overridable Property IsDeleted As Boolean Implements IAuditable.IsDeleted
Public Overridable Property Deleted As Date? Implements IAuditable.Deleted
Public Overridable Property DeleteUser As String Implements IAuditable.DeleteUser
Public Overridable Property DeleteUserId As String Implements IAuditable.DeleteUserId
End Class
End Namespace
Namespace CoreService.ServiceModel.BusinessObjects.Base
Public Partial Class ConfigItem
Inherits Auditable
Implements IConfigItem
Public Overridable Property Id As Guid
<Required>
Public Overridable Property Name As String
<Required>
<StringLength(250)>
Public Overridable Property DisplayName As String Implements IConfigItem.DisplayName
<StringLength(8000)>
Public Overridable Property Description As String Implements IConfigItem.Description
Public Overridable Property ObjectType As ObjectTypes
<Ignore>
Public Overridable Property SelfLink As String Implements IConfigItem.SelfLink
<Required>
Public Overridable Property Tags As IList(Of Tag) Implements IConfigItem.Tags
<Required>
Public Overridable Property Path As IList(Of PathItem) Implements IConfigItem.Path
End Class
Public Partial Class PathItem
Public Overridable Property Label As String
Public Overridable Property Link As String
Public Overridable Property ObjectType As ObjectTypes
Public Overridable Property ObjectId As Guid
End Class
Public Partial Class Tag
Public Overridable Property Name As String
Public Overridable Property Value As String
Public Overridable Property IsProtected As Boolean
End Class
Public Partial Class Variable
Public Overridable Property Name As String
Public Overridable Property Value As String
Public Overridable Property Type As ValueDataType
Public Overridable Property Description As String
Public Overridable Property IsInherited As Boolean
Public Overridable Property Environment As Environments?
End Class
End Namespace
Namespace CoreService.ServiceModel.BusinessObjects.Structure
Public Partial Class Tenant
Inherits ConfigItem
Implements IHasVariables
<Required>
<StringLength(10)>
Public Overridable Property Name As String
<Required>
Public Overridable Property ObjectType As ObjectTypes
<Ignore>
Public Overridable Property SelfLink As String
<Required>
Public Overridable Property Variables As IList(Of Variable) Implements IHasVariables.Variables
<Required>
Public Overridable Property AllowedMailDomains As IList(Of String)
<Required>
Public Overridable Property LicensedModules As IList(Of String)
<Required>
Public Overridable Property DefaultDeploymentLifetimeDays As Short
<Required>
Public Overridable Property MaxDeploymentLifetimeDays As Short
<Required>
Public Overridable Property SystemUnpatchedWarningDays As Short
<Required>
Public Overridable Property SystemBackupMissingWarningHours As Short
<Required>
Public Overridable Property StopVulnerableResourceAfterDays As Short
<Required>
Public Overridable Property DeploymentExpirationWarningDays As Short
<Required>
Public Overridable Property PatchNotificationDays As Short
<Required>
Public Overridable Property UseCustomHostnames As Boolean
<Required>
Public Overridable Property RemoveInactiveVulnerabilitiesAfterDays As Short
End Class
End Namespace
Namespace CoreService.ServiceModel.BusinessObjects.TimeSeries
Public Partial Class TimeSeriesDataPoint
Implements IHasIdName
Implements IHasObjectType
Implements INotSoftDeletable
Public Overridable Property Id As Guid
Public Overridable Property TimeStamp As Date
<References(GetType(TimeSeriesDefinition))>
Public Overridable Property TimeSeriesId As Guid
Public Overridable Property ObjectType As ObjectTypes Implements IHasObjectType.ObjectType
<References(GetType(Resource))>
Public Overridable Property ResourceId As Guid?
Public Overridable Property ResourceLabel As String
<References(GetType(ResourceGroup))>
Public Overridable Property ResourceGroupId As Guid?
Public Overridable Property ResourceGroupLabel As String
<References(GetType(Deployment))>
Public Overridable Property DeploymentId As Guid?
Public Overridable Property DeploymentLabel As String
<References(GetType(DeploymentCollection))>
Public Overridable Property CollectionId As Guid?
Public Overridable Property CollectionLabel As String
<References(GetType(ResourceProvider))>
Public Overridable Property ResourceProviderId As Guid?
Public Overridable Property ResourceProviderLabel As String
Public Overridable Property Dimension3Id As String
Public Overridable Property Dimension3Type As String
Public Overridable Property Dimension3Label As String
<Ignore>
Public Overridable Property Dimension3 As Object
Public Overridable Property Dimension4Id As String
Public Overridable Property Dimension4Type As String
Public Overridable Property Dimension4Label As String
<Ignore>
Public Overridable Property Dimension4 As Object
Public Overridable Property Name As String Implements IHasIdName.Name
Public Overridable Property Unit As String
Public Overridable Property Value As Decimal
Public Overridable Property Enriched As Boolean
End Class
Public Partial Class TimeSeriesDefinition
Inherits Auditable
Implements IHasIdName
Implements IHasTenantId
Implements IHasObjectType
Public Overridable Property Id As Guid
<References(GetType(Tenant))>
Public Overridable Property TenantId As Guid Implements IHasTenantId.TenantId
Public Overridable Property Tenant As Tenant
Public Overridable Property Name As String Implements IHasIdName.Name
Public Overridable Property DisplayName As String
<Ignore>
Public Overridable Property SelfLink As String
<Required>
Public Overridable Property ObjectType As ObjectTypes Implements IHasObjectType.ObjectType
Public Overridable Property Description As String
Public Overridable Property SourceType As ObjectTypes
Public Overridable Property AutoCollection As Boolean
Public Overridable Property AutoCollectionQuery As String
Public Overridable Property AutoCollectionInterval As Integer?
Public Overridable Property AutoCollectionIntervalUnit As IntervalUnits?
Public Overridable Property AutoCollectionTime As TimeOnly?
Public Overridable Property LastAutoCollected As Date?
Public Overridable Property RetentionTimeMonths As Integer
End Class
End Namespace
Namespace CoreService.ServiceModel.Dtos.TimeSeries.Crud
'''<Summary>
'''Returns a list of all timeseries data within a tenant
'''</Summary>
<Api(Description:="Returns a list of all timeseries data within a tenant")>
<ApiResponse(Description:="Success", IsDefaultResponse:=true, ResponseType:=GetType(0, Culture=neutral, PublicKeyToken=null]]), StatusCode:=200)>
Public Partial Class QueryTimeSeriesDataPoints
Inherits QueryDb(Of TimeSeriesDataPoint)
Implements IBaseRequest
Implements IHasTenantName
Implements IGet
Implements IGroupable
<ApiMember(DataType:="string", IsRequired:=true, ParameterType:="header")>
<Validate(Validator:="NotEmpty")>
Public Overridable Property TenantName As String Implements IHasTenantName.TenantName
<ApiMember(DataType:="string", IsRequired:=true, ParameterType:="path")>
Public Overridable Property TimeSeriesId As Guid
'''<Summary>
'''The property, the data will be grouped on
'''</Summary>
<ApiMember(Description:="The property, the data will be grouped on", ParameterType:="query")>
Public Overridable Property GroupBy As String Implements IGroupable.GroupBy
'''<Summary>
'''The property, used for aggregation
'''</Summary>
<ApiMember(Description:="The property, used for aggregation", ParameterType:="query")>
Public Overridable Property AggregateOn As String Implements IGroupable.AggregateOn
'''<Summary>
'''The aggregation function to use
'''</Summary>
<ApiMember(Description:="The aggregation function to use", ParameterType:="query")>
Public Overridable Property Aggregation As Aggregations? Implements IGroupable.Aggregation
'''<Summary>
'''Returns all referenced object
'''</Summary>
<ApiMember(Description:="Returns all referenced object", ParameterType:="query")>
Public Overridable Property IncludeReferencedObjects As Boolean?
End Class
End Namespace
Namespace CoreService.ServiceModel.Enums
Public Enum Aggregations
None
Count
DistinctCount
Sum
Min
Max
Avg
First
End Enum
Public Enum Environments
Lab
Poc
Dev
Test
Int
Uat
Prod
End Enum
Public Enum ValueDataType
[String]
Number
[Boolean]
List
End Enum
End Namespace
Namespace ServiceStack
<DataContract>
Public Partial Class QueryBase
<DataMember(Order:=1)>
Public Overridable Property Skip As Integer?
<DataMember(Order:=2)>
Public Overridable Property Take As Integer?
<DataMember(Order:=3)>
Public Overridable Property OrderBy As String
<DataMember(Order:=4)>
Public Overridable Property OrderByDesc As String
<DataMember(Order:=5)>
Public Overridable Property Include As String
<DataMember(Order:=6)>
Public Overridable Property Fields As String
<DataMember(Order:=7)>
Public Overridable Property Meta As Dictionary(Of String, String)
End Class
Public Partial Class QueryDb(Of T)
Inherits QueryBase
End Class
<DataContract>
Public Partial Class QueryResponse(Of T)
<DataMember(Order:=1)>
Public Overridable Property Offset As Integer
<DataMember(Order:=2)>
Public Overridable Property Total As Integer
<DataMember(Order:=3)>
Public Overridable Property Results As List(Of TimeSeriesDefinition) = New List(Of TimeSeriesDefinition)
<DataMember(Order:=4)>
Public Overridable Property Meta As Dictionary(Of String, String)
<DataMember(Order:=5)>
Public Overridable Property ResponseStatus As ResponseStatus
End Class
End Namespace
Namespace YCO.Dune.Models.Enums
Public Enum IntervalUnits
Second
Minute
Hour
Day
Week
Month
Year
End Enum
Public Enum ObjectTypes
None
ConfigItem
Tenant
Collection
Resource
ComputeNode
VirtualMachine
PhysicalMachine
Disk
Subnet
IPAddress
Job
JobEvent
FreezePeriod
ResourceGroup
Deployment
ResourceGroupTemplate
DeploymentTemplate
ResourceProvider
GenericResource
Role
Permission
User
PatchingWindow
Update
ReportDefinition
TimeSeries
DataPoint
Action
ActionAssignment
UserNote
End Enum
End Namespace
End Namespace
VB.NET QueryTimeSeriesDataPoints DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /timeseries/{TimeSeriesId}/datapoints HTTP/1.1
Host: core.starburst.svc
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"offset":0,"total":0,"results":[{"id":"00000000-0000-0000-0000-000000000000","timeStamp":"0001-01-01T00:00:00.0000000Z","timeSeriesId":"00000000-0000-0000-0000-000000000000","objectType":"DataPoint","resourceId":"00000000-0000-0000-0000-000000000000","resourceLabel":"String","resourceGroupId":"00000000-0000-0000-0000-000000000000","resourceGroupLabel":"String","deploymentId":"00000000-0000-0000-0000-000000000000","deploymentLabel":"String","collectionId":"00000000-0000-0000-0000-000000000000","collectionLabel":"String","resourceProviderId":"00000000-0000-0000-0000-000000000000","resourceProviderLabel":"String","dimension3Id":"String","dimension3Type":"String","dimension3Label":"String","dimension3":{},"dimension4Id":"String","dimension4Type":"String","dimension4Label":"String","dimension4":{},"name":"String","unit":"String","value":0,"enriched":false}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}