UI Server: add WS Insomnia requests collection
[e-mobility-charging-stations-simulator.git] / README.md
index 562a1ba493d13b1c4d4e5068756dd29c26efe79b..637f20da0494dc5c33baa3c19569386ee12d0c76 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
 
 ## Summary
 
-Simple [node.js](https://nodejs.org/) software to simulate a set of charging stations based on the OCPP-J 1.6 protocol as part of SAP e-Mobility solution.
+Simple [node.js](https://nodejs.org/) software to simulate and scale a set of charging stations based on the OCPP-J 1.6 protocol as part of SAP e-Mobility solution.
 
 ## Prerequisites
 
@@ -310,7 +310,7 @@ make SUBMODULES_INIT=true
 - :white_check_mark: ChangeAvailability
 - :white_check_mark: ChangeConfiguration
 - :white_check_mark: ClearCache
-- :x: DataTransfer
+- :white_check_mark: DataTransfer
 - :white_check_mark: GetConfiguration
 - :white_check_mark: Heartbeat
 - :white_check_mark: MeterValues
@@ -411,7 +411,7 @@ Protocol to control the simulator via a Websocket or HTTP server.
 
 ### HTTP Protocol
 
-To learn how to use the HTTP protocol to pilot the simulator, an [Insomnia](https://insomnia.rest/) requests collection is available in [src/assets/ui-protocol](./src/assets/ui-protocol) directory.
+To learn how to use the HTTP protocol to pilot the simulator, an [Insomnia](https://insomnia.rest/) HTTP requests collection is available in [src/assets/ui-protocol](./src/assets/ui-protocol) directory.
 
 ### Websocket Protocol
 
@@ -428,6 +428,8 @@ SRPC protocol over Websocket. PDU stands for 'Protocol Data Unit'.
   `uuid`: String uniquely linking the response to the request  
   `PDU`: Response parameters to requested procedure
 
+An [Insomnia](https://insomnia.rest/) WebSocket requests collection is available in [src/assets/ui-protocol](./src/assets/ui-protocol) directory.
+
 #### Version 0.0.1
 
 Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
@@ -468,48 +470,12 @@ Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
   `chargingStations`: ChargingStationData[]  
   }
 
-###### Start Transaction
-
-- Request:  
-  `ProcedureName`: 'startTransaction'  
-  `PDU`: {  
-  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
-  `connectorId`: connector id integer,  
-  `idTag`: RFID tag string  
-  }
-
-- Response:  
-  `PDU`: {  
-  `status`: 'success' | 'failure',  
-  `hashIdsSucceeded`: charging station unique identifier strings array,  
-  `hashIdsFailed`: charging station unique identifier strings array (optional),  
-  `responsesFailed`: failed responses payload array (optional)  
-  }
-
-###### Stop Transaction
-
-- Request:  
-  `ProcedureName`: 'stopTransaction'  
-  `PDU`: {  
-  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
-  `transactionId`: transaction id integer  
-  }
-
-- Response:  
-  `PDU`: {  
-  `status`: 'success' | 'failure',  
-  `hashIdsSucceeded`: charging station unique identifier strings array,  
-  `hashIdsFailed`: charging station unique identifier strings array (optional),  
-  `responsesFailed`: failed responses payload array (optional)  
-  }
-
 ###### Start Charging Station
 
 - Request:  
   `ProcedureName`: 'startChargingStation'  
   `PDU`: {  
-  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
-  `responsesFailed`: failed responses payload array (optional)  
+  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations)  
   }
 
 - Response:  
@@ -517,6 +483,7 @@ Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
   `status`: 'success' | 'failure',  
   `hashIdsSucceeded`: charging station unique identifier strings array,  
   `hashIdsFailed`: charging station unique identifier strings array (optional)  
+  `responsesFailed`: failed responses payload array (optional)  
   }
 
 ###### Stop Charging Station
@@ -601,40 +568,94 @@ Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
   `responsesFailed`: failed responses payload array (optional)  
   }
 
-###### Status Notification
+###### OCPP commands trigger
 
 - Request:  
-  `ProcedureName`: 'StatusNotification'  
+  `ProcedureName`: 'commandName' (the OCPP command name in camel case)  
   `PDU`: {  
-  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
-  `connectorId`: connector id integer,  
-  `errorCode`: connector error code,  
-  `status`: connector status  
-  }
+   `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+   ...`commandPayload`  
+   } (the OCPP command payload with some optional fields added to target the simulated charging stations)
 
 - Response:  
-  `PDU`: {  
-  `status`: 'success' | 'failure',  
-  `hashIdsSucceeded`: charging station unique identifier strings array,  
-  `hashIdsFailed`: charging station unique identifier strings array (optional),  
-  `responsesFailed`: failed responses payload array (optional)  
-  }
+   `PDU`: {  
+   `status`: 'success' | 'failure',  
+   `hashIdsSucceeded`: charging station unique identifier strings array,  
+   `hashIdsFailed`: charging station unique identifier strings array (optional),  
+   `responsesFailed`: failed responses payload array (optional)  
+   }
+
+Examples:
+
+- **Start Transaction**
+
+  - Request:  
+    `ProcedureName`: 'startTransaction'  
+    `PDU`: {  
+    `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+    `connectorId`: connector id integer,  
+    `idTag`: RFID tag string  
+    }
 
