@jared-wiltshire said in Questions about point-values endpoint:
/rest/v2/point-values/time-period/
Ok, thank you!!! I had not take a look to this endpoint before. It is good to know this variant of the request.
@jared-wiltshire said in Questions about point-values endpoint:
/rest/v2/point-values/time-period/
Ok, thank you!!! I had not take a look to this endpoint before. It is good to know this variant of the request.
Yes, i use the swagger documentation.
By this commentary you said:
@jared-wiltshire said in Questions about point-values endpoint:
would probably use the V2 version of the point values REST controller
I searched and found in the documentation the endpoint mentioned. I was just a little confused with the fact that it doesn't have the {xid} parameter in the url. But i found the xid in the body.
Thank you!!!
Ok, i see the problem.
There is something bad, but with the code i am using.
It does not give me the trailing time zone characters. I will modify this code and test.
With respect to the V2 version of the point-value, is it the POST request of path /rest/v2/point-values
?
Hi again.
I have two questions about the GET request over /rest/v1/point-values/{xid}
endpoint.
[
{
"value": 35,
"timestamp": 1560516758380,
"annotation": null
},
{
"value": 35,
"timestamp": 1560516818380,
"annotation": null
},
...
]
While i expected the response to be similar to the one delivered by the events endpoint.
{
"values": [
{
"value": 35,
"timestamp": 1560516758380,
"annotation": null
},
{
"value": 35,
"timestamp": 1560516818380,
"annotation": null
},
...
],
"total": 10
}
I just want to ask if this is the expected behaviour, to adapt my code to this response.
from=2019-06-14T04:00:00.000Z&to=2019-06-15T03:59:59.999Z
to the GET request, i mean, something like this:http://[host]:[port]/rest/v1/point-values/{xid}?from=2019-06-14T04:00:00.000Z&to=2019-06-15T03:59:59.999Z
all works flawlessly. But when i put this query from=2019-06-14T00:00:00.000&to=2019-06-14T23:59:59.999
or this query from=1560484800000&to=1560571199999
(the same time range as the previous, but in milliseconds since epoch), it returns me a 400 (bad request) error.
I ask if there is something bad with this format.
Thank you...
Ok, good idea.
Thank you!!!
Greetings!!!
I am listening WebSocket events by the endpoint
/rest/v1/websocket/events
I am sending the following JSON data:
{
"eventTypes":[
"RAISED",
"ACKNOWLEDGED",
"RETURN_TO_NORMAL",
"DEACTIVATED"
], "levels":[
"LIFE_SAFETY",
"CRITICAL",
"URGENT",
"WARNING",
"IMPORTANT",
"INFORMATION",
"NONE"
]
}
With this data, i just get the events filtered by "eventTypes" and "levels".
Is there a way to get event messages filtered by another filters, apart from these two?
It would be useful some query format like in the AST endpoint:
/rest/v1/events/query
Thanks...
By the way, i want to take the opportunity to ask what is the message body in /v1/events/acknowledge useful for. How can i use it? I refer to:
{
"args": [
"string"
],
"key": "string"
}
Do you prefer i to ask this in another topic?
Good morning. Yes, i had looked in swagger. And tested the
http://localhost:8080/rest/v1/events/acknowledge
end-point, and i can acknowledge with it. But in this case, i want to toggle the silence into the alarm without make the acknowledge.
I will take the suggestion of network tab for the old events page.
I want to read and mute events by an endpoint in the REST API.
But i found that the only way to make changes to change this is through the legacy interface.
Is the a way to read/change the state of audio alarm sounds by API?
Thanks...
Ok, we found the right way to send the body:
{
"name":"and",
"arguments":[
{
"name":"eq",
"arguments":[
"active",true
]
},
{
"name":"like",
"arguments":[
"message","*fallaPCI*"
]
}
]
}
Doing the body this way, responds a 200 (ok) with the body:
{
"items": [
{
"eventType": {
"dataSourceId": 652,
"dataPointId": 13948,
"pointEventDetectorId": 194,
"duplicateHandling": 2,
"eventType": "DATA_POINT",
"eventSubtype": null,
"referenceId1": 13948,
"referenceId2": 194,
"systemMessage": false,
"rateLimited": false,
"publisherId": -1
},
"message": "fallaPCI",
"id": 105235,
"active": true,
"status": "",
"alarmLevel": "CRITICAL",
"activeTimestamp": 1552682510905,
"acknowledged": false,
"comments": null,
"acknowledgedTimestamp": 0,
"acknowledgedByUserId": 0,
"acknowledgedByUsername": null,
"acknowledgedMessage": null,
"returnToNormalTimestamp": 0
}
],
"total": 1
}
We solved all of the doubts. Thank you very much!!!
We tried with both bodies you provided, but returns a 500 error with this body:
{
"cause": "IndexOutOfBoundsException: Index: 1, Size: 1",
"mangoStatusCode": -1,
"mangoStatusName": null,
"localizedMessage": "Internal Server Error"
}
Ok @Jared-Wiltshire, thank you very much!!! Now we know how to send the 'message' filter in the endpoint '/v1/events'. In fact, the SQL console answer in the field 'MESSAGE' was 'common.default|fallaPCI|'.
But we also want to implement the POST endpoint '/v1/events/query'. We are using this body (in this case to see which events are active):
{
"arguments": [
{"active": true}
],
"argumentsSize": 1,
"name": "string",
"nameValid": true,
"rootNode": true
}
But it returns a status 500 (Server Error) with this body:
{
"cause": "RQLToSQLParseException: Unsupported operation: string",
"mangoStatusCode": -1,
"mangoStatusName": null,
"localizedMessage": "Internal Server Error"
}
Can you give us an example of how to use this endpoint?
Good Morning.
We are trying to capture the following events through the mango REST API through its 'events-rest-controller' interface:
We have done tests with the endpoint '/v1/events', with which we have been able to capture the events.
We have also been able to capture executing several types of filters for this endpoint.
This, for example, is a query to the endpoint to filter by 'acknowledged':
This one is for filtering by 'active':
And this last is to filter by 'alarmLevel':
But when we try to filter by 'message', it does not show us any results, even though the filter has the same coincidence with the three events:
We tried to consult the endpoint '/v1/events/module-defined-query' but we do not understand it, and we have always had errors in the way we fill the body.
What we want to know is:
How to filter events by message.
How the endpoint '/v1/events/module-defined-query' works. We have already consulted the endpoint '/v1/events/explain-module-defined-queries', but we still do not understand it.
We also are trying with '/v1/events/query'. If you can supply us information about this endpoint, it would be helpful.
Beforehand thank you very much.