atsd_client.models

to learn more visit https://github.com/axibase/atsd-docs/tree/master/api

API request attributes could be specified either in constructor or be explicitly setted to object via setters.

Two code blocks are equivalent:

>>> prop = Property(TYPE, ENTITY)
>>> prop.set_tags({TAG: tag_value})
>>> prop.set_key({KEY: KEY_VALUE})
>>> prop = Property(TYPE, ENTITY,
                    tags={TAG: tag_value}
                    key={KEY: KEY_VALUE})

Constants

class atsd_client.models.SeriesType
FORECAST = 'FORECAST'
FORECAST_DEVIATION = 'FORECAST_DEVIATION'
HISTORY = 'HISTORY'
class atsd_client.models.Interpolate
LINEAR = 'LINEAR'
NONE = 'NONE'
STEP = 'STEP'
class atsd_client.models.TimeUnit
DAY = 'DAY'
HOUR = 'HOUR'
MILLISECOND = 'MILLISECOND'
MINUTE = 'MINUTE'
MONTH = 'MONTH'
QUARTER = 'QUARTER'
SECOND = 'SECOND'
WEEK = 'WEEK'
YEAR = 'YEAR'
class atsd_client.models.PeriodAlign
CALENDAR = 'CALENDAR'
END_TIME = 'END_TIME'
FIRST_VALUE_TIME = 'FIRST_VALUE_TIME'
START_TIME = 'START_TIME'
class atsd_client.models.AggregateType
AVG = 'AVG'
CACHE = 'CACHE'
COUNT = 'COUNT'
DELTA = 'DELTA'
DETAIL = 'DETAIL'
FIRST = 'FIRST'
MAX = 'MAX'
MIN = 'MIN'
PERCENTILE_50 = 'PERCENTILE_50'
PERCENTILE_75 = 'PERCENTILE_75'
PERCENTILE_90 = 'PERCENTILE_90'
PERCENTILE_95 = 'PERCENTILE_95'
PERCENTILE_99 = 'PERCENTILE_99'
PERCENTILE_995 = 'PERCENTILE_995'
PERCENTILE_999 = 'PERCENTILE_999'
STANDARD_DEVIATION = 'STANDARD_DEVIATION'
SUM = 'SUM'
THRESHOLD_COUNT = 'THRESHOLD_COUNT'
THRESHOLD_DURATION = 'THRESHOLD_DURATION'
THRESHOLD_PERCENT = 'THRESHOLD_PERCENT'
WAVG = 'WAVG'
WTAVG = 'WTAVG'
class atsd_client.models.Severity
CRITICAL = 6
FATAL = 7
MAJOR = 5
MINOR = 4
NORMAL = 2
UNDEFINED = 0
UNKNOWN = 1
WARNING = 3
class atsd_client.models.DataType
DOUBLE = 'DOUBLE'
FLOAT = 'FLOAT'
INTEGER = 'INTEGER'
LONG = 'LONG'
SHORT = 'SHORT'
class atsd_client.models.TimePrecision
MILLISECONDS = 'MILLISECONDS'
SECONDS = 'SECONDS'
class atsd_client.models.InvalidAction
DISCARD = 'DISCARD'
NONE = 'NONE'
TRANSFORM = 'TRANSFORM'

Queries

class atsd_client.models.SeriesQuery(series_filter, entity_filter, date_filter, forecast_filter=None, versioning_filter=None, control_filter=None, transformation_filter=None)

Class representing a single query to get series matching provided filters and parameters.

class atsd_client.models.PropertiesQuery(entity_filter, date_filter, type, key=None, exactMatch=None, keyTagExpression=None, limit=None, cache=None, offset=None)

Class representing a single query to get properties matching provided filters and parameters.

class atsd_client.models.PropertiesDeleteQuery(type, entity, startDate=None, endDate=None, key=None, exactMatch=None)

Class representing a single query to delete properties matching provided filters and parameters.

class atsd_client.models.AlertsQuery(entity_filter, date_filter, rules=None, metrics=None, severities=None, minSeverity=None, acknowledged=None)

Class representing a single query to get all alerts matching provided filters and parameters.

class atsd_client.models.AlertHistoryQuery(entity_filter, date_filter, rule, metric, limit)

Class representing a single query to get a history for an alert matching provided filters and parameters.

class atsd_client.models.MessageQuery(entity_filter, date_filter, type=None, source=None, tags=None, severities=None, minSeverity=None, limit=None)

Class representing a single query to get messages matching provided filters and parameters.

Filters

class atsd_client.models.EntityFilter(entity='', entities=None, entity_group=None, entity_expression=None)

Class needed to filter entities during queries. One of the entity fields is required. Entity name pattern may include ? and * wildcards. Field precedence, from high to low: entity, entities, entityGroup. Although multiple fields can be specified in the query object only the field with higher precedence will be applied.

entities = None

