Browse Source

revisione IBM data point

fabio 2 months ago
parent
commit
08962b4a1b
3 changed files with 95 additions and 51 deletions
  1. 2 0
      README.md
  2. 0 0
      panorama.html
  3. 93 51
      panorama.yaml

+ 2 - 0
README.md

@@ -0,0 +1,2 @@
+# Repository temporaneo per progetto integrazioni Panorama
+

File diff suppressed because it is too large
+ 0 - 0
panorama.html


+ 93 - 51
panorama.yaml

@@ -38,8 +38,8 @@ tags:
     description: operations for data types
   - name: Entity
     description: operations to browse and manage entities
-  - name: Device
-    description: Operations about Devices
+  - name: DataPoint
+    description: Operations about the Data Point
 paths:
   /type:
     get:
@@ -417,10 +417,10 @@ paths:
         '404':
           description: Entità non trovata
 
-  /entity/{id}/device:
+  /entity/{id}/dataPoint:
     get:
-      summary: Ottiene il device associato a un'entità
-      operationId: getEntityDevice
+      summary: Ottiene il data point associato a un'entità
+      operationId: getEntityDataPoint
       tags: [Entity]
       parameters:
         - in: path
@@ -430,13 +430,13 @@ paths:
             type: string
       responses:
         '200':
-          description: Device trovato
+          description: Data Point trovato
           content:
             application/json:
               schema:
-                $ref: '#/components/schemas/Device'
+                $ref: '#/components/schemas/DataPoint'
         '404':
-          description: Device associato a Entità non trovato
+          description: Data Point associato a Entità non trovato
 
 
   /state/{id}:
@@ -495,10 +495,10 @@ paths:
         '404':
           description: Entità non trovata
 
-  /device:
+  /dataPoint:
     get:
       summary: Elenco di tutti i dispositivi
-      tags: [Device]
+      tags: [DataPoint]
       responses:
         '200':
           description: Lista di dispositivi
@@ -507,12 +507,12 @@ paths:
               schema:
                 type: array
                 items:
-                  $ref: '#/components/schemas/Device'
+                  $ref: '#/components/schemas/DataPoint'
 
-  /device/{id}:
+  /dataPoint/{id}:
     get:
       summary: Ottiene informazioni su un singolo dispositivo
-      tags: [Device]
+      tags: [DataPoint]
       parameters:
         - in: path
           name: id
@@ -525,16 +525,47 @@ paths:
           content:
             application/json:
               schema:
-                $ref: '#/components/schemas/Device'
+                $ref: '#/components/schemas/DataPoint'
         '404':
           description: Dispositivo non trovato
           
-		  
-  /device/{id}/measures:
+  /dataPoint/measures:
     get:
-      summary: Ottiene tutte le misure di un device
-      tags: [Device]
+      summary: Ottiene tutte le misure in un range di date
+      tags: [DataPoint]
       operationId: getMeasures
+      parameters:       
+        - name: measurement_date_from
+          in: query
+          description: Filter by measurement date (from)
+          required: false
+          explode: true
+          schema:
+            type: string
+            format: date-time
+        - name: measurement_date_to
+          in: query
+          description: Filter by measurement date (to)
+          required: false
+          explode: true
+          schema:
+            type: string
+            format: date-time
+      responses:
+        '200':
+          description: Lista delle misure
+          content:
+            application/json:
+              schema:
+                type: array
+                items:
+                  $ref: '#/components/schemas/Measure'
+
+  /dataPoint/{id}/measures:
+    get:
+      summary: Ottiene tutte le misure da un Data Point
+      tags: [DataPoint]
+      operationId: getMeasuresByDataPoint
       parameters:       
         - in: path
           name: id
@@ -567,11 +598,11 @@ paths:
                 items:
                   $ref: '#/components/schemas/Measure'
                   
-  /device/{id}/last:
+  /dataPoint/{id}/measures/last:
     get:
-      summary: Ottieni ultima misura da un POD
-      tags: [Device]
-      operationId: getMeasureByPod
+      summary: Ottieni ultima misura da un data point
+      tags: [DataPoint]
+      operationId: getMeasureByDataPoint
       parameters:      
         - name: id
           in: path
@@ -592,7 +623,7 @@ paths:
     get:
       summary: Restituisce un singolo tipo di misura
       operationId: getMeasurementTypeById
-      tags: [Device]
+      tags: [DataPoint]
       parameters:
         - in: path
           name: id
@@ -611,7 +642,7 @@ paths:
           
     put:
       summary: Modifica un tipo di misura esistente (admin only)
-      tags: [Device]
+      tags: [DataPoint]
       security:
         - panorama_administrator_api_key: []
       parameters:
