CoreService

<back to all web services

GetTimeSeriesDefinition

TimeSeries - CRUD

Returns a timeseries definition by its ID

Requires Authentication
Required role:TenantReader
The following routes are available for this service:
GET/timeseries/{Id}Returns a timeseries definition
GET/api/timeseries/{Id}Returns a timeseries definition
GET/timeseries/{Name}/bynameReturns a timeseries definition
GET/api/timeseries/{Name}/bynameReturns a timeseries definition
import Foundation
import ServiceStack

/**
* Returns a timeseries definition by its ID
*/
// @Api(Description="Returns a timeseries definition by its ID")
// @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=typeof(TimeSeriesDefinitionDto), StatusCode=200)
public class GetTimeSeriesDefinition : IGetSingleRequest, IHasTenantName, IGet, Codable
{
    // @ApiMember(DataType="string", Format="guid", ParameterType="path")
    public var id:String?

    // @ApiMember(DataType="string", ParameterType="path")
    public var name:String

    // @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
    // @Validate(Validator="NotEmpty")
    public var tenantName:String

    // @ApiMember(ParameterType="query", Verb="GET")
    public var includeReferencedObjects:Bool?

    /**
    * If true, also soft deleted items will be returned
    */
    // @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
    public var includeDeleted:Bool?

    required public init(){}
}

public class TimeSeriesDefinitionDto : Codable
{
    public var id:String
    public var name:String
    public var Description:String
    public var sourceType:ObjectTypes
    public var autoCollectionQuery:String
    public var autoCollectionInterval:Double?
    public var autoCollectionIntervalUnit:IntervalUnits?
    @TimeSpan public var autoCollectionTime:TimeInterval?
    public var lastAutoCollected:Date?
    public var autoCollection:Bool
    public var retentionTimeMonths:Int?

    required public init(){}
}

public enum ObjectTypes : String, Codable
{
    case None
    case ConfigItem
    case Tenant
    case Collection
    case Resource
    case ComputeNode
    case VirtualMachine
    case PhysicalMachine
    case Disk
    case Subnet
    case IPAddress
    case Job
    case JobEvent
    case FreezePeriod
    case ResourceGroup
    case Deployment
    case ResourceGroupTemplate
    case DeploymentTemplate
    case ResourceProvider
    case GenericResource
    case Role
    case Permission
    case User
    case PatchingWindow
    case Update
    case ReportDefinition
    case TimeSeries
    case DataPoint
    case Action
    case ActionAssignment
    case UserNote
}

public enum IntervalUnits : String, Codable
{
    case Second
    case Minute
    case Hour
    case Day
    case Week
    case Month
    case Year
}


Swift GetTimeSeriesDefinition 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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /timeseries/{Id} HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":"00000000-0000-0000-0000-000000000000","name":"String","description":"String","sourceType":"None","autoCollectionQuery":"String","autoCollectionInterval":0,"autoCollectionIntervalUnit":"Second","autoCollectionTime":"00:00","lastAutoCollected":"0001-01-01T00:00:00.0000000Z","autoCollection":false,"retentionTimeMonths":0}