list of entity names or entity name patterns

entity = None

str entity name or entity name pattern.

entity_expression = None

str filter entities by name, entity tag, and properties using special syntax

entity_group = None

str entity group name. Return records for member entities of the specified group. The result will be empty if the group doesn’t exist or contains no entities.

class atsd_client.models.DateFilter(startDate=None, endDate=None, interval=None)
endDate = None

datetime object | long milliseconds | str ISO 8601 date. End of the selection interval. Matches records timestamped at or after startDate. Examples: 2016-07-18T11:11:02+02:00, previous_day - 1 * HOUR

interval = None

dict. Duration of the selection interval, specified as count and unit. Example: {“count”: 5, “unit”: “MINUTE”}

startDate = None

datetime object | long milliseconds | str ISO 8601 date. Start of the selection interval. Matches records timestamped at or after startDate. Examples: 2016-07-18T11:11:02Z, current_hour

class atsd_client.models.SeriesFilter(metric, tags={}, type='HISTORY')
metric = None

str metric name

tags = None

dict

type = None

SeriesType type of underlying data: HISTORY, FORECAST, FORECAST_DEVIATION. Default: HISTORY

class atsd_client.models.ForecastFilter(forecastName='')
forecastName = None

str unique forecast name. Identifies a custom forecast by name. If forecastName is not set, then the default forecast computed by the database will be returned. forecastName is applicable only when type is set to FORECAST or FORECAST_DEVIATION

class atsd_client.models.VersioningFilter(versioned=None, versionFilter=None)
class atsd_client.models.ControlFilter(limit=None, direction=None, cache=None, requestId=None, timeFormat=None)
direction = None

str scan order for applying the limit: DESC - descending, ASC - ascending. Default: DESC

limit = None

int maximum number of time:value samples returned for each series. Default: 0.

requestId = None

str optional identifier used to associate query object in request with series objects in response.

timeFormat = None

str time format for data array. iso or milliseconds. Default: iso

class atsd_client.models.TransformationFilter(aggregate, group, rate)
aggregate = None

Aggregate object responsible for grouping detailed values into periods and calculating statistics for each period. Default: DETAIL

group = None

Group object responsible for merging multiple series into one series

rate = None

Rate object responsible for computing difference between consecutive samples per unit of time (rate period)

Data

class atsd_client.models.Sample(value, time=None, version=None)

Class that represents a numeric value observed at some time with additional version information if provided. If multiple samples have the same timestamp and are inserted for the same series, the latest sample prevails, unless the metric is optionally enabled for version tracking.

t = None

class:datetime object | long milliseconds | str ISO 8601 date

class atsd_client.models.Series(entity, metric, data=None, tags=None)

Class representing a Time Series. Time Series is a time-indexed array of samples (observations), each consisting of a timestamp and a numeric value, for example CPU utilization or body temperature. Each series is uniquely identified by entity name, metric name and optional series tags.

add_samples(*samples)

Add all given samples to series

entity = None

str entity name

static from_pandas_series(entity, metric, ts)
Parameters:
  • entitystr entity name
  • metricstr metric name
  • ts – pandas time series object
Returns:

Series with data from pandas time series

metric = None

str metric name

plot()

Plot series in matplotlib.pyplot

sort(key=None, reverse=False)

Sort series data in place :param key: :param reverse:

tags = None

dict of tag_name: tag_value pairs

times()

Valid versions of series times in seconds :return: list of float

to_pandas_series()
Returns:pandas time series object
values()

Valid versions of series values :return: list of Number

class atsd_client.models.Property(type, entity, tags=None, key=None, date=None)

Class representing a single property. Properties represent metadata describing entities, obtained from configuration files, system command output, etc. Property examples are device model, OS version, and location. Unlike time series, the database stores only cache value for each property and such value is stored as text. Properties are collected at a lower frequency than time series or whenever their values change. Each properties record is uniquely identified by entity name, property type and optional property keys.

date = None

datetime object | long milliseconds | str ISO 8601 date, for example 2016-05-25T00:15:00Z. Set to server time at server side if omitted.

entity = None

str entity name

key = None

dict of name: value pairs that uniquely identify the property record

tags = None

dict of name: value pairs that are not part of the key and contain descriptive information about the property record.

type = None

str property type name

class atsd_client.models.Alert(id, rule=None, entity=None, metric=None, lastEventDate=None, openDate=None, value=None, message=None, tags=None, textValue=None, severity=None, repeatCount=None, acknowledged=None, openValue=None)

Class, representing an single alert. Alert is an event produced by the rule engine by applying pre-defined rules to incoming data. An alert is created when an expression specified in the rule evaluates to true and it is closed, when the expression returns false. The users can set acknowledge/de-acknowledge status for open alerts. The rule expressions can operate on series, message, and property commands.

acknowledged = None

bool acknowledgement status

entity = None

str entity

