CoreService

<back to all web services

CreateTimeSeriesDefinition

TimeSeries - CRUD

Creates a new time series definition

Requires Authentication
Required roles:TenantReader, TenantAdmin
The following routes are available for this service:
POST/api/timeseries/Creates a new time series definition
POST/timeseries/Creates a new time series definition
"use strict";
/** @typedef {'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'} */
export var ObjectTypes;
(function (ObjectTypes) {
    ObjectTypes["None"] = "None"
    ObjectTypes["ConfigItem"] = "ConfigItem"
    ObjectTypes["Tenant"] = "Tenant"
    ObjectTypes["Collection"] = "Collection"
    ObjectTypes["Resource"] = "Resource"
    ObjectTypes["ComputeNode"] = "ComputeNode"
    ObjectTypes["VirtualMachine"] = "VirtualMachine"
    ObjectTypes["PhysicalMachine"] = "PhysicalMachine"
    ObjectTypes["Disk"] = "Disk"
    ObjectTypes["Subnet"] = "Subnet"
    ObjectTypes["IPAddress"] = "IPAddress"
    ObjectTypes["Job"] = "Job"
    ObjectTypes["JobEvent"] = "JobEvent"
    ObjectTypes["FreezePeriod"] = "FreezePeriod"
    ObjectTypes["ResourceGroup"] = "ResourceGroup"
    ObjectTypes["Deployment"] = "Deployment"
    ObjectTypes["ResourceGroupTemplate"] = "ResourceGroupTemplate"
    ObjectTypes["DeploymentTemplate"] = "DeploymentTemplate"
    ObjectTypes["ResourceProvider"] = "ResourceProvider"
    ObjectTypes["GenericResource"] = "GenericResource"
    ObjectTypes["Role"] = "Role"
    ObjectTypes["Permission"] = "Permission"
    ObjectTypes["User"] = "User"
    ObjectTypes["PatchingWindow"] = "PatchingWindow"
    ObjectTypes["Update"] = "Update"
    ObjectTypes["ReportDefinition"] = "ReportDefinition"
    ObjectTypes["TimeSeries"] = "TimeSeries"
    ObjectTypes["DataPoint"] = "DataPoint"
    ObjectTypes["Action"] = "Action"
    ObjectTypes["ActionAssignment"] = "ActionAssignment"
    ObjectTypes["UserNote"] = "UserNote"
})(ObjectTypes || (ObjectTypes = {}));
/** @typedef {'Second'|'Minute'|'Hour'|'Day'|'Week'|'Month'|'Year'} */
export var IntervalUnits;
(function (IntervalUnits) {
    IntervalUnits["Second"] = "Second"
    IntervalUnits["Minute"] = "Minute"
    IntervalUnits["Hour"] = "Hour"
    IntervalUnits["Day"] = "Day"
    IntervalUnits["Week"] = "Week"
    IntervalUnits["Month"] = "Month"
    IntervalUnits["Year"] = "Year"
})(IntervalUnits || (IntervalUnits = {}));
export class TimeSeriesDefinitionDto {
    /** @param {{id?:string,name?:string,description?:string,sourceType?:ObjectTypes,autoCollectionQuery?:string,autoCollectionInterval?:number,autoCollectionIntervalUnit?:IntervalUnits,autoCollectionTime?:string,lastAutoCollected?:string,autoCollection?:boolean,retentionTimeMonths?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    name;
    /** @type {?string} */
    description;
    /** @type {ObjectTypes} */
    sourceType;
    /** @type {?string} */
    autoCollectionQuery;
    /** @type {?number} */
    autoCollectionInterval;
    /** @type {?IntervalUnits} */
    autoCollectionIntervalUnit;
    /** @type {?string} */
    autoCollectionTime;
    /** @type {?string} */
    lastAutoCollected;
    /** @type {boolean} */
    autoCollection;
    /** @type {?number} */
    retentionTimeMonths;
}
export class CreateTimeSeriesDefinition {
    /** @param {{tenantName?:string,name?:string,displayName?:string,description?:string,sourceType?:ObjectTypes,autoCollectionQuery?:string,autoCollectionInterval?:number,autoCollectionIntervalUnit?:IntervalUnits,autoCollectionTime?:string,autoCollection?:boolean,retentionTimeMonths?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    tenantName;
    /**
     * @type {string}
     * @description The unique name of the time series */
    name;
    /**
     * @type {?string}
     * @description The time series display name */
    displayName;
    /**
     * @type {?string}
     * @description A more detailed description for the series */
    description;
    /**
     * @type {?ObjectTypes}
     * @description The source type of the time series. Only used when AutoCollection is true */
    sourceType;
    /**
     * @type {?string}
     * @description The query used to extract datapoints from source table. Only used when AutoCollection is true */
    autoCollectionQuery;
    /**
     * @type {?number}
     * @description How often a datapoint will be collected, Only used when AutoCollection is true */
    autoCollectionInterval;
    /**
     * @type {?IntervalUnits}
     * @description The interval unit for auto collection, Only used when AutoCollection is true */
    autoCollectionIntervalUnit;
    /**
     * @type {?string}
     * @description The time (UTC), when the query will be executed to collect the datapoints, Only used when AutoCollection is true */
    autoCollectionTime;
    /**
     * @type {boolean}
     * @description How often a datapoint will be collected, Only used when AutoCollection is true */
    autoCollection;
    /**
     * @type {?number}
     * @description How many months to keep data in the time series before deleting them */
    retentionTimeMonths;
}

JavaScript CreateTimeSeriesDefinition 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.

POST /api/timeseries/ HTTP/1.1 
Host: core.starburst.svc 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"tenantName":"String","name":"String","displayName":"String","description":"String","sourceType":"None","autoCollectionQuery":"String","autoCollectionInterval":0,"autoCollectionIntervalUnit":"Second","autoCollectionTime":"00:00","autoCollection":false,"retentionTimeMonths":0,"txId":"00000000-0000-0000-0000-000000000000"}
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}