ReferenceClientChannels

Channels

Learn the fundamentals of creating, retrieving, renaming, and deleting channels.

A channel is a collection of time-ordered data. Channels store sensor readings, actuator commands, post-processed results, logs, or any other time-ordered data.

Calculated channels are computed from other channels.

Channel Parameters

Table

Parameter Type Default Description
name string Required A human-readable name for the channel. This name is not guaranteed to be unique.
data_type DataType Required The data type of the samples stored in the channel (e.g., DataType.FLOAT32, DataType.TIMESTAMP).
is_index boolean False Set to True if the channel is an index channel, False otherwise. Index channels must have a data type of DataType.TIMESTAMP.
index number 0 The key of the index channel that this channel is associated with. Not required for index channels.
virtual boolean False Set to True if the channel is virtual. Virtual channels do not store data in the database and are used for streaming purposes only.
retrieve_if_name_exists boolean False If True, retrieves the channel if one with the same name already exists instead of creating a duplicate.

Create Channels

Use the create method to create one channel or many channels. Creating many channels in a single call is more efficient than creating them individually. The call is atomic, so Synnax creates all of the channels or none of them.

You must create an index channel before the non-virtual data channels that use it.

Retrieve Channels

To retrieve channel(s), pass the channel name(s) or key(s) to the retrieve method. Retrieving by key is faster than retrieving by name, and is recommended whenever possible.

If you pass one key or name, the client raises a NotFoundError when no channel matches and a MultipleFoundError when more than one channel matches. If you pass a list, the client raises no error and leaves missing channels out of the results.

Channels can also be retrieved using ranges.

Regular Expressions

Channels can be retrieved using regular expression patterns. The Core treats any name starting with ^ or ending with $ as a regex pattern.

If you expect multiple channels to match the pattern, you must pass in a list to the retrieve method, otherwise the client will raise a MultipleFoundError.

Rename Channels

Delete Channels

Deleting a channel will also delete all of the data stored for that channel in a Synnax Core. This is a permanent operation that cannot be undone. Be careful!

Channel Aliases

Ranges allow you to define aliases for channels that only apply within that range’s context. This is useful when you want to give a channel a more descriptive name for a specific test or operation.

Aliases are only valid within the context of a particular range. If you try to access an aliased channel outside of the range, Synnax will not be able to find it.