Endpoint
Properties
| (EndPointAccessType) accessType |
|---|
| The accessType property gets the type of access applied to an endpoint. For more information about endpoint access types see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let aType = ep.accessType; env.log(aType); }); |
| (string) address |
|---|
| The address property gets the address of an endpoint. For more information about endpoints see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let addr = ep.address; env.log(addr); }); |
| (string) description |
|---|
| The description property gets the description that was defined for an endpoint when it was created. For more information about endpoints see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let addr = ep.address; env.log(addr); }); |
| (integer) endpointID |
|---|
| The endpointID property gets the unique identifier of an endpoint. For more information about endpoints see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let id= ep.endpointID; env.log(id); }); |
| (integer) endpointSubType |
|---|
| The endpointSubType property gets the endpoint subtype of an endpoint. If the endpoint has no defined subtype, null will be returned. For more information about endpoint subtypes see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let st = ep.endpointSubtype; env.log(st); }); |
| (integer) operationSecurityLevel |
|---|
| The operationSecurityLevel property gets the type of security that has been defined when operating on an endpoint. For more information about endpoint operation security levels see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let osl = ep.operationSecurityLevel; env.log(osl); }); |
| string[] tags |
|---|
| The tags property gets all tags that have been defined for an endpoint. For more information about endpoints see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let tags= ep.tags; tags.forEach((tag)=>{ env.log(tag); }); }); |
| (Device) device |
|---|
| The device property gets the device object to which an endpoint belongs. For more information about endpoints see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPointsArray = endpoints.toArray(); myendPointsArray.forEach((ep)=> { let device = ep.device; env.log(device); }); |
Methods
| (DataPoint) getCurrentState() |
|---|
| The getCurrentState() method gets the current state of an endpoint for all endpoint types that have a state. If the endpoint type does not have a state, the method will return an error with the description "Unsupported endpoint type in method getCurrentState". The returned DataPoint object is polymorphic, meaning that depending on the endpoint type whose state is being queried, its properties are different. For more information about DataPoint see this page |
| Examples |
| let endpoints = env.facility.endpoints; let myendPoint = endpoints.byTag('vitrina'); let status = myendPoint.getCurrentState(); let value = status.value; env.log(value); |
| (DataPoint[]) getDataPoints(Date fromUTCDatetime) |
|---|
| The getDataPoints() method gets the different states of an endpoint from the moment indicated as fromUTCDateTime. The returned DataPoint object is polymorphic, meaning that depending on the endpoint type whose state is being queried, 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); }); |
| (double) getDataPointsAvg(Date fromUTCDatetime) |
|---|
| The getDataPointsAvg() method gets the arithmetic average of an endpoint's states from the moment indicated 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.getDataPointsAvg(subtractHours(utils.utcNow, 10)); env.log(avg); }); |
| (double) getDataPointsAvg(Date fromUTCDatetime, Date toUTCDateTime) |
|---|
| The getDataPointsAvg() method gets the arithmetic average of an endpoint's states from the moment indicated as fromUTCDateTime up to the moment indicated 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) getDataPointsMax(Date fromUTCDatetime) |
|---|
| The getDataPointsMax() method gets the maximum value of an endpoint's states from the moment indicated 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 gets the maximum value of an endpoint's states from the moment indicated as fromUTCDateTime up to the moment indicated 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 gets the minimum value of an endpoint's states from the moment indicated 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 gets the minimum value of an endpoint's states from the moment indicated as fromUTCDateTime up to the moment indicated 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 gets the sum of the values of an endpoint's states from the moment indicated 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 gets the sum of the values of an endpoint's states from the moment indicated as the fromUTCDateTime parameter up to the moment indicated 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); }); |
| (DataPoint[]) getDataPointsLT(Date fromUTCDatetime, Date toUTCDateTime*) |
|---|
| The getDataPointsLT() method gets the states of an endpoint from the moment indicated as the fromUTCDateTime parameter up to the moment indicated in the toUTCDateTime parameter in the local time of the facility to which they belong. 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.getDataPointsLT(subtractHours(utils.utcNow, 10), utils.utcNow); env.log(avg); }); |
| (double) getDataPointsMaxLT(Date fromUTCDatetime, Date toUTCDateTime*) |
|---|
| The getDataPointsMaxLT() method gets the maximum value of an endpoint from the moment indicated as the fromUTCDateTime parameter up to the moment indicated in the toUTCDateTime parameter in the local time of the facility to which they belong. 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.getDataPointsMaxLT(subtractHours(utils.utcNow, 10), utils.utcNow); env.log(avg); }); |
| (double) getDataPointsMinLT(Date fromUTCDatetime, Date toUTCDateTime*) |
|---|
| The getDataPointsMinLT() method gets the minimum value of an endpoint from the moment indicated as the fromUTCDateTime parameter up to the moment indicated in the toUTCDateTime parameter in the local time of the facility to which they belong. 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.getDataPointsMinLT(subtractHours(utils.utcNow, 10), utils.utcNow); env.log(avg); }); |
| (double) getDataPointsSumLT(Date fromUTCDatetime, Date toUTCDateTime*) |
|---|
| The getDataPointsSumLT() method gets the sum of the states of an endpoint from the moment indicated as the fromUTCDateTime parameter up to the moment indicated in the toUTCDateTime parameter in the local time of the facility to which they belong. 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.getDataPointsSumLT(subtractHours(utils.utcNow, 10), utils.utcNow); env.log(avg); }); |