diff --git a/wiki/API/README.md b/wiki/API/README.md new file mode 100644 index 00000000..61ee6729 --- /dev/null +++ b/wiki/API/README.md @@ -0,0 +1,279 @@ +## IndustryFusion Digital Twin REST API overview + +### What is the use of the Digital Twin (DT) REST API? + +Digital Twin consists of multiple open-source components namely, + +1. Keycloak - Access Management to all DT services. +2. Scorpio Broker - NGSI-LD Context broker which lets to manage (CRUD) digital assets. +3. PGRest - Wrapper to PostgreSQL database, serves time-series for the asset data. +4. Alerta - Serves alerts from the streaming validation jobs. + +All these above services are utilized in the Digital Twin framework. Each of these services have seperate REST API documentation which can be utilized and used for the IFF Asset data. + +### When to use Digital Twin REST API? + +If the interaction is directly with Digital Twin, these REST APIs can be utilized to create assets and interact with it. For example, if a machine/asset needs to be created digitally, Scorpio Broker API lets to create and manage assets with the Authorization token from Keycloak. Then, once the gateway is connected to the machine and IFF agent sends data to the digital asset, PGRest can be used to see the data wuth time-series stamps. Then, when the SHACL rules are implemented with streaming jobs, the Alerta API can be used to see the alerts generated according to the rules in real-time. + +If the interaction is intended from IndustryFusion-X ecosystem, which is the commercial implementation of IndutryFusion open-source, the user must follow the registration of the company in ifric.org, and must use industryfusion-x.org to create Process Digital Twin (PDT) assets in the platform. Then, the user must use the dedicated hardwares and Industryfusion-x Factory Suite in which the user can use the Factory Manager UI application to interact with DigitalTwin services. + +### Sequence of Digital Twin API usage + +Once the DigitalTwin is deployed on Kubernetes, as the output, four URL endpoints (Keycloak, Scorpio, PGRest, Alerta) will be exposed for the user to access REST APIs. + +#### 1. Get access token from Keycloak + +Visit Keyclock UI: keycloak-endpoint/auth/ + +![Keycloak UI](image1.png) + +Click on 'Administration Console'. + +![Keycloak Login](image2.png) + +Username is 'admin', using below command fetch the password from DT deployment. + +`kubectl -n iff get secret/keycloak-initial-admin -o=jsonpath='{.data.password}' | base64 -d | xargs echo` + + +![alt text](image3.png) + +Select 'iff' realm in the above screen. + +![alt text](image4.png) + +Different clients has different scopes. In this example, the client 'scorpio' will be used to access all APIs in this documentation. Make sure the 'scorpio' client has the above shown scopes. If not present, add them using 'Add Client scope'. + +**POST keycloak-endpoint/auth/realms/iff/protocol/openid-connect/token** + +**Body:** + +![alt text](image5.png) + +Fetch the password 'realm_user' for the request using the below command. + +`kubectl -n iff get secret/credential-iff-realm-user-iff -o jsonpath='{.data.password}'| base64 -d | xargs echo` + + +**Response:** + +![alt text](image6.png) + + +#### 2. Define and Create the Asset in Scorpio Broker + +**Asset Definition:** + +A basic JSON-LD/NGSI-LD asset looks like below. + +```json +{ + "id": "urn:asset:1", + "type": "http://www.industry-fusion.org/schema#bendingMachine", + "http://www.industry-fusion.org/fields#active_current": { + "type": "Property", + "value": 222 + } +} + +``` + +**POST scorpio-endpoint/ngsi-ld/v1/entities/** + +![alt text](image7.png) + +Use the Keycloak access_token from last step in the header as Bearer token and use the JSON example asset in the body. + +#### 3. Create Streaming Validation Jobs + +The Digital Twin (DT) application generates alerts based on semantic models. Two important files, knowledge.ttl and shacl.ttl, define the rules for generating these alerts. + +Create a new folder, for example, 'demo' inside semantic-model/kms/. + +Create files called knowledge.ttl and shacl.ttl in the demo folder. + +**knowledge.ttl** + +``` +# baseURI: http://www.industry-fusion.org/schema + +@prefix : . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix schema: . +@prefix xsd: . + + + rdf:type owl:Ontology ; + owl:versionInfo "Created with TopBraid Composer" ; +. +:bendingMachine + rdf:type rdfs:Class ; +. + +``` + +**shacl.ttl** + +``` +@prefix : . +@prefix fields: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . +@prefix schema: . +@prefix sh: . +@prefix xsd: . + + + rdf:type owl:Ontology ; + owl:imports ; +. + +:active_current + rdf:type sh:NodeShape ; + sh:property [ + rdf:type sh:PropertyShape ; + sh:path ; + sh:maxCount 1 ; + sh:minCount 1 ; + sh:name "active_current" ; + sh:nodeKind sh:BlankNode ; + sh:order "1" ; + sh:property [ + sh:path ; + sh:maxCount 1 ; + sh:maxInclusive "500" ; + sh:minCount 1 ; + sh:minInclusive "100" ; + sh:nodeKind sh:Literal ; + ] ; + ] ; + sh:targetClass schema:bendingMachine ; +. + + + rdf:type rdf:Property ; +. + +``` + +The above files defines validation rules for type bendingMachine, and gives alerts if the data being sent to the active_current property is above 500 and below 100. + +Now, to deploy these rules as jobs in DT, follow the below commands. + +`cd /DigitalTwin/semantic-model/shacl2flink` + +`make setup` + +`KMS_DIR=./../kms/demo make prepare-kms` + +`make flink-deploy` + + +#### 4. Send data to the Digital Asset using IFF Agent + +To start the agent, Go to NgsildAgent folder and run the following commands. + +```bash +npm install +cp config/config.json.template config/config.json +./iff-agent.js +``` + +Go to NgsildAgent/util directory of DigitalTwin. To send/update the data to the asset created in last step use the following commands. + +```bash +./init-device.sh urn:asset:1 gatewayid +password=$(kubectl -n iff get secret/credential-iff-realm-user-iff -o jsonpath='{.data.password}'| base64 -d) +./get-onboarding-token.sh -p ${password} realm_user +./activate.sh -f +./send_data.sh "http://www.industry-fusion.org/fields#active_current" "501" +``` + +#### 5. Access Time-series data of the digital asset from PGRest + +Once the data is sent to the asset, timeseries data of the asset can be retrieved using PGRest API. + +**GET pgrest-endpoint/pgrest/entityhistory?entityId=eq.urn:asset:1** + +![alt text](image7.png) + +Use the Keycloak access_token in header. + +**Response:** + +```json + { + "observedAt": "2024-08-29T09:23:39+00:00", + "modifiedAt": "2024-08-29T09:23:39+00:00", + "entityId": "urn:asset:1", + "attributeId": "http://www.industry-fusion.org/fields#active_current", + "attributeType": "https://uri.etsi.org/ngsi-ld/Property", + "datasetId": "@none", + "nodeType": "@value", + "value": "501", + "valueType": null, + "index": 0 + } +``` + + +#### 6. Access alerts from Alerta + +As the value sent to the asset in the above step is above 500. The Alerta API can be used to fetch alerts based on the validation rules. + +**GET alerta-endpoint/alerta/api/alerts** + +Alerta needs a seperate API key for authorization. Fetch the key and send it in headers as shown below. + +Alerta Key: `kubectl -n iff get secret/alerta -o jsonpath='{.data.alerta-admin-key}'| base64 -d` + + +![alt text](image8.png) + +**Response** + +```json +{ + "alerts": [], + "autoRefresh": true, + "lastTime": "2024-11-06T17:00:08.645Z", + "message": "not found", + "more": false, + "page": 1, + "pageSize": 50, + "pages": 0, + "severityCounts": {}, + "status": "ok", + "statusCounts": {}, + "total": 0 +} +``` + +### API Documentation & Postman collections + +#### Keycloak + +API Documentation: [Click here](https://www.keycloak.org/docs/latest/authorization_services/index.html#_service_authorization_api) + +Postman Collection: [Click here](keycloak.postman_collection.json) + +#### Scorpio Broker + +API Documentation: [Click here](https://scorpio.readthedocs.io/en/latest/API_walkthrough.html#) + +Postman Collection: [Click here](Scorpio_Broker_latest.postman_collection.json) + +#### PGRest + +API Documentation: [Click here](https://docs.postgrest.org/en/stable/references/api/tables_views.html#read) + +Postman Collection: [Click here](pgrest.postman_collection.json) + +#### Alerta + +API Documentation: [Click here](https://docs.alerta.io/api/reference.html) + +Postman Collection: [Click here](https://www.postman.com/api-evangelist/server-density/folder/t2fcqfc/alerts?action=share&creator=29168847&ctx=documentation) \ No newline at end of file diff --git a/wiki/API/Scorpio_Broker_latest.postman_collection.json b/wiki/API/Scorpio_Broker_latest.postman_collection.json new file mode 100644 index 00000000..351f97a8 --- /dev/null +++ b/wiki/API/Scorpio_Broker_latest.postman_collection.json @@ -0,0 +1,2291 @@ +{ + "info": { + "_postman_id": "a1e01b54-c4fc-493a-b4d1-d0670ebaafc6", + "name": "Scorpio Broker_latest", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "29168847", + "_collection_link": "https://red-meadow-9044-1.postman.co/workspace/My-Workspace~70c949dc-6684-4820-85df-5718362b357e/collection/20295401-a1e01b54-c4fc-493a-b4d1-d0670ebaafc6?action=share&source=collection_link&creator=29168847" + }, + "item": [ + { + "name": "Entities", + "item": [ + { + "name": "Create entity - context in payload", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Authorization", + "value": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI4ems3QTFMdV9MNFdhMEE3TEtsV2ZPZ0pFdkVxeEdFeFZiRkJTX3Z0V2p3In0.eyJleHAiOjE2NDE1MTc4MTIsImlhdCI6MTY0MTUxNzUxMiwianRpIjoiOTZkZGJmMjMtYzk1ZC00MGJlLTg3ZWUtNjVjYjBkYmQzYTQ2IiwiaXNzIjoiaHR0cDovL2tleWNsb2FrLWh0dHAub2lzcC5zdmMuY2x1c3Rlci5sb2NhbDo0MDgwL2tleWNsb2FrL3JlYWxtcy9vcmciLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiMjI1OGZkYTQtYTkwYi00OGE3LTk2MjgtMDgzMjFlYzg5YzVmIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZW50aXR5LW1hbmFnZXIiLCJzZXNzaW9uX3N0YXRlIjoiMThlNzNiYjgtMDBiMy00NWE1LWIwZmUtNDVhZjkzMTZhNjlkIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJGYWN0b3J5LUFkbWluIiwib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImVudGl0eS1tYW5hZ2VyIjp7InJvbGVzIjpbIkZhY3RvcnktQWRtaW4iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoidGVzdCJ9.GLFhjMV2uKanhz0G4BcJJzfU6h2RwzKbfzvKvq3689KHmZmLQBgx10BGnsxFFwIsaurGjck148tL7H4VusKXGRkBRalH6PK8E-jWNagZ3Xi-dCTwzrD5BoDD9ZatW_RwSpkgcX6NnfFHr9TgVnTGzghxWKx3hQc_JEpQ1jAvSYllGO-aWB4pZ0SqbFCPD8Vevm-oSldmNV2wVI52N_d_2_EXSTgZhUYz9deB1Yqao_yMy0__pRvw-YuRy1WDGLuOEzbqNYxQawD3U5FaTZ4XxOnAf4BjoNczP3i0FTtmn9PpQZcAsbaP7jyS5fFT953f72ECzeYTFr6ugyk0VdymZQ", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"@context\": [{\r\n\t\t\"Vehicle\": \"http://example.org/vehicle/Vehicle\",\r\n\t\t\"brandName\": \"http://example.org/vehicle/brandName\",\r\n\t\t\"speed\": \"http://example.org/vehicle/speed\",\r\n\t\t\"isParked\": {\r\n\t\t\t\"@type\": \"@id\",\r\n\t\t\t\"@id\": \"http://example.org/common/isParked\"\r\n\t\t},\r\n\t\t\"providedBy\": {\r\n\t\t\t\"@type\": \"@id\",\r\n\t\t\t\"@id\": \"http://example.org/common/providedBy\"\r\n\t\t}\r\n\t}],\r\n\t\"id\": \"urn:ngsi-ld:Vehicle:A4580\",\r\n\t\"type\": \"Vehicle\",\r\n\t\"brandName\": {\r\n\t\t\"type\": \"Property\",\r\n\t\t\"value\": \"Mercedes\"\r\n\t},\r\n\t\"isParked\": {\r\n\t\t\"type\": \"Relationship\",\r\n\t\t\"object\": \"urn:ngsi-ld:OffStreetParking:Downtown1\",\r\n\t\t\"observedAt\": \"2017-07-29T12:00:04\",\r\n\t\t\"providedBy\": {\r\n\t\t\t\"type\": \"Relationship\",\r\n\t\t\t\"object\": \"urn:ngsi-ld:Person:Bob\"\r\n\t\t}\r\n\t},\r\n\t\"speed\": {\r\n\t\t\"type\": \"Property\",\r\n\t\t\"value\": 80\r\n\t},\r\n\t\"createdAt\": \"2017-07-29T12:00:04\",\r\n\t\"location\": {\r\n\t\t\"type\": \"GeoProperty\",\r\n\t\t\"value\": {\r\n\t\t\t\"type\": \"Polygon\",\r\n\t\t\t\"coordinates\": [\r\n\t\t\t\t[\r\n\t\t\t\t\t[8.686752319335938, 49.359122687528746],\r\n\t\t\t\t\t[8.742027282714844, 49.3642654834877],\r\n\t\t\t\t\t[8.767433166503904, 49.398462568451485],\r\n\t\t\t\t\t[8.768119812011719, 49.42750021620163],\r\n\t\t\t\t\t[8.74305725097656, 49.44781634951542],\r\n\t\t\t\t\t[8.669242858886719, 49.43754770762113],\r\n\t\t\t\t\t[8.63525390625, 49.41968407776289],\r\n\t\t\t\t\t[8.637657165527344, 49.3995797187007],\r\n\t\t\t\t\t[8.663749694824219, 49.36851347448498],\r\n\t\t\t\t\t[8.686752319335938, 49.359122687528746]\r\n\t\t\t\t]\r\n\t\t\t]\r\n\t\t}\r\n\t}\r\n}" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities/", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "response": [] + }, + { + "name": "Create entity with Link header", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"id\": \"urn:ngsi-ld:Vehicle:A100\",\r\n\t\"type\": \"Vehicle\",\r\n\t\"brandName\": {\r\n\t\t\"type\": \"Property\",\r\n\t\t\"value\": \"Mercedes\"\r\n\t},\r\n\t\"isParked\": {\r\n\t\t\"type\": \"Relationship\",\r\n\t\t\"object\": \"urn:ngsi-ld:OffStreetParking:Downtown1\",\r\n\t\t\"observedAt\": \"2017-07-29T12:00:04\",\r\n\t\t\"providedBy\": {\r\n\t\t\t\"type\": \"Relationship\",\r\n\t\t\t\"object\": \"urn:ngsi-ld:Person:Bob\"\r\n\t\t}\r\n\t},\r\n\t\"speed\": {\r\n\t\t\"type\": \"Property\",\r\n\t\t\"value\": 80\r\n\t},\r\n\t\"createdAt\": \"2017-07-29T12:00:04\",\r\n\t\"location\": {\r\n\t\t\"type\": \"GeoProperty\",\r\n\t\t\"value\": {\r\n\t\t\t\"type\": \"Point\",\r\n\t\t\t\"coordinates\": [-8.5, 41.2]\r\n\t\t}\r\n\t}\r\n}" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities/", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "response": [] + }, + { + "name": "Append Entity request", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"@context\": {\r\n\t\t\"brandName1\": \"http://example.org/vehicle/brandName1\"\r\n\t},\r\n\t\"brandName1\": {\r\n\t\t\"type\": \"Property\",\r\n\t\t\"value\": \"BMW\"\r\n\t}\r\n}" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:A100/attrs", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Vehicle:A100", + "attrs" + ] + }, + "description": "Add new attributes in existing entity" + }, + "response": [] + }, + { + "name": "partial update request", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"@context\": {\r\n\t\t\"brandName\": \"http://example.org/vehicle/brandName\"\r\n\t},\r\n\t\"value\": \"BMW\"\r\n}" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:A100/attrs/brandName", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Vehicle:A100", + "attrs", + "brandName" + ] + }, + "description": "partially update the attribute of entity" + }, + "response": [] + }, + { + "name": "Delete attribute", + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:A100/attrs/brandName1", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Vehicle:A100", + "attrs", + "brandName1" + ] + } + }, + "response": [] + }, + { + "name": "Delete entity", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "https://development.industry-fusion.com/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:A100", + "protocol": "https", + "host": [ + "development", + "industry-fusion", + "com" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Vehicle:A100" + ] + } + }, + "response": [] + }, + { + "name": "Create entity expanded", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"http://example.org/vehicle/brandName\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": \"Mercedes\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/createdAt\": [\r\n {\r\n \"@type\": \"http://uri.etsi.org/ngsi-ld/DateTime\",\r\n \"@value\": \"2017-07-29T12:00:04\"\r\n }\r\n ],\r\n \"@id\": \"urn:ngsi-ld:Vehicle:A8866\",\r\n \"http://example.org/common/isParked\": [\r\n {\r\n \"http://uri.etsi.org/ngsi-ld/hasObject\": [\r\n {\r\n \"@id\": \"urn:ngsi-ld:OffStreetParking:Downtown1\"\r\n }\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/observedAt\": [\r\n {\r\n \"@type\": \"http://uri.etsi.org/ngsi-ld/DateTime\",\r\n \"@value\": \"2017-07-29T12:00:04\"\r\n }\r\n ],\r\n \"http://example.org/common/providedBy\": [\r\n {\r\n \"http://uri.etsi.org/ngsi-ld/hasObject\": [\r\n {\r\n \"@id\": \"urn:ngsi-ld:Person:Bob\"\r\n }\r\n ],\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Relationship\"\r\n ]\r\n }\r\n ],\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Relationship\"\r\n ]\r\n }\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/location\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/GeoProperty\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": \"{ \\\"type\\\":\\\"Point\\\", \\\"coordinates\\\":[ -8.5, 41.2 ] }\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"http://example.org/vehicle/speed\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": 80\r\n }\r\n ]\r\n }\r\n ],\r\n \"@type\": [\r\n \"http://example.org/vehicle/Vehicle\"\r\n ]\r\n}" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities/", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "response": [] + }, + { + "name": "Create entity all_datatypes", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": [\r\n {\r\n \"numberExample\": \"http://example.org/numberExample\",\r\n \"stringExample\": \"http://example.org/stringExample\",\r\n \"dateTimeExample\": \"http://example.org/dateTimeExample\",\r\n \"dateExample\": \"http://example.org/dateExample\",\r\n \"timeExample\": \"http://example.org/timeExample\",\r\n \"otherValueExample\": \"http://example.org/otherValueExample\",\r\n \"trueExample\": \"http://example.org/trueExample\",\r\n \"falseExample\": \"http://example.org/falseExample\",\r\n \"nullExample\": \"http://example.org/nullExample\",\r\n \"uriExample\": \"http://example.org/uriExample\",\r\n \"structuredExample1\": \"http://example.org/structuredExample1\",\r\n \"structuredExample2\": \"http://example.org/structuredExample2\",\r\n \"topLevelExample\": \"http://example.org/topLevelExample\",\r\n \"subPropertyExample\": \"http://example.org/subPropertyExample\",\r\n \"relationshipExample\": \"http://example.org/relationshipExample\"\r\n }\r\n ],\r\n \"id\": \"urn:ngsi-ld:Test:all_datatypes\",\r\n \"type\": \"urn:ngsi-ld:Test\",\r\n \"numberExample\": {\r\n \"type\": \"Property\",\r\n \"value\": 100\r\n },\r\n \"stringExample\": {\r\n \"type\": \"Property\",\r\n \"value\": \"Mercedes\"\r\n },\r\n \"dateTimeExample\": {\r\n \"type\": \"Property\",\r\n \"value\": \"TODO\"\r\n },\r\n \"dateExample\": {\r\n \"type\": \"Property\",\r\n \"value\": \"TODO\"\r\n },\r\n \"timeExample\": {\r\n \"type\": \"Property\",\r\n \"value\": \"TODO\"\r\n },\r\n \"otherValueExample\": {\r\n \"type\": \"Property\",\r\n \"value\": true\r\n },\r\n \"trueExample\": {\r\n \"type\": \"Property\",\r\n \"value\": true\r\n },\r\n \"falseExample\": {\r\n \"type\": \"Property\",\r\n \"value\": false\r\n },\r\n \"nullExample\": {\r\n \"type\": \"Property\",\r\n \"value\": null\r\n },\r\n \"uriExample\": {\r\n \"type\": \"Property\",\r\n \"value\": \"http://www.example.com\"\r\n },\r\n \"topLevelExample\": {\r\n \"type\": \"Property\",\r\n \"value\": 10,\r\n \"subPropertyExample\": {\r\n \"type\": \"Property\",\r\n \"value\": 5\r\n }\r\n },\r\n \"relationshipExample\": {\r\n \"type\": \"Relationship\",\r\n \"object\": \"urn:ngsi-ld:relationshipExample\"\r\n }\r\n}" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities/", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "response": [] + }, + { + "name": "Create entity all_datatypes expanded", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"http://example.org/dateExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": \"TODO\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"http://example.org/dateTimeExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": \"TODO\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"http://example.org/falseExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": false\r\n }\r\n ]\r\n }\r\n ],\r\n \"@id\": \"urn:ngsi-ld:Test:all_datatypes\",\r\n \"http://example.org/nullExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ]\r\n }\r\n ],\r\n \"http://example.org/numberExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": 100\r\n }\r\n ]\r\n }\r\n ],\r\n \"http://example.org/otherValueExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": true\r\n }\r\n ]\r\n }\r\n ],\r\n \"http://example.org/relationshipExample\": [\r\n {\r\n \"http://uri.etsi.org/ngsi-ld/hasObject\": [\r\n {\r\n \"@id\": \"urn:ngsi-ld:relationshipExample\"\r\n }\r\n ],\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Relationship\"\r\n ]\r\n }\r\n ],\r\n \"http://example.org/stringExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": \"Mercedes\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"http://example.org/structuredExample1\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {},\r\n {}\r\n ]\r\n }\r\n ],\r\n \"http://example.org/structuredExample2\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@id\": \"urn:ngsi-ld:Test:street\",\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": \"Franklinstrasse\"\r\n }\r\n ]\r\n },\r\n {\r\n \"@id\": \"urn:ngsi-ld:Test:number\",\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": 55\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n ],\r\n \"http://example.org/timeExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": \"TODO\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"http://example.org/topLevelExample\": [\r\n {\r\n \"http://example.org/subPropertyExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": 5\r\n }\r\n ]\r\n }\r\n ],\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": 10\r\n }\r\n ]\r\n }\r\n ],\r\n \"http://example.org/trueExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": true\r\n }\r\n ]\r\n }\r\n ],\r\n \"@type\": [\r\n \"urn:ngsi-ld:Test\"\r\n ],\r\n \"http://example.org/uriExample\": [\r\n {\r\n \"@type\": [\r\n \"http://uri.etsi.org/ngsi-ld/Property\"\r\n ],\r\n \"http://uri.etsi.org/ngsi-ld/hasValue\": [\r\n {\r\n \"@value\": \"http://www.example.com\"\r\n }\r\n ]\r\n }\r\n ]\r\n }" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities/", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Queries", + "item": [ + { + "name": "Retrieve specific entity", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/ld+json", + "name": "Content-Type", + "type": "text" + }, + { + "key": "Content-Type", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:A4569", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Vehicle:A4569" + ] + }, + "description": "Retrieve specific entity from kafka" + }, + "response": [] + }, + { + "name": "Retrieve by attribute", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/ld+json", + "type": "text" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?attrs=http://example.org/vehicle/brandName", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "attrs", + "value": "http://example.org/vehicle/brandName" + } + ] + } + }, + "response": [] + }, + { + "name": "Query by id", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?id=urn:ngsi-ld:Vehicle:A4569&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "id", + "value": "urn:ngsi-ld:Vehicle:A4569" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + } + }, + "response": [] + }, + { + "name": "Query by type", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + } + }, + "response": [] + }, + { + "name": "Query by type using Link header", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?type=Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Vehicle" + } + ] + } + }, + "response": [] + }, + { + "name": "Query by idPattern", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?idPattern=urn:ngsi-ld:Vehicle:A.*&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "idPattern", + "value": "urn:ngsi-ld:Vehicle:A.*" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Advanced queries", + "item": [ + { + "name": "Number equal", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=numberExample==100&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "numberExample==100" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "Number greater", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=numberExample>99&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "numberExample>99" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "String equal", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=stringExample==\"Mercedes\"&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "stringExample==\"Mercedes\"" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "String unequal", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=stringExample!=\"Mercedes\"&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "stringExample!=\"Mercedes\"" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "bool false equal", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=falseExample==false&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "falseExample==false" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "bool true equal", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=trueExample==true&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "trueExample==true" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "URI equal", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=uriExample==http://www.example.com&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "uriExample==http://www.example.com" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "URI equal (using String)", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=uriExample==\"http://www.example.com\"&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "uriExample==\"http://www.example.com\"" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "andOp example", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=trueExample==true;numberExample<=130;stringExample==\"Mercedes\"&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "trueExample==true;numberExample<=130;stringExample==\"Mercedes\"" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "AttrPath (property of property)", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=topLevelExample.subPropertyExample>4&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "topLevelExample.subPropertyExample>4" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "AttrPath (relationship of relat...)", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=isParked.providedBy==urn:ngsi-ld:Person:Bob&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "isParked.providedBy==urn:ngsi-ld:Person:Bob" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + }, + { + "name": "AttrPath (4 levels of properties)", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?q=manyLevelsExample.sub1.sub2.sub3==\"D\"&type=urn:ngsi-ld:Test", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "q", + "value": "manyLevelsExample.sub1.sub2.sub3==\"D\"" + }, + { + "key": "type", + "value": "urn:ngsi-ld:Test" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Geoqueries", + "item": [ + { + "name": "Near", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "disabled": true + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=location&georel=near;maxDistance==360&geometry=Point&coordinates=%5B8.684783577919006%2C49.406131991436396%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "near;maxDistance==360" + }, + { + "key": "geometry", + "value": "Point" + }, + { + "key": "coordinates", + "value": "%5B8.684783577919006%2C49.406131991436396%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Get every entity near NEC Labs Heidelberg, with distance up to 360 meters\r\n NEC Labs Heidelberg coordinates: 8.684783577919006, 49.406131991436396" + }, + "response": [] + }, + { + "name": "Near (parkingLotLocation property)", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=parkingLotLocation&georel=near;maxDistance==360&geometry=Point&coordinates=%5B8.684783577919006%2C49.406131991436396%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "parkingLotLocation" + }, + { + "key": "georel", + "value": "near;maxDistance==360" + }, + { + "key": "geometry", + "value": "Point" + }, + { + "key": "coordinates", + "value": "%5B8.684783577919006%2C49.406131991436396%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Testing a property other than \"location\"" + }, + "response": [] + }, + { + "name": "Near minDistance", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=location&georel=near;minDistance==400&geometry=Point&coordinates=%5B8.684783577919006%2C49.406131991436396%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "near;minDistance==400" + }, + { + "key": "geometry", + "value": "Point" + }, + { + "key": "coordinates", + "value": "%5B8.684783577919006%2C49.406131991436396%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Get every entity near NEC Labs Heidelberg, with distance over 400 meters" + }, + "response": [] + }, + { + "name": "Near Polygon", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=location&georel=near;maxDistance==50&geometry=Polygon&coordinates=%5B%5B%5B8.684628009796143%2C49.406062179606515%5D%2C%5B8.685507774353027%2C49.4062262372493%5D%2C%5B8.68545413017273%2C49.40634491690448%5D%2C%5B8.684579730033875%2C49.40617736907259%5D%2C%5B8.684628009796143%2C49.406062179606515%5D%5D%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "near;maxDistance==50" + }, + { + "key": "geometry", + "value": "Polygon" + }, + { + "key": "coordinates", + "value": "%5B%5B%5B8.684628009796143%2C49.406062179606515%5D%2C%5B8.685507774353027%2C49.4062262372493%5D%2C%5B8.68545413017273%2C49.40634491690448%5D%2C%5B8.684579730033875%2C49.40617736907259%5D%2C%5B8.684628009796143%2C49.406062179606515%5D%5D%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Get every entity near NEC building (polygon), with distance up to 360 meters" + }, + "response": [] + }, + { + "name": "Within", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=location&georel=within&geometry=Polygon&coordinates=%5B%5B%5B8.684628009796143%2C49.406062179606515%5D%2C%5B8.685507774353027%2C49.4062262372493%5D%2C%5B8.68545413017273%2C49.40634491690448%5D%2C%5B8.684579730033875%2C49.40617736907259%5D%2C%5B8.684628009796143%2C49.406062179606515%5D%5D%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "within" + }, + { + "key": "geometry", + "value": "Polygon" + }, + { + "key": "coordinates", + "value": "%5B%5B%5B8.684628009796143%2C49.406062179606515%5D%2C%5B8.685507774353027%2C49.4062262372493%5D%2C%5B8.68545413017273%2C49.40634491690448%5D%2C%5B8.684579730033875%2C49.40617736907259%5D%2C%5B8.684628009796143%2C49.406062179606515%5D%5D%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Get every entity within NEC Labs building (polygon) in Heidelberg" + }, + "response": [] + }, + { + "name": "Within MultiPolygon", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=location&georel=within&geometry=MultiPolygon&coordinates=%5B%5B%5B%5B8.686752319335938%2C49.359122687528746%5D%2C%5B8.742027282714844%2C49.3642654834877%5D%2C%5B8.767433166503904%2C49.398462568451485%5D%2C%5B8.768119812011719%2C49.42750021620163%5D%2C%5B8.74305725097656%2C49.44781634951542%5D%2C%5B8.669242858886719%2C49.43754770762113%5D%2C%5B8.63525390625%2C49.41968407776289%5D%2C%5B8.637657165527344%2C49.3995797187007%5D%2C%5B8.663749694824219%2C49.36851347448498%5D%2C%5B8.686752319335938%2C49.359122687528746%5D%5D%5D%2C%5B%5B%5B8.364715576171875%2C48.96939999849952%5D%2C%5B8.47320556640625%2C48.982019588328214%5D%2C%5B8.485565185546875%2C49.017157315497165%5D%2C%5B8.411407470703125%2C49.05677012268616%5D%2C%5B8.33587646484375%2C49.031565622700356%5D%2C%5B8.320770263671875%2C48.98562459864604%5D%2C%5B8.364715576171875%2C48.96939999849952%5D%5D%5D%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "within" + }, + { + "key": "geometry", + "value": "MultiPolygon" + }, + { + "key": "coordinates", + "value": "%5B%5B%5B%5B8.686752319335938%2C49.359122687528746%5D%2C%5B8.742027282714844%2C49.3642654834877%5D%2C%5B8.767433166503904%2C49.398462568451485%5D%2C%5B8.768119812011719%2C49.42750021620163%5D%2C%5B8.74305725097656%2C49.44781634951542%5D%2C%5B8.669242858886719%2C49.43754770762113%5D%2C%5B8.63525390625%2C49.41968407776289%5D%2C%5B8.637657165527344%2C49.3995797187007%5D%2C%5B8.663749694824219%2C49.36851347448498%5D%2C%5B8.686752319335938%2C49.359122687528746%5D%5D%5D%2C%5B%5B%5B8.364715576171875%2C48.96939999849952%5D%2C%5B8.47320556640625%2C48.982019588328214%5D%2C%5B8.485565185546875%2C49.017157315497165%5D%2C%5B8.411407470703125%2C49.05677012268616%5D%2C%5B8.33587646484375%2C49.031565622700356%5D%2C%5B8.320770263671875%2C48.98562459864604%5D%2C%5B8.364715576171875%2C48.96939999849952%5D%5D%5D%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Get every entity within Heidelberg or Karlsruhe ( MultiPolygon )" + }, + "response": [] + }, + { + "name": "Contains", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=location&georel=contains&geometry=Point&coordinates=%5B8.684783577919006%2C49.406131991436396%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "contains" + }, + { + "key": "geometry", + "value": "Point" + }, + { + "key": "coordinates", + "value": "%5B8.684783577919006%2C49.406131991436396%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Get every entity that contains NEC Labs Heidelberg (point)" + }, + "response": [] + }, + { + "name": "Overlaps", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=location&georel=overlaps&geometry=Polygon&coordinates=%5B%5B%5B8.684628009796143%2C49.406062179606515%5D%2C%5B8.685507774353027%2C49.4062262372493%5D%2C%5B8.68545413017273%2C49.40634491690448%5D%2C%5B8.684579730033875%2C49.40617736907259%5D%2C%5B8.684628009796143%2C49.406062179606515%5D%5D%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "overlaps" + }, + { + "key": "geometry", + "value": "Polygon" + }, + { + "key": "coordinates", + "value": "%5B%5B%5B8.684628009796143%2C49.406062179606515%5D%2C%5B8.685507774353027%2C49.4062262372493%5D%2C%5B8.68545413017273%2C49.40634491690448%5D%2C%5B8.684579730033875%2C49.40617736907259%5D%2C%5B8.684628009796143%2C49.406062179606515%5D%5D%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Get every entity that overlaps with NEC Labs building (polygon) in Heidelberg" + }, + "response": [] + }, + { + "name": "Intersects", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=location&georel=overlaps&geometry=Polygon&coordinates=%5B%5B%5B8.684628009796143%2C49.406062179606515%5D%2C%5B8.685507774353027%2C49.4062262372493%5D%2C%5B8.68545413017273%2C49.40634491690448%5D%2C%5B8.684579730033875%2C49.40617736907259%5D%2C%5B8.684628009796143%2C49.406062179606515%5D%5D%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "overlaps" + }, + { + "key": "geometry", + "value": "Polygon" + }, + { + "key": "coordinates", + "value": "%5B%5B%5B8.684628009796143%2C49.406062179606515%5D%2C%5B8.685507774353027%2C49.4062262372493%5D%2C%5B8.68545413017273%2C49.40634491690448%5D%2C%5B8.684579730033875%2C49.40617736907259%5D%2C%5B8.684628009796143%2C49.406062179606515%5D%5D%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Get every entity that intersects with NEC Labs building (polygon) in Heidelberg\r\n Intersects(g1, g2 ) == Not (Disjoint(g1, g2 ))" + }, + "response": [] + }, + { + "name": "Equals", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=location&georel=equals&geometry=Point&coordinates=%5B8.684783577919006%2C49.406131991436396%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "equals" + }, + { + "key": "geometry", + "value": "Point" + }, + { + "key": "coordinates", + "value": "%5B8.684783577919006%2C49.406131991436396%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "get every entity equal to NEC Labs Heidelberg point" + }, + "response": [] + }, + { + "name": "Disjoint", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/entities?geoproperty=location&georel=disjoint&geometry=Polygon&coordinates=%5B%5B%5B8.684628009796143%2C49.406062179606515%5D%2C%5B8.685507774353027%2C49.4062262372493%5D%2C%5B8.68545413017273%2C49.40634491690448%5D%2C%5B8.684579730033875%2C49.40617736907259%5D%2C%5B8.684628009796143%2C49.406062179606515%5D%5D%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "disjoint" + }, + { + "key": "geometry", + "value": "Polygon" + }, + { + "key": "coordinates", + "value": "%5B%5B%5B8.684628009796143%2C49.406062179606515%5D%2C%5B8.685507774353027%2C49.4062262372493%5D%2C%5B8.68545413017273%2C49.40634491690448%5D%2C%5B8.684579730033875%2C49.40617736907259%5D%2C%5B8.684628009796143%2C49.406062179606515%5D%5D%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "get entities that do not share any space together with NEC Labs Heidelberg building" + }, + "response": [] + } + ] + }, + { + "name": "CSource", + "item": [ + { + "name": "CSource queries", + "item": [ + { + "name": "Query by type", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "disabled": true + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/csourceRegistrations?type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "csourceRegistrations" + ], + "query": [ + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Get every entity near NEC Labs Heidelberg, with distance up to 360 meters\r\n NEC Labs Heidelberg coordinates: 8.684783577919006, 49.406131991436396" + }, + "response": [] + }, + { + "name": "Query by type using Link header", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/csourceRegistrations?type=Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "csourceRegistrations" + ], + "query": [ + { + "key": "type", + "value": "Vehicle" + } + ] + } + }, + "response": [] + }, + { + "name": "Query by type+id", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/csourceRegistrations?id=urn:ngsi-ld:Vehicle:C1234&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "csourceRegistrations" + ], + "query": [ + { + "key": "id", + "value": "urn:ngsi-ld:Vehicle:C1234" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + } + }, + "response": [] + }, + { + "name": "Query by type+idPattern", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/csourceRegistrations?idPattern=urn:ngsi-ld:Vehicle:C.*&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "csourceRegistrations" + ], + "query": [ + { + "key": "idPattern", + "value": "urn:ngsi-ld:Vehicle:C.*" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + } + }, + "response": [] + }, + { + "name": "Geoquery Near min", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "disabled": true + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/csourceRegistrations?geoproperty=location&georel=near;minDistance==8000&geometry=Polygon&coordinates=%5B%20%5B%20%5B%208.400421142578125%2C%2049.32333182991094%20%5D%2C%20%5B%208.812408447265625%2C%2049.32333182991094%20%5D%2C%20%5B%208.812408447265625%2C%2049.49489061140408%20%5D%2C%20%5B%208.400421142578125%2C%2049.49489061140408%20%5D%2C%20%5B%208.400421142578125%2C%2049.32333182991094%20%5D%20%5D%20%5D&type=http://example.org/vehicle/Vehicle", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "csourceRegistrations" + ], + "query": [ + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "near;minDistance==8000" + }, + { + "key": "geometry", + "value": "Polygon" + }, + { + "key": "coordinates", + "value": "%5B%20%5B%20%5B%208.400421142578125%2C%2049.32333182991094%20%5D%2C%20%5B%208.812408447265625%2C%2049.32333182991094%20%5D%2C%20%5B%208.812408447265625%2C%2049.49489061140408%20%5D%2C%20%5B%208.400421142578125%2C%2049.49489061140408%20%5D%2C%20%5B%208.400421142578125%2C%2049.32333182991094%20%5D%20%5D%20%5D" + }, + { + "key": "type", + "value": "http://example.org/vehicle/Vehicle" + } + ] + }, + "description": "Get every entity near NEC Labs Heidelberg, with distance up to 360 meters\r\n NEC Labs Heidelberg coordinates: 8.684783577919006, 49.406131991436396" + }, + "response": [] + } + ] + }, + { + "name": "Create csource with Link header", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"urn:ngsi-ld:ContextSourceRegistration:csr1a3458\",\r\n \"type\": \"ContextSourceRegistration\",\r\n \"name\": \"NameExample\",\r\n \"description\": \"DescriptionExample\",\r\n \"information\": [\r\n {\r\n \"entities\": [\r\n {\r\n \"id\": \"urn:ngsi-ld:Vehicle:A456\",\r\n \"type\": \"Vehicle\"\r\n }\r\n ],\r\n \"properties\": [\r\n \"brandName\",\r\n \"speed\"\r\n ],\r\n \"relationships\": [\r\n \"isParked\"\r\n ]\r\n },\r\n {\r\n \"entities\": [\r\n {\r\n \"idPattern\": \".*downtown$\",\r\n \"type\": \"OffStreetParking\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"endpoint\": \"http://my.csource.org:1026\",\r\n \"location\": \"{ \\\"type\\\": \\\"Polygon\\\", \\\"coordinates\\\": [[[8.686752319335938,49.359122687528746],[8.742027282714844,49.3642654834877],[8.767433166503904,49.398462568451485],[8.768119812011719,49.42750021620163],[8.74305725097656,49.44781634951542],[8.669242858886719,49.43754770762113],[8.63525390625,49.41968407776289],[8.637657165527344,49.3995797187007],[8.663749694824219,49.36851347448498],[8.686752319335938,49.359122687528746]]] }\",\r\n \"timestamp\": {\r\n \"start\": \"2017-11-29T14:53:15\"\r\n },\r\n \"expires\": \"2030-11-29T14:53:15\"\r\n}" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/csourceRegistrations/", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "csourceRegistrations", + "" + ] + } + }, + "response": [] + }, + { + "name": "Create csource with context in payload", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"urn:ngsi-ld:ContextSourceRegistration:csr1a3458\",\r\n \"type\": \"ContextSourceRegistration\",\r\n \"name\": \"NameExample\",\r\n \"description\": \"DescriptionExample\",\r\n \"information\": [\r\n {\r\n \"entities\": [\r\n {\r\n \"id\": \"urn:ngsi-ld:Vehicle:A456\",\r\n \"type\": \"Vehicle\"\r\n }\r\n ],\r\n \"properties\": [\r\n \"brandName\",\r\n \"speed\"\r\n ],\r\n \"relationships\": [\r\n \"isParked\"\r\n ]\r\n },\r\n {\r\n \"entities\": [\r\n {\r\n \"idPattern\": \".*downtown$\",\r\n \"type\": \"OffStreetParking\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"endpoint\": \"http://192.168.178.42:3000\",\r\n \"location\": \"{ \\\"type\\\": \\\"Polygon\\\", \\\"coordinates\\\": [[[8.686752319335938,49.359122687528746],[8.742027282714844,49.3642654834877],[8.767433166503904,49.398462568451485],[8.768119812011719,49.42750021620163],[8.74305725097656,49.44781634951542],[8.669242858886719,49.43754770762113],[8.63525390625,49.41968407776289],[8.637657165527344,49.3995797187007],[8.663749694824219,49.36851347448498],[8.686752319335938,49.359122687528746]]] }\",\r\n \"timestamp\": {\r\n \"start\": \"2017-11-29T14:53:15\"\r\n },\r\n \"expires\": \"2030-11-29T14:53:15\",\r\n\"@context\": [\r\n\r\n\t\"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.jsonld\", \r\n {\r\n \"Vehicle\": \"http://example.org/vehicle/Vehicle\",\r\n \"brandName\": \"http://example.org/vehicle/brandName\",\r\n \"brandName1\": \"http://example.org/vehicle/brandName1\",\r\n \"speed\": \"http://example.org/vehicle/speed\",\r\n \"totalSpotNumber\": \"http://example.org/parking/totalSpotNumber\",\r\n \"reliability\": \"http://example.org/common/reliability\",\r\n \"OffStreetParking\": \"http://example.org/parking/OffStreetParking\", \r\n \"availableSpotNumber\": \"http://example.org/parking/availableSpotNumber\",\r\n \"timestamp\": \"http://uri.etsi.org/ngsi-ld/timestamp\",\r\n \"isParked\": {\r\n \"@type\": \"@id\",\r\n \"@id\": \"http://example.org/common/isParked\"\r\n },\r\n \"isNextToBuilding\": { \r\n \"@type\": \"@id\", \r\n \"@id\": \"http://example.org/common/isNextToBuilding\" \r\n }, \r\n \"providedBy\": { \r\n \"@type\": \"@id\", \r\n \"@id\": \"http://example.org/common/providedBy\" \r\n }, \r\n \"name\": \"http://example.org/common/name\" \r\n}\r\n]\r\n}\r\n" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/csourceRegistrations/", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "csourceRegistrations", + "" + ] + } + }, + "response": [] + }, + { + "name": "update csource", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "name": "Content-Type", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"urn:ngsi-ld:ContextSourceRegistration:csr1a3458\",\r\n \"type\": \"ContextSourceRegistration\",\r\n \"name\": \"NameExample\",\r\n \"description\": \"DescriptionExample\",\r\n \"information\": [\r\n {\r\n \"entities\": [\r\n {\r\n \"id\": \"urn:ngsi-ld:Vehicle:A456\",\r\n \"type\": \"Vehicle\"\r\n }\r\n ],\r\n \"properties\": [\r\n \"brandName\",\r\n \"speed\",\r\n \"brandName1\"\r\n ],\r\n \"relationships\": [\r\n \"isParked\"\r\n ]\r\n },\r\n {\r\n \"entities\": [\r\n {\r\n \"idPattern\": \".*downtown$\",\r\n \"type\": \"OffStreetParking\"\r\n }\r\n ]\r\n }\r\n ],\r\n \"endpoint\": \"http://my.csource.org:1026\",\r\n \"location\": \"{ \\\"type\\\": \\\"Polygon\\\", \\\"coordinates\\\": [[[8.686752319335938,49.359122687528746],[8.742027282714844,49.3642654834877],[8.767433166503904,49.398462568451485],[8.768119812011719,49.42750021620163],[8.74305725097656,49.44781634951542],[8.669242858886719,49.43754770762113],[8.63525390625,49.41968407776289],[8.637657165527344,49.3995797187007],[8.663749694824219,49.36851347448498],[8.686752319335938,49.359122687528746]]] }\",\r\n \"timestamp\": {\r\n \"start\": \"2017-11-29T14:53:15\"\r\n },\r\n \"expires\": \"2030-11-29T14:53:15\",\r\n\"@context\": [\r\n\r\n \"https://forge.etsi.org/gitlab/NGSI-LD/NGSI-LD/raw/master/coreContext/ngsi-ld-core-context.jsonld\", \r\n {\r\n \"Vehicle\": \"http://example.org/vehicle/Vehicle\",\r\n \"brandName\": \"http://example.org/vehicle/brandName\",\r\n \"brandName1\": \"http://example.org/vehicle/brandName1\",\r\n \"speed\": \"http://example.org/vehicle/speed\",\r\n \"totalSpotNumber\": \"http://example.org/parking/totalSpotNumber\",\r\n \"reliability\": \"http://example.org/common/reliability\",\r\n \"OffStreetParking\": \"http://example.org/parking/OffStreetParking\", \r\n \"availableSpotNumber\": \"http://example.org/parking/availableSpotNumber\", \r\n \"isParked\": {\r\n \"@type\": \"@id\",\r\n \"@id\": \"http://example.org/common/isParked\"\r\n },\r\n \"isNextToBuilding\": { \r\n \"@type\": \"@id\", \r\n \"@id\": \"http://example.org/common/isNextToBuilding\" \r\n }, \r\n \"providedBy\": { \r\n \"@type\": \"@id\", \r\n \"@id\": \"http://example.org/common/providedBy\" \r\n }, \r\n \"name\": \"http://example.org/common/name\",\r\n \"timestamp\": \"http://uri.etsi.org/ngsi-ld/timestamp\",\r\n \"expires\":\"http://uri.etsi.org/ngsi-ld/expires\"\r\n}\r\n]\r\n}\r\n" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:csr1a3458", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "csourceRegistrations", + "urn:ngsi-ld:ContextSourceRegistration:csr1a3458" + ] + }, + "description": "update attribute in csource" + }, + "response": [] + }, + { + "name": "delete csource", + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:csr1a3458", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "csourceRegistrations", + "urn:ngsi-ld:ContextSourceRegistration:csr1a3458" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Subscription", + "item": [ + { + "name": "Create subscription with link header", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json", + "name": "Content-Type", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"type\": \"Subscription\",\r\n\t\"entities\": [{\r\n\t\t\"idPattern\": \".*\",\r\n\t\t\"type\": \"Vehicle\"\r\n\t}],\r\n\t\"watchedAttributes\": [\"brandName\"],\r\n\t\"notification\": {\r\n\t\t\"attributes\": [\"brandName\"],\r\n\t\t\"format\": \"keyValues\",\r\n\t\t\"endpoint\": {\r\n\t\t\t\"uri\": \"http://my.endpoint.org/notify\",\r\n\t\t\t\"accept\": \"application/json\"\r\n\t\t}\r\n\t}\r\n}" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/subscriptions/", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "subscriptions", + "" + ] + }, + "description": "create subscription with context in payload" + }, + "response": [] + }, + { + "name": "Query all subscriptions", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/ld+json", + "type": "text" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/subscriptions/", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "subscriptions", + "" + ] + }, + "description": "for retreiving specific subscription" + }, + "response": [] + }, + { + "name": "Retrieve specific subscription", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/ld+json", + "type": "text" + } + ], + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/subscriptions/urn:ngsi-ld:Subscription:71", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "subscriptions", + "urn:ngsi-ld:Subscription:71" + ] + } + }, + "response": [] + }, + { + "name": "Update subscription", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json", + "name": "Content-Type", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "\t{\r\n\t \"id\": \"urn:ngsi-ld:Subscription:7\",\r\n\t \"type\": \"Subscription\",\r\n\t \"entities\": [{\r\n\t \"type\": \"Vehicle\"\r\n\t }],\r\n\t \"watchedAttributes\": [\"http://example.org/vehicle/brandName2\"],\r\n\t \"q\":\"http://example.org/vehicle/brandName2!=Mercedes\",\r\n\t \"notification\": {\r\n\t \"attributes\": [\"http://example.org/vehicle/brandName2\"],\r\n\t \"format\": \"keyValues\",\r\n\t \"endpoint\": {\r\n\t \"uri\": \"http://my.endpoint.org/notify\",\r\n\t\r\n\t \"accept\": \"application/json\"\r\n\t }\r\n\t }\r\n\t}" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/subscriptions/urn:ngsi-ld:Subscription:7", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "subscriptions", + "urn:ngsi-ld:Subscription:7" + ] + } + }, + "response": [] + }, + { + "name": "Delete subscription", + "request": { + "method": "DELETE", + "header": [], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{gatewayServer}}/ngsi-ld/v1/subscriptions/urn:ngsi-ld:Subscription:7", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "ngsi-ld", + "v1", + "subscriptions", + "urn:ngsi-ld:Subscription:7" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "keycloak", + "item": [ + { + "name": "keycloak token", + "request": { + "method": "POST", + "header": [ + { + "key": "", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "grant_type", + "value": "password", + "type": "text" + }, + { + "key": "client_id", + "value": "entity-manager", + "type": "text" + }, + { + "key": "client_secret", + "value": "e5316290-51f0-4eeb-9c05-2c6c908f991e", + "type": "text" + }, + { + "key": "username", + "value": "test", + "type": "text" + }, + { + "key": "password", + "value": "test", + "type": "text" + } + ] + }, + "url": { + "raw": "http://keycloak-http.oisp.svc.cluster.local:4080/keycloak/realms/org/protocol/openid-connect/token", + "protocol": "http", + "host": [ + "keycloak-http", + "oisp", + "svc", + "cluster", + "local" + ], + "port": "4080", + "path": [ + "keycloak", + "realms", + "org", + "protocol", + "openid-connect", + "token" + ] + } + }, + "response": [] + }, + { + "name": "keycloak token query-manager", + "request": { + "method": "POST", + "header": [ + { + "key": "", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "grant_type", + "value": "password", + "type": "text" + }, + { + "key": "client_id", + "value": "entity-manager", + "type": "text" + }, + { + "key": "client_secret", + "value": "e5316290-51f0-4eeb-9c05-2c6c908f991e", + "type": "text" + }, + { + "key": "username", + "value": "test", + "type": "text" + }, + { + "key": "password", + "value": "test", + "type": "text" + } + ] + }, + "url": { + "raw": "http://keycloak-http.oisp.svc.cluster.local:4080/keycloak/realms/org/protocol/openid-connect/token", + "protocol": "http", + "host": [ + "keycloak-http", + "oisp", + "svc", + "cluster", + "local" + ], + "port": "4080", + "path": [ + "keycloak", + "realms", + "org", + "protocol", + "openid-connect", + "token" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Microservice status", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{RegistryServer}}", + "host": [ + "{{RegistryServer}}" + ] + } + }, + "response": [] + }, + { + "name": "API Gateway", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{gatewayServer}}/actuator/health", + "host": [ + "{{gatewayServer}}" + ], + "path": [ + "actuator", + "health" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/wiki/API/image1.png b/wiki/API/image1.png new file mode 100644 index 00000000..ff6df819 Binary files /dev/null and b/wiki/API/image1.png differ diff --git a/wiki/API/image2.png b/wiki/API/image2.png new file mode 100644 index 00000000..18bdfc82 Binary files /dev/null and b/wiki/API/image2.png differ diff --git a/wiki/API/image3.png b/wiki/API/image3.png new file mode 100644 index 00000000..f695d794 Binary files /dev/null and b/wiki/API/image3.png differ diff --git a/wiki/API/image4.png b/wiki/API/image4.png new file mode 100644 index 00000000..4ad4aa78 Binary files /dev/null and b/wiki/API/image4.png differ diff --git a/wiki/API/image5.png b/wiki/API/image5.png new file mode 100644 index 00000000..d6905f59 Binary files /dev/null and b/wiki/API/image5.png differ diff --git a/wiki/API/image6.png b/wiki/API/image6.png new file mode 100644 index 00000000..7fc87469 Binary files /dev/null and b/wiki/API/image6.png differ diff --git a/wiki/API/image7.png b/wiki/API/image7.png new file mode 100644 index 00000000..de2b8372 Binary files /dev/null and b/wiki/API/image7.png differ diff --git a/wiki/API/image8.png b/wiki/API/image8.png new file mode 100644 index 00000000..fb8ba020 Binary files /dev/null and b/wiki/API/image8.png differ diff --git a/wiki/API/keycloak.postman_collection.json b/wiki/API/keycloak.postman_collection.json new file mode 100644 index 00000000..57517600 --- /dev/null +++ b/wiki/API/keycloak.postman_collection.json @@ -0,0 +1,336 @@ +{ + "info": { + "_postman_id": "5f47704a-53b2-48f7-afbf-60244153f69c", + "name": "keycloak", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "29168847", + "_collection_link": "https://red-meadow-9044-1.postman.co/workspace/My-Workspace~70c949dc-6684-4820-85df-5718362b357e/collection/20295401-5f47704a-53b2-48f7-afbf-60244153f69c?action=share&source=collection_link&creator=29168847" + }, + "item": [ + { + "name": "keycloak Copy", + "item": [ + { + "name": "Device Onboarding", + "item": [ + { + "name": "Create onboarding token", + "request": { + "method": "POST", + "header": [ + { + "key": "X-GatewayID", + "value": "gatewayid", + "type": "text", + "disabled": true + }, + { + "key": "X-DeviceID", + "value": "deviceidxx", + "type": "text", + "disabled": true + }, + { + "key": "X-DeviceUID", + "value": "uid", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "grant_type", + "value": "password", + "type": "text" + }, + { + "key": "client_id", + "value": "device-onboarding", + "type": "text" + }, + { + "key": "client_secret", + "value": "g5mazZJStwUpJGyochsHQC3kS7gnwycA", + "type": "text", + "disabled": true + }, + { + "key": "subject_token", + "value": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI5Wk8zTXlHZ0dnZUh6NS11WDJZUWtTWG5nOFB4NlBzWTlpeWdpaE5ZSzQ4In0.eyJleHAiOjE3MDIyMTUyNTgsImlhdCI6MTcwMjIxMTY1OCwianRpIjoiYjVkMGQxOTEtZjliMi00NDBiLWI3ZGItNzVkYzYxZGZiMzFjIiwiaXNzIjoiaHR0cDovL2tleWNsb2FrLmxvY2FsL2F1dGgvcmVhbG1zL2lmZiIsInN1YiI6IjU0MmY5MmJiLTZmN2MtNDg1Yy1iYjIxLThlM2RhMWViMWQ4NyIsInR5cCI6IkJlYXJlciIsImF6cCI6ImRldmljZS1vbmJvYXJkaW5nIiwic2Vzc2lvbl9zdGF0ZSI6ImM3YjdiYWVhLWI4NzQtNDU2YS1iMjU3LWQ1ZWYwZWJmOWI0NyIsInNjb3BlIjoiIiwic2lkIjoiYzdiN2JhZWEtYjg3NC00NTZhLWIyNTctZDVlZjBlYmY5YjQ3In0.danM0KVU-OPpe161EO3iDYWWzfXcpQSK_6Ne9dVj9XhJHpUvpcUQObn73zJ9pwrwTqZ4Pt8JvqjdxjWJyDtE2MauecyEIBLoMnKRULwFd04h4SjOpnzmHSNaPk7-G8aCI0ay0OT34XEaqskI6nGR0PXtM2Evb01sQWPsrozxv5wo0D-JpVgvF9q7TLIswcYtyPFQQOrcC_BCy0ySK2BxPgdauaNjNcporj2aCfifSKivzcHOYvHHOQR_Uk3qDqlQGEslklv6ogDtBThwwy6kVbLMbuaIL8VMkvsdiZsrY-W-vZmpvrRxBSmrGrpFUkmRwMGupvfvMirz4wJrVHmswQ", + "type": "text", + "disabled": true + }, + { + "key": "password", + "value": "{{user-password}}", + "type": "text" + }, + { + "key": "requested_token_type", + "value": "urn:ietf:params:oauth:token-type:refresh_token", + "type": "text", + "disabled": true + }, + { + "key": "audience", + "value": "device", + "type": "text", + "disabled": true + }, + { + "key": "username", + "value": "realm_user", + "type": "text" + }, + { + "key": "scope", + "value": "device_id", + "type": "text", + "disabled": true + } + ] + }, + "url": { + "raw": "{{keycloak}}/auth/realms/iff/protocol/openid-connect/token", + "host": [ + "{{keycloak}}" + ], + "path": [ + "auth", + "realms", + "iff", + "protocol", + "openid-connect", + "token" + ] + } + }, + "response": [] + }, + { + "name": "refresh device token", + "request": { + "method": "POST", + "header": [ + { + "key": "X-GatewayID", + "value": "gatewayid", + "type": "text" + }, + { + "key": "X-DeviceID", + "value": "deviceidxx", + "type": "text" + }, + { + "key": "X-DeviceUID", + "value": "uid", + "type": "text" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "grant_type", + "value": "refresh_token", + "type": "text" + }, + { + "key": "client_id", + "value": "device-onboarding", + "type": "text" + }, + { + "key": "client_secret", + "value": "g5mazZJStwUpJGyochsHQC3kS7gnwycA", + "type": "text", + "disabled": true + }, + { + "key": "refresh_token", + "value": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJlMzYxMmIxMS1kMzQ1LTQ0M2YtYjkwOC1jYjljNjViNTQzMjkifQ.eyJpYXQiOjE3MDIyMzkwMzgsImp0aSI6IjZkNGM2OTNjLWNjMzAtNGE3Yy1iOWYxLTVjMGQ2NDJhNzczNCIsImlzcyI6Imh0dHA6Ly9rZXljbG9hay5sb2NhbC9hdXRoL3JlYWxtcy9pZmYiLCJhdWQiOiJodHRwOi8va2V5Y2xvYWsubG9jYWwvYXV0aC9yZWFsbXMvaWZmIiwic3ViIjoiNTQyZjkyYmItNmY3Yy00ODVjLWJiMjEtOGUzZGExZWIxZDg3IiwidHlwIjoiT2ZmbGluZSIsImF6cCI6ImRldmljZS1vbmJvYXJkaW5nIiwic2Vzc2lvbl9zdGF0ZSI6IjdjN2JiYTMyLWY2Y2QtNGY5NS05YmM4LThiYTdlMjVjMWMxMCIsInNjb3BlIjoib2lzcC1mcm9udGVuZCBhY2NvdW50cyBkZXZpY2VfaWQgZ2F0ZXdheSBtcXR0LWJyb2tlciBvZmZsaW5lX2FjY2VzcyB0eXBlIiwic2lkIjoiN2M3YmJhMzItZjZjZC00Zjk1LTliYzgtOGJhN2UyNWMxYzEwIn0.piz46Xk3ObDZZ_WoP7HJDQuhDYFPMFAXePs0y1QmvN4", + "type": "text" + }, + { + "key": "password", + "value": "{{user-password}}", + "type": "text", + "disabled": true + }, + { + "key": "requested_token_type", + "value": "urn:ietf:params:oauth:token-type:refresh_token", + "type": "text", + "disabled": true + }, + { + "key": "audience", + "value": "device", + "type": "text" + } + ] + }, + "url": { + "raw": "{{keycloak}}/auth/realms/iff/protocol/openid-connect/token", + "host": [ + "{{keycloak}}" + ], + "path": [ + "auth", + "realms", + "iff", + "protocol", + "openid-connect", + "token" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "keycloak token IFF SA", + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "grant_type", + "value": "client_credentials", + "type": "text" + }, + { + "key": "client_id", + "value": "ngsild-updates", + "type": "text" + }, + { + "key": "client_secret", + "value": "rOmAzzVVMz1pqaW58C7sgpMFrtmA9wLk", + "type": "text" + }, + { + "key": "username", + "value": "realm_user", + "type": "text", + "disabled": true + }, + { + "key": "password", + "value": "test", + "type": "text", + "disabled": true + } + ] + }, + "url": { + "raw": "http://keycloak.local/auth/realms/iff/protocol/openid-connect/token", + "protocol": "http", + "host": [ + "keycloak", + "local" + ], + "path": [ + "auth", + "realms", + "iff", + "protocol", + "openid-connect", + "token" + ] + } + }, + "response": [] + }, + { + "name": "keycloak token IFF User", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "pm.globals.set(\"token\", jsonData.access_token);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "grant_type", + "value": "password", + "type": "text" + }, + { + "key": "client_id", + "value": "scorpio", + "type": "text" + }, + { + "key": "client_secret", + "value": "g5mazZJStwUpJGyochsHQC3kS7gnwycA", + "type": "text", + "disabled": true + }, + { + "key": "username", + "value": "realm_user", + "type": "text" + }, + { + "key": "password", + "value": "{{user-password}}", + "type": "text" + } + ] + }, + "url": { + "raw": "{{keycloak}}/auth/realms/iff/protocol/openid-connect/token", + "host": [ + "{{keycloak}}" + ], + "path": [ + "auth", + "realms", + "iff", + "protocol", + "openid-connect", + "token" + ] + } + }, + "response": [] + } + ] + } + ] +} \ No newline at end of file diff --git a/wiki/API/pgrest.postman_collection.json b/wiki/API/pgrest.postman_collection.json new file mode 100644 index 00000000..a8a8e49a --- /dev/null +++ b/wiki/API/pgrest.postman_collection.json @@ -0,0 +1,94 @@ +{ + "info": { + "_postman_id": "b801e165-3e19-435c-a1f8-98c0fed594d1", + "name": "pgrest", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "29168847", + "_collection_link": "https://red-meadow-9044-1.postman.co/workspace/My-Workspace~70c949dc-6684-4820-85df-5718362b357e/collection/29168847-b801e165-3e19-435c-a1f8-98c0fed594d1?action=share&source=collection_link&creator=29168847" + }, + "item": [ + { + "name": "get datapoint", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{pgresturl}}/entityhistory?limit=10&order=observedAt.desc,attributeId.asc", + "host": [ + "{{pgresturl}}" + ], + "path": [ + "entityhistory" + ], + "query": [ + { + "key": "limit", + "value": "10" + }, + { + "key": "order", + "value": "observedAt.desc,attributeId.asc" + } + ] + } + }, + "response": [] + }, + { + "name": "aggregate", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "pgrest.local/entityhistory?limit=20&order=observedAt.desc,attributeId.asc&select=value.count()", + "host": [ + "pgrest", + "local" + ], + "path": [ + "entityhistory" + ], + "query": [ + { + "key": "limit", + "value": "20" + }, + { + "key": "order", + "value": "observedAt.desc,attributeId.asc" + }, + { + "key": "select", + "value": "value.count()" + } + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file