Added change configuration route
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
}
}
},
+ "/api/chargingstations/{id}/configuration": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update the Charging Station's configuration",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/chargingStationID"
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "args": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string",
+ "description": "Required. Configuration key to update",
+ "example": ""
+ },
+ "value": {
+ "type": "string",
+ "description": "Required. Value to set",
+ "example": ""
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "tags": [
+ "Charging Stations"
+ ],
+ "responses": {
+ "200": {
+ "description": "Return the configuration",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OcppConfigurationStatus"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
+ },
"/api/chargingstations/remote/start": {
"put": {
"security": [
"content": {
"application/json": {
"schema": {
- "type": "object",
- "properties": {
- "status": {
- "type": "string"
- }
- }
- },
- "examples": {
- "accepted": {
- "summary": "Accepted",
- "value": {
- "status": "Accepted"
- }
- },
- "rejected": {
- "summary": "Rejected",
- "value": {
- "status": "Rejected"
- }
- },
- "rebootRequired": {
- "summary": "Reboot required",
- "value": {
- "status": "RebootRequired"
- }
- },
- "NotSupported": {
- "summary": "Not supported",
- "value": {
- "status": "NotSupported"
- }
- }
+ "$ref": "#/components/schemas/OcppConfigurationStatus"
}
}
}
"type": "boolean"
}
}
+ },
+ "OcppConfigurationStatus": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "string",
+ "enum": [
+ "Accepted",
+ "Rejected",
+ "RebootRequired",
+ "NotSupported"
+ ]
+ }
+ }
}
},
"parameters": {

MODIFY
src/server/rest/v1/router/api/ChargingStationRouter.ts
src/server/rest/v1/router/api/ChargingStationRouter.ts
@@ -29,6 +29,7 @@ export default class ChargingStationRouter {
this.buildRouteChargingStationReset();
this.buildRouteChargingStationClearCache();
this.buildRouteChargingStationRetrieveConfiguration();
+ this.buildRouteChargingStationChangeConfiguration();
this.buildRouteChargingStationRemoteStart();
this.buildRouteChargingStationRemoteStop();
this.buildRouteChargingStationUnlockConnector();
@@ -84,6 +85,13 @@ export default class ChargingStationRouter {
});
}
+ protected buildRouteChargingStationChangeConfiguration(): void {
+ this.router.put(`/${ServerRoute.REST_CHARGING_STATIONS_CHANGE_CONFIGURATION}`, async (req: Request, res: Response, next: NextFunction) => {
+ req.body.chargeBoxID = req.params.id;
+ await RouterUtils.handleServerAction(ChargingStationService.handleAction.bind(this), ServerAction.CHARGING_STATION_CHANGE_CONFIGURATION, req, res, next);
+ });
+ }
+
protected buildRouteChargingStationRemoteStart(): void {
this.router.put(`/${ServerRoute.REST_CHARGING_STATIONS_REMOTE_START}`, async (req: Request, res: Response, next: NextFunction) => {
await RouterUtils.handleServerAction(ChargingStationService.handleAction.bind(this), ServerAction.CHARGING_STATION_REMOTE_START_TRANSACTION, req, res, next);

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -409,6 +409,7 @@ export enum ServerRoute {
REST_CHARGING_STATIONS_RESET = 'chargingstations/reset',
REST_CHARGING_STATIONS_CACHE_CLEAR = 'chargingstations/cache/clear',
REST_CHARGING_STATIONS_RETRIEVE_CONFIGURATION = 'chargingstations/configuration/retrieve',
+ REST_CHARGING_STATIONS_CHANGE_CONFIGURATION = 'chargingstations/:id/configuration',
REST_CHARGING_STATIONS_REMOTE_START = 'chargingstations/remote/start',
REST_CHARGING_STATIONS_REMOTE_STOP = 'chargingstations/remote/stop',
REST_CHARGING_STATIONS_UNLOCK_CONNECTOR = 'chargingstations/connectors/unlock',

Added change configuration route