lastEventDate = None

str | datetime | long milliseconds when the last record was received

metric = None

str metric

openDate = None

str | datetime | long milliseconds when the alert was open

openValue = None

Number first numeric value received.

repeatCount = None

int number of times when the expression evaluated to true sequentially

rule = None

str rule

severity = None

Severity

tags = None

dict

textValue = None

str text value

value = None

Number last numeric value received

class atsd_client.models.AlertHistory(alert=None, alertDuration=None, alertOpenDate=None, entity=None, metric=None, receivedDate=None, repeatCount=None, rule=None, ruleExpression=None, ruleFilter=None, severity=None, tags=None, type=None, date=None, value=None, window=None)

Class representing history of an alert, including such values as alert duration, alert open date, repeat count, etc.

alertDuration = None

Number time in milliseconds when alert was in OPEN or REPEAT state

alertOpenDate = None

str | datetime | long

date = None

datetime object | long milliseconds | str ISO 8601 date

entity = None

str

metric = None

str

receivedDate = None

str | datetime | long

repeatCount = None

int

rule = None

str

ruleExpression = None

str

ruleFilter = None

str

severity = None

Severity

tags = None

str

type = None

str alert state when closed: OPEN, CANCEL, REPEAT

value = None

Number last numeric value received

window = None

int window length

class atsd_client.models.Message(type, source, entity, date, severity, tags, message)

Class representing a Message. Messages are events collected from system logs and messaging systems. Messages are stored in ATSD to support correlation with other data types, for example, to relate log events with resource bottleneck alerts. Each message is related to an entity, has a set of tags and a free-form text message. Messages for the same entity, time and type/source tags are automatically de-duplicated.

date = None

datetime | long milliseconds | str ISO 8601 date when the message record was created

entity = None

str entity name

message = None

str

severity = None

Severity

source = None

str message source

tags = None

str message tags

type = None

str message type

class atsd_client.models.Entity(name, enabled=None, lastInsertDate=None, tags=None)

Class representing a single entitiy. Entities are servers, hosts, frames, virtual machines, sensors, etc. Entities are ingested with attached metrics (time series data) using the csv/nmon parsers, telnet and http/s protocols, and Axibase Collector jobs.

enabled = None

bool enabled status. Incoming data is discarded for disabled entities

lastInsertDate = None

datetime object | long milliseconds | str ISO 8601 date. Last time when a value was received by the database for this entity

tags = None

dict

class atsd_client.models.Metric(name, label=None, enabled=None, dataType=None, timePrecision=None, persistent=None, filter=None, minValue=None, maxValue=None, invalidAction=None, description=None, retentionInterval=None, lastInsertDate=None, tags=None, versioned=None)

Class representing a single metric. Metrics are names assigned to numeric measurements, for example, temperature or speed. A time-indexed array of measurements for a given entity and metric is called a time-series (or simply series). Metrics specify how incoming data should be stored (data type), validated and pruned. In addition, metrics can have user-defined tags such as unit of measurement, scale, type or a category that can be used for filtering and grouping.

dataType = None

DataType

description = None

str metric description

enabled = None

bool

filter = None

If filter is specified, metric puts that do not match the filter are discarded

invalidAction = None

InvalidAction

label = None

str

lastInsertDate = None

datetime object | long milliseconds | str ISO 8601 date. Last time a value was received for this metric by any series

maxValue = None

Number maximum value for Invalid Action trigger

minValue = None

Number minimum value for Invalid Action trigger

name = None

str metric name

persistent = None

bool persistence status. Non-persistent metrics are not stored in the database and are only processed by the rule engine

retentionInterval = None

Number number of days to retain values for this metric in the database

tags = None

dict

timePrecision = None

TimePrecision

versioned = None

boolean If set to true, enables versioning for the specified metric. When metrics is versioned, the database retains the history of series value changes for the same timestamp along with version_source and version_status

class atsd_client.models.EntityGroup(name, expression=None, tags=None)

Class representing a single entity group. Entities can be grouped into Entity Groups which can be used for building Portals, Exporting Data, and creating Forecasts. Forecasts can be calculated for all entities present in the group. Data or Forecasts can be exported for all entities present in the group. Portals can be added to all entities present in the Group. This is a useful feature when working with large amounts of entities and big data sets.

expression = None

str group membership expression. The expression is applied to entities to automatically add/remove members of this group

name = None

str entity group name

tags = None

dict

class atsd_client.models.Group(type, period=None, interpolate=None, truncate=None, order=None)

Class representing aggregate param ‘group’

class atsd_client.models.Rate(period, counter=True)

Class representing aggregate param ‘rate’

class atsd_client.models.Aggregate(period, types=None, interpolate=None, threshold=None, calendar=None, workingMinutes=None, order=None)

Class representing aggregate param ‘aggregate’

Table Of Contents

Previous topic

atsd_client Package

This Page