-###### Heartbeat
+  - Response:  
+    `PDU`: {  
+    `status`: 'success' | 'failure',  
+    `hashIdsSucceeded`: charging station unique identifier strings array,  
+    `hashIdsFailed`: charging station unique identifier strings array (optional),  
+    `responsesFailed`: failed responses payload array (optional)  
+    }
 
-- Request:  
-  `ProcedureName`: 'Heartbeat'  
-  `PDU`: {  
-  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
-  }
+- **Stop Transaction**
 
-- Response:  
-  `PDU`: {  
-  `status`: 'success' | 'failure',  
-  `hashIdsSucceeded`: charging station unique identifier strings array,  
-  `hashIdsFailed`: charging station unique identifier strings array (optional),  
-  `responsesFailed`: failed responses payload array (optional)  
-  }
+  - Request:  
+    `ProcedureName`: 'stopTransaction'  
+    `PDU`: {  
+    `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+    `transactionId`: transaction id integer  
+    }
+
+  - Response:  
+    `PDU`: {  
+    `status`: 'success' | 'failure',  
+    `hashIdsSucceeded`: charging station unique identifier strings array,  
+    `hashIdsFailed`: charging station unique identifier strings array (optional),  
+    `responsesFailed`: failed responses payload array (optional)  
+    }
+
+- **Status Notification**
+
+  - Request:  
+    `ProcedureName`: 'statusNotification'  
+    `PDU`: {  
+    `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+    `connectorId`: connector id integer,  
+    `errorCode`: connector error code,  
+    `status`: connector status  
+    }
+
+  - Response:  
+    `PDU`: {  
+    `status`: 'success' | 'failure',  
+    `hashIdsSucceeded`: charging station unique identifier strings array,  
+    `hashIdsFailed`: charging station unique identifier strings array (optional),  
+    `responsesFailed`: failed responses payload array (optional)  
+    }
+
+- **Heartbeat**
+
+  - Request:  
+    `ProcedureName`: 'heartbeat'  
+    `PDU`: {  
+    `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+    }
+
+  - Response:  
+    `PDU`: {  
+    `status`: 'success' | 'failure',  
+    `hashIdsSucceeded`: charging station unique identifier strings array,  
+    `hashIdsFailed`: charging station unique identifier strings array (optional),  
+    `responsesFailed`: failed responses payload array (optional)  
+    }
 
 ## Support, Feedback, Contributing