Is there not a way to use the trends lua library to create trends in the script? I'm creating a utility app, where quickly adding trends is one functionality. I don't want users of that app to require filling in their username and password to run behind-the-scenes http requests.
If I put this inside a script:
Then it's clear that there is a create function inside the library. It's unfortunately not possible for me to determine what the parameters for that function is. Could you document which parameters are required to use that create function? Maybe even add that to the documentation.
Sorry if hijacking this post was wrong. Thought it best to continue with the existing issue, since it's quite similar.
I tried adding new trends directly through the database, but then I get errors about the trend file not existing, which I assume your backend creates when users submit through the normal form.
Edit:
I tried using a variation of these arguments, which logs an empty string and no errors. Though, the trend is not added. The arguments are based on the database column names.
If I put this inside a script:
Code:
require 'trends'
log(trends)
log(trends.create)Then it's clear that there is a create function inside the library. It's unfortunately not possible for me to determine what the parameters for that function is. Could you document which parameters are required to use that create function? Maybe even add that to the documentation.
Sorry if hijacking this post was wrong. Thought it best to continue with the existing issue, since it's quite similar.
I tried adding new trends directly through the database, but then I get errors about the trend file not existing, which I assume your backend creates when users submit through the normal form.
Edit:
I tried using a variation of these arguments, which logs an empty string and no errors. Though, the trend is not added. The arguments are based on the database column names.
Code:
log(trends.create('Test', {
name = 'Test',
type = 'G',
aggregation = 'MAX',
object = 53516,
precision = 0,
resolution = 15,
count_resolution = 51840,
count_daily = 730,
show_zero = 0,
sortorder = 1,
created = 1632087317,
category = 'Test',
}))