> ## Documentation Index
> Fetch the complete documentation index at: https://docs.siftstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# data

> sift/data/v2/data.proto

<a name="sift_data_v2_data-proto" />

<a name="sift_data_v2_data-proto-services" />

## Services

*RPC methods exposed by this API.*

### DataService

| Method  | Request                           | Response                            | Description |
| :------ | :-------------------------------- | :---------------------------------- | :---------- |
| GetData | [GetDataRequest](#getdatarequest) | [GetDataResponse](#getdataresponse) | Query data  |

<a name="sift_data_v2_data-proto-messages" />

## Messages

*Data models used across requests/responses.*

### BitFieldElementValues

| Field  | Type                            | Label    | Description |
| :----- | :------------------------------ | :------- | :---------- |
| name   | string                          |          |             |
| values | [BitFieldValue](#bitfieldvalue) | repeated |             |

### BitFieldValue

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | uint32                    |       |             |

### BitFieldValues

| Field    | Type                                            | Label    | Description |
| :------- | :---------------------------------------------- | :------- | :---------- |
| metadata | [Metadata](#metadata)                           |          |             |
| values   | [BitFieldElementValues](#bitfieldelementvalues) | repeated |             |

### BoolValue

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | bool                      |       |             |

### BoolValues

| Field    | Type                    | Label    | Description |
| :------- | :---------------------- | :------- | :---------- |
| metadata | [Metadata](#metadata)   |          |             |
| values   | [BoolValue](#boolvalue) | repeated |             |

### BytesValue

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | bytes                     |       |             |

### BytesValues

| Field    | Type                      | Label    | Description |
| :------- | :------------------------ | :------- | :---------- |
| metadata | [Metadata](#metadata)     |          |             |
| values   | [BytesValue](#bytesvalue) | repeated |             |

### CalculatedChannelQuery

| Field              | Type                                                                                             | Label    | Description                                                                                                                                                                                                                                                                                                                                           |
| :----------------- | :----------------------------------------------------------------------------------------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| channel\_key       | string                                                                                           |          |                                                                                                                                                                                                                                                                                                                                                       |
| expression         | [sift.calculated\_channels.v1.ExpressionRequest](#sift-calculated_channels-v1-expressionrequest) |          |                                                                                                                                                                                                                                                                                                                                                       |
| run\_id            | string                                                                                           | optional | Optional. If set, only data for the specified run is returned If set to the empty string, only non-run data is returned. If unset, all run / non-run data is returned.                                                                                                                                                                                |
| mode               | [sift.calculated\_channels.v1.ExpressionMode](#sift-calculated_channels-v1-expressionmode)       | optional | Optional. If unset, will default to EXPRESSION\_MODE\_CALCULATED\_CHANNELS.                                                                                                                                                                                                                                                                           |
| combine\_run\_data | bool                                                                                             | optional | Optional. If unset, will default to false. If true, then requests that return data across multiple runs will be combined into a single result. This will apply to queries without a run, or when the requested run is an ad hoc run. This is useful when you prefer to see all the data as a single time series, instead of separated results by run. |

### ChannelQuery

| Field       | Type   | Label    | Description                                                                                                                                                                         |
| :---------- | :----- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| channel\_id | string |          | channel\_id is the uuid of the channel.                                                                                                                                             |
| run\_id     | string | optional | Optional. If set, only data associated with the specified run is returned. If set to the empty string, only non-run data is returned. If unset, all run / non-run data is returned. |

### DoubleValue

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | double                    |       |             |

### DoubleValues

| Field    | Type                        | Label    | Description |
| :------- | :-------------------------- | :------- | :---------- |
| metadata | [Metadata](#metadata)       |          |             |
| values   | [DoubleValue](#doublevalue) | repeated |             |

### EnumValue

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | uint32                    |       |             |

### EnumValues

| Field    | Type                    | Label    | Description |
| :------- | :---------------------- | :------- | :---------- |
| metadata | [Metadata](#metadata)   |          |             |
| values   | [EnumValue](#enumvalue) | repeated |             |

### FloatValue

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | float                     |       |             |

### FloatValues

| Field    | Type                      | Label    | Description |
| :------- | :------------------------ | :------- | :---------- |
| metadata | [Metadata](#metadata)     |          |             |
| values   | [FloatValue](#floatvalue) | repeated |             |

### GetDataRequest

| Field       | Type                      | Label    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| :---------- | :------------------------ | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| queries     | [Query](#query)           | repeated |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| start\_time | google.protobuf.Timestamp |          | Required. The starting timestamp of the data to retrieve. This is an inclusive bound.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| end\_time   | google.protobuf.Timestamp |          | Required. The end timestamp of the data to retrieve. This is an exclusive bound.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| sample\_ms  | uint32                    |          | The rate to sample the returned data at. The data is sampled using [LTTB](https://github.com/sveinn-steinarsson/flot-downsample) which will return one point approximately every sample\_ms milliseconds that retains the shape of the raw data. Sampling is only supported for numeric data types, if sample\_ms is provided for non-numeric data, it will be ignored and the full-fidelity data will be returned. A value of 0 disables sampling and returns the full unsampled dataset. This is recommended for external data analysis where full fidelity is required, as opposed to plotting where downsampling is typically sufficient. |
| page\_size  | uint32                    |          | The maximum number of channel values to return. The service may return fewer than this value. If unspecified, at most 10,000 values will be returned. The maximum value is 100,000; values above 100,000 will be coerced to 100,000. For variable data types (i.e. string channels), at most page\_size elements will be read, or 1MB, whichever occurs first.                                                                                                                                                                                                                                                                                |
| page\_token | string                    |          | A page token, received from a previous `GetData` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `GetData` must match the call that provided the page token.                                                                                                                                                                                                                                                                                                                                                                                                                            |

### GetDataResponse

| Field             | Type                | Label    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| :---------------- | :------------------ | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| next\_page\_token | string              |          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| data              | google.protobuf.Any | repeated | data contains the result of the supplied queries. Be aware that each query can generate multiple data responses. For example, if run\_id is omitted from a ChannelQuery, the query returns data for all runs containing that channel. Channel data for each run is returned in a separate data object. Possible message types: sift.data.v2.DoubleValues sift.data.v2.FloatValues sift.data.v2.StringValues sift.data.v2.EnumValues sift.data.v2.BitFieldValues sift.data.v2.BoolValues sift.data.v2.Int32Values sift.data.v2.Int64Values sift.data.v2.Uint32Values sift.data.v2.Uint64Values sift.data.v2.BytesValues |

### Int32Value

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | int32                     |       |             |

### Int32Values

| Field    | Type                      | Label    | Description |
| :------- | :------------------------ | :------- | :---------- |
| metadata | [Metadata](#metadata)     |          |             |
| values   | [Int32Value](#int32value) | repeated |             |

### Int64Value

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | int64                     |       |             |

### Int64Values

| Field    | Type                      | Label    | Description |
| :------- | :------------------------ | :------- | :---------- |
| metadata | [Metadata](#metadata)     |          |             |
| values   | [Int64Value](#int64value) | repeated |             |

### Metadata

| Field       | Type                                                                        | Label    | Description |
| :---------- | :-------------------------------------------------------------------------- | :------- | :---------- |
| data\_type  | [sift.common.type.v1.ChannelDataType](#sift-common-type-v1-channeldatatype) |          |             |
| sampled\_ms | uint32                                                                      |          |             |
| asset       | [Metadata.Asset](#metadata-asset)                                           |          |             |
| run         | [Metadata.Run](#metadata-run)                                               | optional |             |
| channel     | [Metadata.Channel](#metadata-channel)                                       | optional |             |

### Metadata.Asset

| Field     | Type   | Label | Description |
| :-------- | :----- | :---- | :---------- |
| asset\_id | string |       |             |
| name      | string |       |             |

### Metadata.Channel

| Field                | Type                                                                                      | Label    | Description                                                                                                                                           |
| :------------------- | :---------------------------------------------------------------------------------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| channel\_id          | string                                                                                    |          | For channel queries, this will contain the requested backing channel id. For calculated channel queries, this will contain the requested channel key. |
| name                 | string                                                                                    |          |                                                                                                                                                       |
| unit                 | [Metadata.Channel.Unit](#metadata-channel-unit)                                           |          |                                                                                                                                                       |
| enum\_types          | [sift.common.type.v1.ChannelEnumType](#sift-common-type-v1-channelenumtype)               | repeated |                                                                                                                                                       |
| bit\_field\_elements | [sift.common.type.v1.ChannelBitFieldElement](#sift-common-type-v1-channelbitfieldelement) | repeated |                                                                                                                                                       |

### Metadata.Channel.Unit

| Field             | Type   | Label | Description |
| :---------------- | :----- | :---- | :---------- |
| name              | string |       |             |
| abbreviated\_name | string |       |             |

### Metadata.Run

| Field   | Type   | Label | Description                                                                                                                                          |
| :------ | :----- | :---- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |
| run\_id | string |       | The run\_id that was sent with the data during ingestion (if any). Note that this may be different from the run\_id that was requested in the query. |
| name    | string |       |                                                                                                                                                      |

### Query

| Field                            | Type                                              | Label | Description |
| :------------------------------- | :------------------------------------------------ | :---- | :---------- |
| oneof query. channel             | [ChannelQuery](#channelquery)                     |       |             |
| oneof query. calculated\_channel | [CalculatedChannelQuery](#calculatedchannelquery) |       |             |

### StringValue

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | string                    |       |             |

### StringValues

| Field    | Type                        | Label    | Description |
| :------- | :-------------------------- | :------- | :---------- |
| metadata | [Metadata](#metadata)       |          |             |
| values   | [StringValue](#stringvalue) | repeated |             |

### Uint32Value

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | uint32                    |       |             |

### Uint32Values

| Field    | Type                        | Label    | Description |
| :------- | :-------------------------- | :------- | :---------- |
| metadata | [Metadata](#metadata)       |          |             |
| values   | [Uint32Value](#uint32value) | repeated |             |

### Uint64Value

| Field     | Type                      | Label | Description |
| :-------- | :------------------------ | :---- | :---------- |
| timestamp | google.protobuf.Timestamp |       |             |
| value     | uint64                    |       |             |

### Uint64Values

| Field    | Type                        | Label    | Description |
| :------- | :-------------------------- | :------- | :---------- |
| metadata | [Metadata](#metadata)       |          |             |
| values   | [Uint64Value](#uint64value) | repeated |             |

<a name="sift_data_v2_data-proto-enums" />

## Enums

*Allowed constant values used in message fields.*
