NetXMS Support Forum

English Support => General Support => Topic started by: Benjamin Dill on August 18, 2025, 02:51:12 PM

Title: Web API for Summary Table of Table DCI?
Post by: Benjamin Dill on August 18, 2025, 02:51:12 PM
Is it possible to use the Web API for requesting an adhoc summary table for a Table DCI?
https://netxms.org/documentation/adminguide/rest-api.html#adhoc-summary-table

If yes, how?
If no, what is the best way to export multiple Table DCI values to a CSV file automatically (meaning, by script)?
Title: Re: Web API for Summary Table of Table DCI?
Post by: Borgso on August 21, 2025, 01:01:43 PM
Old web api path summaryTable/adHoc vs restapi summary-table/ad-hoc

curl -s -X POST --cookie "session_handle=__HASH__" --data @netxms.json "http://localhost:8080/netxms-websvc/summaryTable/adHoc"
netxms.json, same as rest-api:
{
    "baseObject":"ContainerName",
    "columns": [
        {
        "columnName":"Free form name that will be used in return table for this column",
        "dciName":"Name of DCI, that will be used for filtering"
        },
        {
        "columnName":"Name2",
        "dciName":"DCIName2"
        }
    ]
}
Title: Re: Web API for Summary Table of Table DCI?
Post by: Benjamin Dill on August 22, 2025, 10:29:44 AM
Thank you, I am working with the API already. I am asking about creating an ad-hoc summary table from a table DCI. I suspect this is not yet implemented.
Title: Re: Web API for Summary Table of Table DCI?
Post by: Filipp Sudanov on August 27, 2025, 05:10:45 PM
We don't have a concept of DCI summary table from table DCIs. 
One option is to have a number of single-value push DCIs, then in transformation script of your table DCI you can push values into these. 
Or, via the API you can call   /objects/{object-id}/execute-script endpoint and call a script that would return the data you need. 
Title: Re: Web API for Summary Table of Table DCI?
Post by: Benjamin Dill on August 28, 2025, 09:13:27 AM
Are you sure about that there is no concept for DCI summary tables from table DCI? I am talking about this.
In the meantime I wrote a script to query each DCI one by one and join the results to one table (the same way the summary table for table DCI works), so you can consider my question as answered.

Title: Re: Web API for Summary Table of Table DCI?
Post by: Filipp Sudanov on August 28, 2025, 10:38:57 AM
Well, not so sure now, will check how this works. But don't think it's currently exposed to the API
Title: Re: Web API for Summary Table of Table DCI?
Post by: Filipp Sudanov on August 29, 2025, 05:06:14 PM
Table DCI summary tables work, I've tried in the new API, but it should be same in the old one under /summaryTable/adHoc

curl -s -X 'POST' 'http://127.0.0.1:8000/v1/dci-summary-tables/adhoc-query'  -H 'Authorization: Bearer xxxxxxxxxxxxxxxxxxx' -H 'Content-Type: application/json'  -d '{ "objectId": 2, "tableDefinition" : { "flags": 2, "dciName": "Network.Interfaces" } }'
P.S. flags are the following:
/
 * Summary table flags
 */
#define SUMMARY_TABLE_MULTI_INSTANCE      0x0001
#define SUMMARY_TABLE_TABLE_DCI_SOURCE    0x0002

/
 * Summary table column flags
 */
#define COLUMN_DEFINITION_REGEXP_MATCH    0x0001
#define COLUMN_DEFINITION_MULTIVALUED     0x0002
#define COLUMN_DEFINITION_BY_DESCRIPTION  0x0004
Title: Re: Web API for Summary Table of Table DCI?
Post by: Benjamin Dill on September 25, 2025, 05:10:03 PM
Oh nice, thank you. Maybe you can add this to the manual for future reference!