Overview
This documentation outlines usage for LogQS.
For OpenAPI documentation, visit https://api.logqs.com/apps/lqs/redoc.
Quick Start
from lqs import LogQS
lqs = LogQS()
log = lqs.resource.Log.fetch("Demo Log")
topic = log.list_topics(type_name="sensor_msgs/Image")[0]
record = topic.list_records()[0]
record.load_auxiliary_data_image()
LogQS operates as a REST API service, meaning you can interact with it however you can make HTTPS requests. However, it’s much easier to use the LogQS Client Python library. We will use the client for these docs, but be aware that these interactions don’t require it.
First, we set up the environment by install LogQS:
pip install --upgrade LogQS
Then, we import the client class.
from lqs import LogQS
To access a DataStore, the LogQS Client requires, at a minimum, three parameters to be explicitly configured:
api_key_id - The ID of the API Key being used to access the service
api_key_secret - The secret of the API Key being used to access the service
datastore_id - The ID of the DataStore being accessed
An API Key can be generated from the Studio app. The API URL should be the “base” URL, e.g., https://api.logqs.com, and not the URL of a specific endpoint, e.g., https://api.logqs.com/apps/lqs/api, etc.
These parameters can be passed to the client in a few ways:
As parameters to the constructor (either as a dict or as a RESTClientConfig object)
As environment variables (i.e., LQS_API_KEY_ID, LQS_API_KEY_SECRET, and LQS_DATASTORE_ID, which will be loaded from a .env file if present)
As a configuration file (i.e., logqs-config.json with a single object containing the three parameters)
By default, the client will use the api_url of https://api.logqs.com. If you are using a different API URL, you will need to pass it to the client.
Generating an API Key
A user can generate an API Key to use with the client through the LogQS Studio app. After signing in and selecting a DataStore, the user can navigate to the “API Keys” tab and click “Create API Key”. The user will be prompted to enter a name for the key and a user which the key will operate on behalf, and the key will be generated. The user can then copy the key ID and secret to use with the client.
NOTE: The API Key secret is only displayed once, so the user should copy it to a secure location.
From Studio, the user can also find the DataStore ID by opening the “Settings” sidebar by clicking the “gear” icon in the top right corner. The DataStore ID will be displayed under “ID”.
Using the LogQS Client
Once the client is configured, it can be used to interact with the LogQS service. The client can be imported and instantiated as follows:
lqs = LogQS()
Generally, using LogQS involves either ingesting or querying record data. All record data is associated with a single topic, which is associated with a single log, which is associated with a single group.
In a fresh DataStore, you can ingest a log file by first creating a group then a log in that group. You can then upload a file to that log and create an ingestion for the file. Once the ingestion process is complete, you can list the topics created by the ingestion and query records from those topics.
Support
For any support questions please open a ticket on our support portal with a detailed description of your question or issue.