Endpoint Scripting Utils
Methods
| (DataPoint[]) getDataPoints(Date fromUTCDatetime) |
|---|
| The getDataPoints() method allows knowing the different states of an endpoint from the moment specified as fromUTCDateTime. The returned DataPoint object is polymorphic, meaning that depending on the endpoint type whose state is to be known, its properties are different. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let dataPoints = ep.getDataPoints(subtractHours(utils.utcNow, 10)); env.log(dataPoints); }); |
| (DataPoint[]) - Local Time getDataPoints(Date from LocalTime Datetime) |
|---|
| The getDataPoints() method allows knowing the different states of an endpoint from the moment specified as from local Time. The returned DataPoint object is polymorphic, meaning that depending on the endpoint type whose state is to be known, its properties are different. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date("2024-07-01"); result.setHours(result.getHours() - hours); return result; }; var epAddr = "Add1"; var ep = env.facility.endpoints.byAddress(epAddr); let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let dataPoints = ep.getDataPoints(subtractHours(utils.ltNow, 1)); env.log(dataPoints); }); |
| (double) getDataPointsAvg(Date fromUTCDatetime, Date toUTCDateTime) |
|---|
| The getDataPointsAvg() method allows knowing the arithmetic average of the states of an endpoint from the moment specified as fromUTCDateTime until the moment specified in the toUTCDateTime parameter. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsAvg(subtractHours(utils.utcNow, 10), utils.utcNow); env.log(avg); }); |
| (double) getDataPointsAvg(Date from local Time Datetime, Date to local Time DateTime) |
|---|
| The getDataPointsAvg() method allows knowing the arithmetic average of the states of an endpoint from the moment specified as from localTime DateTime until the moment specified in the to localDateTime parameter. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date("2024-05-10"); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsAvg(subtractHours(utils.ltNow, 2)); env.log(avg); }); |
| (double) getDataPointsMax(Date fromUTCDatetime) |
|---|
| The getDataPointsMax() method allows knowing the maximum value of the states of an endpoint from the moment specified as fromUTCDateTime. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsMax(subtractHours(utils.utcNow, 10)); env.log(avg); }); |
| (double) getDataPointsMax(Date fromUTCDatetime, Date toUTCDateTime) |
|---|
| The getDataPointsMax() method allows knowing the maximum value of the states of an endpoint from the moment specified as fromUTCDateTime until the moment specified in the toUTCDateTime parameter. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsMax(subtractHours(utils.utcNow, 10), utils.utcNow); env.log(avg); }); |
| (double) getDataPointsMin(Date fromUTCDatetime) |
|---|
| The getDataPointsMin() method allows knowing the minimum value of the states of an endpoint from the moment specified as fromUTCDateTime. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsMin(subtractHours(utils.utcNow, 10)); env.log(avg); }); |
| (double) getDataPointsMin(Date fromUTCDatetime, Date toUTCDateTime) |
|---|
| The getDataPointsMin() method allows knowing the minimum value of the states of an endpoint from the moment specified as fromUTCDateTime until the moment specified in the toUTCDateTime parameter. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsMin(subtractHours(utils.utcNow, 10), utils.utcNow); env.log(avg); }); |
| (double) getDataPointsSum(Date fromUTCDatetime) |
|---|
| The getDataPointsSum method allows knowing the sum of the state values of an endpoint from the moment specified as fromUTCDateTime. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsSum(subtractHours(utils.utcNow, 10)); env.log(avg); }); |
| (double) getDataPointsSum(Date fromUTCDatetime, Date toUTCDateTime) |
|---|
| The getDataPointsSum() method allows knowing the sum of the state values of an endpoint from the moment specified as the fromUTCDateTime parameter until the moment specified in the toUTCDateTime parameter. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsSum(subtractHours(utils.utcNow, 10), utils.utcNow); env.log(avg); }); |
=====
Local Time Methods
| (DataPoint[]) getDataPointsLT(DateTime from ) |
|---|
| The getDataPointsLT() method allows knowing the different states of an endpoint from the moment specified as 'from Local Time'. The returned DataPoint object is polymorphic, meaning that depending on the endpoint type whose state is to be known, its properties are different. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let dataPoints = ep.getDataPoints(subtractHours(utils.localTime, 10)); env.log(dataPoints); }); |
| (double) getDataPointsAvg(Date from local Time) |
|---|
| The getDataPointsAvg() method allows knowing the arithmetic average of the states of an endpoint from the moment specified as 'from local time'. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsAvg(subtractHours(utils.localTimeNow, 10)); env.log(avg); }); |
| (double) getDataPointsAvg(Date from LocalTime, LocalTime) |
|---|
| The getDataPointsAvg() method allows knowing the arithmetic average of the states of an endpoint from the moment specified as from Local Time until the moment specified in the to Local Time parameter. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsAvg(subtractHours(utils.localTimeNow, 10), utils.localTimeNow); env.log(avg); }); |
| (double) getDataPointsMax(Date from localTime) |
|---|
| The getDataPointsMax() method allows knowing the maximum value of the states of an endpoint from the moment specified as from localTime. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsMax(subtractHours(utils.localTimeNow, 10)); env.log(avg); }); |
| (double) getDataPointsMax(Date from localTime Datetime, Date to localTime DateTime) |
|---|
| The getDataPointsMax() method allows knowing the maximum value of the states of an endpoint from the moment specified as 'from localTime DateTime' until the moment specified in the 'to localTime DateTime' parameter. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsMax(subtractHours(utils.Now, 10), utils.utcNow); env.log(avg); }); |
| (double) getDataPointsMin(Date from localTime Datetime) |
|---|
| The getDataPointsMin() method allows knowing the minimum value of the states of an endpoint from the moment specified as 'from LocalTime'. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsMin(subtractHours(utils.localTimeNow, 10)); env.log(avg); }); |
| (double) getDataPointsMin(Date from localTime Datetime, Date to localTime DateTime) |
|---|
| The getDataPointsMin() method allows knowing the minimum value of the states of an endpoint from the moment specified as 'from localTime DateTime' until the moment specified in the 'to localTime DateTime' parameter. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsMin(subtractHours(utils.localTimeNow, 10), utils.localTimeNow); env.log(avg); }); |
| (double) getDataPointsSum(Date from localTime Datetime) |
|---|
| The getDataPointsSum method allows knowing the sum of the state values of an endpoint from the moment specified as from localTime DateTime. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsSum(subtractHours(utils.localTimeNow, 10)); env.log(avg); }); |
| (double) getDataPointsSum(Date from localTime Datetime, Date to localTime DateTime) |
|---|
| The getDataPointsSum() method allows knowing the sum of the state values of an endpoint from the moment specified as the 'localTime DateTime' parameter until the moment specified in the 'to localTime DateTime' parameter. For more information about DataPoint see this page |
| Examples |
| const subtractHours = (date, hours) => { const result = new Date(date); result.setHours(result.getHours() - hours); return result; }; let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let avg = ep.getDataPointsSum(subtractHours(utils.localTimeNow, 10), utils.localTimeNow); env.log(avg); }); |