@@ -636,7 +667,7 @@ paths:
 
     delete:
       summary: Elimina un tipo di misura esistente (admin only)
-      tags: [Device]
+      tags: [DataPoint]
       security:
         - panorama_administrator_api_key: []
       parameters:
@@ -654,7 +685,7 @@ paths:
   /measurementType:
     get:
       summary: Restituisce tutti i tipi di misura definiti
-      tags: [Device]
+      tags: [DataPoint]
       operationId: getMeasurementTypes
       responses:
         '200':
@@ -667,7 +698,7 @@ paths:
                   $ref: '#/components/schemas/MeasurementType'
     post:
       summary: Crea un nuovo tipo di misura (admin only)
-      tags: [Device]
+      tags: [DataPoint]
       security:
         - panorama_administrator_api_key: []
       requestBody:
@@ -794,7 +825,7 @@ components:
 
     Entity:
       type: object
-      description: rappresenta un generico oggetto urbano, è di uno specifico Tipo, afferisce a una Sorgente Dati, ha uno Stato dinamico, è dotato di proprietà type-specific, può avere un Device associato, è tipicamente geo-localizzabile
+      description: rappresenta un generico oggetto urbano, è di uno specifico Tipo, afferisce a una Sorgente Dati, ha uno Stato dinamico, è dotato di proprietà type-specific, può avere un DataPoint associato, è tipicamente geo-localizzabile
       required: [id, type, source, createdDate, updatedDate]
       properties:
         id:
@@ -859,9 +890,9 @@ components:
           additionalProperties: true
           examples: 
             - { chiusura: 'Lunedì|Giovedì|Domenica' }
-        device:
-          description: Device associato all'entità
-          $ref: '#/components/schemas/Device'
+        dataPoint:
+          description: DataPoint associato all'entità
+          $ref: '#/components/schemas/DataPoint'
         createdDate:
           type: string
           format: date-time
@@ -917,42 +948,50 @@ components:
             - 'Regione autonoma Friuli Venezia Giulia'
       required: [id, name, organization, internal]
 
-    Device:
+    DataPoint:
       type: object
-      description: Dispositivo IoT gestito nativamente in piattaforma
+      description: Dispositivo IoT installato su un Data Point gestito nativamente in piattaforma
       required: [id, fk_firmware_id, fk_tenant_code, fk_device_service_id, created_date, updated_date]
       properties:
         id:
           type: string
           format: uri
-          description: Identificativo univoco del dispositivo
+          description: Identificativo univoco del data point
         serial:
           type: string
-          description: Seriale del dispositivo
-        fk_firmware_id:
-          type: string
-          format: uri
-          description: Identificativo univoco del firmware del dispositivo   
+          description: Seriale del dispositivo installato sul data point 
         fk_tenant_code:
           type: string
           format: uri
           description: Identificativo univoco del tenant appartenente il dispositivo
-        fk_device_service_id:
+        fk_service_id:
           type: string
           format: uri
-          description: Identificativo univoco del servizio          
-        decrypt_key:
+          description: Identificativo univoco del servizio 
+        gps_latitude:
+          type: number
+          format: double
+          minimum: -90
+          maximum: 90
+          description: coordinate gps della latitudine   
+        gps_longitude:
+          type: number
+          format: double
+          minimum: -90
+          maximum: 90
+          description: coordinate gps della logitudine                
+        street:
           type: string
-          description: Chiave di decrypting del dispositivo
-        auth_key:
+          description: via del data point        
+        street_number:
           type: string
-          description: Chiave di authentication del dispositivo 
-        logical_device_name:
+          description: numero civico del data point  
+        city:
           type: string
-          description: Logical device name del dispositivo     
-        mac_address:
+          description: citta del data point            
+        postal_code:
           type: string
-          description: Mac address del dispositivo          
+          description: cap del data point                       
         createdDate:
           type: string
           format: date-time
@@ -961,7 +1000,6 @@ components:
           type: string
           format: date-time
           description: Ultimo aggiornamento
-
     Measure:
       type: object
       properties:
@@ -969,6 +1007,9 @@ components:
           type: integer
           format: int64
           description: Identificazione univoca della misura
+        data_point:
+          type: string
+          description: Data point dove è installato il dispositivo         
         serial:
           type: string
           description: Seriale del dispositivo
@@ -1019,7 +1060,8 @@ components:
           $ref: '#/components/schemas/Payload'        
       required:
         - id
-        - deviceId
+        - serial
+        - data_point
         - measure_date
         - measure_name
         - measure_value

Some files were not shown because too many files changed in this diff