UI protocol: move Insomnia requests collection to its own directory
[e-mobility-charging-stations-simulator.git] / README.md
index c61910c98d40c4de9d7377b93784f53e8f64657d..927aaffd4ec10ddd8aa699e34a33d5eb6a924ab8 100644 (file)
--- a/README.md
+++ b/README.md
@@ -101,7 +101,7 @@ But the modifications to test have to be done to the files in the build target d
 | logFile                    |                                                  | combined.log                                                                                                                                                                                                   | string                                                                                                                                                                                                                              | log file relative path                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
 | logErrorFile               |                                                  | error.log                                                                                                                                                                                                      | string                                                                                                                                                                                                                              | error log file relative path                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
 | worker                     |                                                  | {<br />"processType": "workerSet",<br />"startDelay": 500,<br />"elementStartDelay": 0,<br />"elementsPerWorker": 1,<br />"poolMinSize": 4,<br />"poolMaxSize": 16,<br />"poolStrategy": "ROUND_ROBBIN"<br />} | {<br />processType: WorkerProcessType;<br />startDelay: number;<br />elementStartDelay: number;<br />elementsPerWorker: number;<br />poolMinSize: number;<br />poolMaxSize: number;<br />poolStrategy: WorkerChoiceStrategy;<br />} | Worker configuration section:<br />- processType: worker threads process type (workerSet/staticPool/dynamicPool)<br />- startDelay: milliseconds to wait at worker threads startup (only for workerSet threads process type)<br />- elementStartDelay: milliseconds to wait at charging station startup<br />- elementsPerWorker: number of charging stations per worker threads for the `workerSet` process type<br />- poolMinSize: worker threads pool minimum number of threads</br >- poolMaxSize: worker threads pool maximum number of threads<br />- poolStrategy: worker threads pool [poolifier](https://github.com/poolifier/poolifier) worker choice strategy |
-| uiServer                   |                                                  | {<br />"enabled": true,<br />"type": "ws",<br />"options": {<br />"host: "localhost",<br />"port": 8080<br />}<br />}                                                                                          | {<br />enabled: boolean;<br />type: ApplicationProtocol;<br />options: ServerOptions;<br />}                                                                                                                                        | UI server configuration section                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
+| uiServer                   |                                                  | {<br />"enabled": true,<br />"type": "ws",<br />"options": {<br />"host: "localhost",<br />"port": 8080<br />}<br />}                                                                                          | {<br />enabled: boolean;<br />type: ApplicationProtocol;<br />options: ServerOptions;<br />authentication: {<br />enabled: boolean;<br />type: AuthenticationType;<br />username: string;<br />password: string;<br />}<br />}      | UI server configuration section                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
 | performanceStorage         |                                                  | {<br />"enabled": false,<br />"type": "jsonfile",<br />"file:///performanceRecords.json"<br />}                                                                                                                | {<br />enabled: boolean;<br />type: string;<br />URI: string;<br />}<br />where type can be 'jsonfile' or 'mongodb'                                                                                                                 | performance storage configuration section                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
 | stationTemplateUrls        |                                                  | {}[]                                                                                                                                                                                                           | {<br />file: string;<br />numberOfStations: number;<br />}[]                                                                                                                                                                        | array of charging station configuration templates URIs configuration section (charging station configuration template file name and number of stations)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
 
@@ -386,9 +386,13 @@ All kind of OCPP parameters are supported in a charging station configuration or
 
 Protocol to control the simulator via a Websocket or HTTP server.
 
-### WebSocket Protocol
+### 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.
+
+### Websocket Protocol
 
-PDU stands for Protocol Data Unit.
+SRPC protocol over Websocket. PDU stands for 'Protocol Data Unit'.
 
 - Request:  
   [`uuid`, `ProcedureName`, `PDU`]  
@@ -399,15 +403,15 @@ PDU stands for Protocol Data Unit.
 - Response:  
   [`uuid`, `PDU`]  
   `uuid`: String uniquely linking the response to the request  
-  `PDU`: Response data to requested procedure
+  `PDU`: Response parameters to requested procedure
 
-### Version 0.0.1
+#### Version 0.0.1
 
-Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
+Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
 
-#### Procedures
+##### Procedures
 
-##### Start Simulator
+###### Start Simulator
 
 - Request:  
   `ProcedureName`: 'startSimulator'  
@@ -415,10 +419,10 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
 
 - Response:  
   `PDU`: {  
-  `status`  
+  `status`: 'success' | 'failure'  
   }
 
-##### Stop Simulator
+###### Stop Simulator
 
 - Request:  
   `ProcedureName`: 'stopSimulator'  
@@ -426,10 +430,10 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
 
 - Response:  
   `PDU`: {  
-  `status`  
+  `status`: 'success' | 'failure'  
   }
 
-##### List Charging Stations
+###### List Charging Stations
 
 - Request:  
   `ProcedureName`: 'listChargingStations'  
@@ -437,96 +441,177 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
 
 - Response:  
   `PDU`: {  
-  `status`,  
-  `index`: ChargingStationData,  
-  ...  
-  `index`: ChargingStationData  
+  `status`: 'success' | 'failure',  
+  `chargingStations`: ChargingStationData[]  
   }
 
-##### Start Transaction
+###### Start Transaction
 
 - Request:  
   `ProcedureName`: 'startTransaction'  
   `PDU`: {  
-  `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array,  
+  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
   `connectorId`: connector id integer,  
   `idTag`: RFID tag string  
   }
 
 - Response:  
   `PDU`: {  
-  `status`  
+  `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
+###### Stop Transaction
 
 - Request:  
   `ProcedureName`: 'stopTransaction'  
   `PDU`: {  
-  `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array,  
+  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
   `transactionId`: transaction id integer  
   }
 
 - Response:  
   `PDU`: {  
-  `status`  
+  `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
+###### Start Charging Station
 
 - Request:  
   `ProcedureName`: 'startChargingStation'  
   `PDU`: {  
-  `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array
+  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+  `responsesFailed`: failed responses payload array (optional)  
   }
 
 - Response:  
   `PDU`: {  
-  `status`  
+  `status`: 'success' | 'failure',  
+  `hashIdsSucceeded`: charging station unique identifier strings array,  
+  `hashIdsFailed`: charging station unique identifier strings array (optional)  
   }
 
-##### Stop Charging Station
+###### Stop Charging Station
 
 - Request:  
   `ProcedureName`: 'stopChargingStation'  
   `PDU`: {  
-  `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array  
+  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations)  
   }
 
 - Response:  
   `PDU`: {  
-  `status`  
+  `status`: 'success' | 'failure',  
+  `hashIdsSucceeded`: charging station unique identifier strings array,  
+  `hashIdsFailed`: charging station unique identifier strings array (optional),  
+  `responsesFailed`: failed responses payload array (optional)  
   }
 
-##### Open Connection
+###### Open Connection
 
 - Request:  
   `ProcedureName`: 'openConnection'  
   `PDU`: {  
-  `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array  
+  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations)  
   }
 
 - Response:  
   `PDU`: {  
-  `status`  
+  `status`: 'success' | 'failure',  
+  `hashIdsSucceeded`: charging station unique identifier strings array,  
+  `hashIdsFailed`: charging station unique identifier strings array (optional),  
+  `responsesFailed`: failed responses payload array (optional)  
   }
 
-##### Close Connection
+###### Close Connection
 
 - Request:  
   `ProcedureName`: 'closeConnection'  
   `PDU`: {  
-  `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array  
+  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations)  
   }
 
 - Response:  
   `PDU`: {  
-  `status`  
+  `status`: 'success' | 'failure',  
+  `hashIdsSucceeded`: charging station unique identifier strings array,  
+  `hashIdsFailed`: charging station unique identifier strings array (optional),  
+  `responsesFailed`: failed responses payload array (optional)  
   }
 
-### HTTP Protocol
+###### Start Automatic Transaction Generator
+
+- Request:  
+  `ProcedureName`: 'startAutomaticTransactionGenerator'  
+  `PDU`: {  
+  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+  `connectorIds`: connector id integer array (optional, default: all connectors)  
+  }
+
+- 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 Automatic Transaction Generator
+
+- Request:  
+  `ProcedureName`: 'stopAutomaticTransactionGenerator'  
+  `PDU`: {  
+  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+  `connectorIds`: connector id integer array (optional, default: all connectors)  
+  }
 
-A Postman or Advanced REST client collection to learn how to use the HTTP protocol to pilot the simulator is available.
+- 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