Example of the REST Query API
About this task
Note: The API /v1/datapoints/latest/v2 is not supported by the REST query.
Procedure
-
Create a query.
The header of the query must be in the following format:
The following table provides the URL and other required values for each task that you can perform using the REST query.Headers: Authorization: Bearer <token from a trusted issuer> Predix-Zone-Id: <tenant> Content-Type: application/json
Task URL Method Request Body Request Headers Get values for a tag http://<IP address of the Linux machine>:8989/v1/datapoints POST { “start”: “1h-ago”, “tags”: [ { “name”: “”, “order”: “desc” } ] } Predix-Zone-Id Can be any value. Not validated. Get values for a tag http://<IP address of the Linux machine>:8989/v1/datapoints?query= { “start”: “1h-ago”, “tags”: [ { “name”: “”, “order”: “desc” } ] } GET Predix-Zone-Id Can be any value. Not validated. Get all tags http://<IP address of the Linux machine>:8989/v1/tags GET None Predix-Zone-Id Can be any value. Not validated. - Retrieve a token from the OAUTH2 server by using the following REST API:
curl -u <Client-Id>:<Client-secret> https://<IP address of the Predix Edge OS device>:8080/uaa/oauth/token -d 'grant_type=client_credentials'
curl -u edgeclient:edgesecret https://10.10.10.10:8080/uaa/oauth/token -d 'grant_type=client_credentials'