Prerequisites
- Have a Heex CLI
- Have a USER_SECRET_KEY. Should be accessible in your personnal space on the heex cloud platform. If you already logged-in you don’t need to add the Api-Key in your command line.
Usage
Subcommand | Description |
---|---|
add | Add a new Data Source to a given system. |
create | Creates a Data Source. |
create-template-file | Creates a template file that can be used to create a Data Source. |
get | Get details of a Data Source for a given ID. |
list | Provides a list of available Data Sources. |
delete | Delete a Data Source with a given ID. |
unlink | Unlink datasource from a given system. |
How to create a new Data Source
There are three ways to create a new Data Source. You can either create it from a bag, from a json file or by providing a name and/or a description. The flags that are available to achieve this command are the following:--api-key
: Provide your USER_SECRET_KEY. It is mandatory if you don’t use the--info-only
flag.--from-bag
: The path to the bag file you want to extract the signals from.--input-file
: The path to the json file you want to extarct info about Data Sources and signals.--system-id
: System id on which the Data Source will be created. It is mandatory if you don’t use the--info-only
flag.--datasource-name
: Data Source name.--description
: Data Source description. This is optional.--info-only
: If set, it will only list the signals that would be created into your terminal, without generating them on the cloud.--cannot-contain
: This option creates a ‘cannot contain’ filter on the topic names we shall extract. Any topic name containing one of these keywords shall not be extracted. Multiple can be given:--cannot-contain key1 --cannot-contain key2
.--must-contain
: This option creates a ‘must contain’ filter on the topic names we shall extract. Any topic name NOT containing one of these keywords shall not be extracted. Multiple can be given:--must-contain key1 --must-contain key2
.--output-file
: If you’d like to save the created data info into a file, provide its path using this option. Please provide a filepath with a json extension: /path/to/file.json--json-output
: Disables all logging (except errors), and your command shall only output the result in a json format. It is not compatible with ‘—output-file’ option.
- Extract all the topics out of the bag.
- Create a Data Source.
- Bind it to your system.
- Create each individual signal and link them to the Data Source.
- Update your system’s implementation to include the Data Source.
📝 Note: Custom Topics If your bag contains custom packages/messages that are specific to your own environment, please make sure that you have sourced all the message types you mean to extract in the terminal you call the command from.The third way to create a new Data Source is by providing a json file. First you need to create the json file, by following the format below:
name
is mandatory for data sources and for signals. If not provided, the data source or signal will be skipped.
If a system Id is provided, the data source will be bound to that system, otherwise the data source will be created but not bound to any system.
Example of how to create a new data source from a json file:
Usage:
How to create a template file
If you want to create a Data Source using a file, you can create a template file using the command below: Usage:create_datasource_template.json
in the specified directory or current working directory if no path was specified.
This file contains a basic template for creating a new data source. You can edit this file to add or modify the data source properties.
If there is a field that is not required, you can leave it empty or with the default value. You can add as many data sources and signals as you want to the file.
How to add a Data Source to a System
To add a data source to a system, you can use the commandadd
. Available flags are:
--datasource-id
: The ID of the Data Source you want to add. Multiple can be specified:--datasource-id ID1 --datasource-id ID2
.--system-id
: The ID of the System you want to add the Data Source to.
How to update a Data Source
To update a data source, you can use the commandupdate
. Available flags are:
--datasource-id
: The ID of the Data Source you want to update.--datasource-name
: Data Source name to update.--description
: Data Source description to update.
How to get Data Source details for a given Data Source Id
You can get the details of a Data Source if you provide andatasource-id
, see example below:
Usage:
How to list Data Source infos
This command allows you to retrieve datasources based on Data Source IDs or Data Source name. Note that all filters are optional, if no filters are provided, it will return all datasources found on page 1. Keep in mind that only a filter at a time can be applied, so if Data Source id is used , datasource-name cannot be used. Available subcommands:--api-key
: mandatory USER_SECRET_KEY.--datasource-id
: The ID of the Data Source you want to retrieve. Multiple can be specified:--datasource-id ID1 --datasource-id ID2
. It is exclusive with option name.--name
: The name of the Data Source to retrieve. It is exclusive with datasource-id option.--output-file
: If set, it’ll provide the result in a json format in a file generated at given path. Make sure you provide the ‘.json’ extension.--json-output
: Disables all logging (except errors), and your command shall only output the result in a json format. It is not compatible with ‘—output-file’ option.
How to delete a Data Source
To be able to delete a data source you need to provide adatasource-id
. If the data source is linked to any system, it is not possible to delete: you need to unlink it from the system(s) first and then try again.
Usage:
How to unlink a datasource from a system
You can unlink a datasource from a given system using theunlink
subcommand. This is useful when you want to remove a datasource from a system before deleting it or when the datasource is not compatible with the system anymore.
The available flags are:
--api-key
: Provide your USER_SECRET_KEY [required].--datasource-id
: ID of the datasource to unlink [required].--system-id
: ID of the system to unlink the datasource from [required].