Samples¶
Retrieve Sample Trend¶
- GET /_config/samples/_trend¶
Description Retrieve the sample trend for functions or pipelines within a specified time range.
HTTP Method GET
Endpoint
/_config/samples/_trend
Request Header
Authorization
Basic <token>Request Parameters
Query Parameters
pipeline_id
(string, optional): The ID of the pipeline for which you want to retrieve the sample trend.function_id
(string, optional): The ID of the function for which you want to retrieve the sample trend.from
(string, optional): The start time for the trend data (default: “now-7d”).to
(string, optional): The end time for the trend data (default: “now”).interval
(string, optional): The interval range for the trend data can be either based on minute,hour or day(default: “day”).
Sample Request
Case 1: No interval timeframe is given: default day
curl --location 'https://app.4pointx.com/_config/samples/_trend?function_id=70cf64b3-1081-492d-9c01-b7e7fb4c0274&from=2024-12-18T05:30:00.000Z&to=2024-12-18T06:29:59.999Z' \ --header 'Authorization: Basic <token>' \ --data ''
Case 2: Interval timeframe is in hours
curl --location 'https://app.4pointx.com/_config/samples/_trend?function_id=70cf64b3-1081-492d-9c01-b7e7fb4c0274&from=2024-12-18T05:30:00.000Z&to=2024-12-18T06:29:59.999Z&interval=hour' \ --header 'Authorization: Basic <token>' \ --data ''
Case 3: Interval timeframe is in minutes
curl --location 'https://app.4pointx.com/_config/samples/_trend?function_id=70cf64b3-1081-492d-9c01-b7e7fb4c0274&from=2024-12-18T05:30:00.000Z&to=2024-12-18T06:29:59.999Z&interval=minute' \ --header 'Authorization: Basic <token>' \ --data ''
Sample Response
Success
Case 1: No interval timeframe is given: default day
[ { "ts": 1734460200000, "event_count": 9665 } ]
Case 2: Interval timeframe is in hours
[ { "ts": 1734499800000, "event_count": 9665 }, { "ts": 1734503400000, "event_count": 852 } ]
Case 3: Interval timeframe is in minutess
[ { "ts": 1734499800000, "event_count": 176 }, { "ts": 1734499860000, "event_count": 174 }, { "ts": 1734503280000, "event_count": 173 }, { "ts": 1734503340000, "event_count": 177 } ]
Error
{ "error": { "status": 400, "message": "Insufficient Inputs" } }
{ "error": { "status": 400, "message": "Excess Inputs" } }
Retrieve Sample Count¶
- GET /_config/samples/_count¶
Description Retrieve the total count of samples for a specific function or pipeline.
HTTP Method GET
Endpoint
/_config/samples/_count
Request Header
Authorization
Basic <token>Request Parameters
Query Parameters
pipeline_id
(string, optional): The ID of the pipeline for which you want to retrieve the sample count.function_id
(string, optional): The ID of the function for which you want to retrieve the sample count.
Sample Request
curl --location 'https://app.4pointx.com/_config/samples/_count?function_id=3626c23b-2070-48bb-baaa-1170a39c0f88%0A' \ --header 'Authorization: Basic <token>' \ --data ''
Sample Response
Success
8
Error
{ "error": { "status": 400, "message": "Insufficient Inputs" } }
{ "error": { "status": 400, "message": "Excess Inputs" } }