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 java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;

public class dtos
{

    /**
    * Returns a timeseries definition by its ID
    */
    @Api(Description="Returns a timeseries definition by its ID")
    @ApiResponse(Description="Success", IsDefaultResponse=true, ResponseType=TimeSeriesDefinitionDto.class, StatusCode=200)
    public static class GetTimeSeriesDefinition implements IGetSingleRequest, IHasTenantName, IGet
    {
        @ApiMember(DataType="string", Format="guid", ParameterType="path")
        public UUID id = null;

        @ApiMember(DataType="string", ParameterType="path")
        public String name = null;

        @ApiMember(DataType="string", IsRequired=true, ParameterType="header")
        @Validate(Validator="NotEmpty")
        public String tenantName = null;

        @ApiMember(ParameterType="query", Verb="GET")
        public Boolean includeReferencedObjects = null;

        /**
        * If true, also soft deleted items will be returned
        */
        @ApiMember(Description="If true, also soft deleted items will be returned", ParameterType="query")
        public Boolean includeDeleted = null;
        
        public UUID getId() { return id; }
        public GetTimeSeriesDefinition setId(UUID value) { this.id = value; return this; }
        public String getName() { return name; }
        public GetTimeSeriesDefinition setName(String value) { this.name = value; return this; }
        public String getTenantName() { return tenantName; }
        public GetTimeSeriesDefinition setTenantName(String value) { this.tenantName = value; return this; }
        public Boolean isIncludeReferencedObjects() { return includeReferencedObjects; }
        public GetTimeSeriesDefinition setIncludeReferencedObjects(Boolean value) { this.includeReferencedObjects = value; return this; }
        public Boolean isIncludeDeleted() { return includeDeleted; }
        public GetTimeSeriesDefinition setIncludeDeleted(Boolean value) { this.includeDeleted = value; return this; }
    }

    public static class TimeSeriesDefinitionDto
    {
        public UUID id = null;
        public String name = null;
        public String description = null;
        public ObjectTypes sourceType = null;
        public String autoCollectionQuery = null;
        public Double autoCollectionInterval = null;
        public IntervalUnits autoCollectionIntervalUnit = null;
        public TimeSpan autoCollectionTime = null;
        public Date lastAutoCollected = null;
        public Boolean autoCollection = null;
        public Integer retentionTimeMonths = null;
        
        public UUID getId() { return id; }
        public TimeSeriesDefinitionDto setId(UUID value) { this.id = value; return this; }
        public String getName() { return name; }
        public TimeSeriesDefinitionDto setName(String value) { this.name = value; return this; }
        public String getDescription() { return description; }
        public TimeSeriesDefinitionDto setDescription(String value) { this.description = value; return this; }
        public ObjectTypes getSourceType() { return sourceType; }
        public TimeSeriesDefinitionDto setSourceType(ObjectTypes value) { this.sourceType = value; return this; }
        public String getAutoCollectionQuery() { return autoCollectionQuery; }
        public TimeSeriesDefinitionDto setAutoCollectionQuery(String value) { this.autoCollectionQuery = value; return this; }
        public Double getAutoCollectionInterval() { return autoCollectionInterval; }
        public TimeSeriesDefinitionDto setAutoCollectionInterval(Double value) { this.autoCollectionInterval = value; return this; }
        public IntervalUnits getAutoCollectionIntervalUnit() { return autoCollectionIntervalUnit; }
        public TimeSeriesDefinitionDto setAutoCollectionIntervalUnit(IntervalUnits value) { this.autoCollectionIntervalUnit = value; return this; }
        public TimeSpan getAutoCollectionTime() { return autoCollectionTime; }
        public TimeSeriesDefinitionDto setAutoCollectionTime(TimeSpan value) { this.autoCollectionTime = value; return this; }
        public Date getLastAutoCollected() { return lastAutoCollected; }
        public TimeSeriesDefinitionDto setLastAutoCollected(Date value) { this.lastAutoCollected = value; return this; }
        public Boolean isAutoCollection() { return autoCollection; }
        public TimeSeriesDefinitionDto setAutoCollection(Boolean value) { this.autoCollection = value; return this; }
        public Integer getRetentionTimeMonths() { return retentionTimeMonths; }
        public TimeSeriesDefinitionDto setRetentionTimeMonths(Integer value) { this.retentionTimeMonths = value; return this; }
    }

    public static 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;
    }

    public static enum IntervalUnits
    {
        Second,
        Minute,
        Hour,
        Day,
        Week,
        Month,
        Year;
    }

}

Java 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}