From 68995fadfd1f349fb60080a4a1bde9407a4075c8 Mon Sep 17 00:00:00 2001 From: Brijesh <115468216+brijeshnec@users.noreply.github.com> Date: Fri, 17 May 2024 16:15:35 +0530 Subject: [PATCH] Update aggregation-support.rst doc fix for #560 --- docs/en/source/aggregation-support.rst | 129 +++++++++++++------------ 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/docs/en/source/aggregation-support.rst b/docs/en/source/aggregation-support.rst index 5e32a9199..e0123643d 100644 --- a/docs/en/source/aggregation-support.rst +++ b/docs/en/source/aggregation-support.rst @@ -32,68 +32,67 @@ In order to create an entity, we can hit the endpoint POST **http:// Payload: -.. code-block:: JSON - - { - "id": "urn:ngsi-ld:Vehicle:B9211", - "type": "Vehicle", - "brandName": [ - { - "type": "Property", - "value": "Mercedes" - } - ], - "speed": [ - { - "type": "Property", - "value": 120, - "observedAt": "2020-08-01T12:00:00Z" - }, - { - "type": "Property", - "value": 100, - "observedAt": "2020-08-01T12:01:00Z" - }, - { - "type": "Property", - "value": 95, - "observedAt": "2020-08-01T12:02:00Z" - }, - { - "type": "Property", - "value": 85, - "observedAt": "2020-08-01T12:03:00Z" - }, - { - "type": "Property", - "value": 100, - "observedAt": "2020-08-01T12:04:00Z" - }, - { - "type": "Property", - "value": 115, - "observedAt": "2020-08-01T12:05:00Z" - }, - { - "type": "Property", - "value": 100, - "observedAt": "2020-08-01T12:06:00Z" - }, - { - "type": "Property", - "value": 80, - "observedAt": "2020-08-01T12:07:00Z" - }, - { - "type": "Property", - "value": 55, - "observedAt": "2020-08-01T12:08:00Z" - } - ], - "@context": [ - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" - ] - } +.. code-block:: curl + + curl --location 'http://localhost:9090/ngsi-ld/v1/temporal/entities' --header 'Content-Type: application/ld+json' --data-raw '{ + "id": "urn:ngsi-ld:Vehicle:B9211", + "type": "Vehicle", + "brandName": [ + { + "type": "Property", + "value": "Mercedes" + } + ], + "speed": [ + { + "type": "Property", + "value": 120, + "observedAt": "2020-08-01T12:00:00Z" + }, + { + "type": "Property", + "value": 100, + "observedAt": "2020-08-01T12:01:00Z" + }, + { + "type": "Property", + "value": 95, + "observedAt": "2020-08-01T12:02:00Z" + }, + { + "type": "Property", + "value": 85, + "observedAt": "2020-08-01T12:03:00Z" + }, + { + "type": "Property", + "value": 100, + "observedAt": "2020-08-01T12:04:00Z" + }, + { + "type": "Property", + "value": 115, + "observedAt": "2020-08-01T12:05:00Z" + }, + { + "type": "Property", + "value": 100, + "observedAt": "2020-08-01T12:06:00Z" + }, + { + "type": "Property", + "value": 80, + "observedAt": "2020-08-01T12:07:00Z" + }, + { + "type": "Property", + "value": 55, + "observedAt": "2020-08-01T12:08:00Z" + } + ], + "@context": [ + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" + ]}' 2. Query Operation @@ -103,7 +102,9 @@ To retrieve entity with aggregation support, you can send an HTTP GET to - **htt **EXAMPLE:** Give back all aggr methods (max, min, avg, sum, sumsq, stddev, totalCount, distinctCount) for Entities of type Vehicle - GET - **http://localhost:9090/ngsi-ld/v1/temporal/entities?type=Vehicle&aggrMethods=max%2Cmin%2Cavg%2Csum%2Csumsq%2Cstddev%2CtotalCount%2CdistinctCount&timeproperty=observedAt'** +.. code-block:: curl + + curl --location 'http://localhost:9090/ngsi-ld/v1/temporal/entities?type=Vehicle&aggrMethods=max%2Cmin%2Cavg%2Csum%2Csumsq%2Cstddev%2CtotalCount%2CdistinctCount&timeproperty=observedAt' Response: @@ -207,4 +208,4 @@ Response: "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" ] } - ] \ No newline at end of file + ]