Added OICP getMany/getOne/update endpoints
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
}
}
},
+ "/api/oicp/endpoints/{id}": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Retrieve an OICP Endpoint",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/OICPEndpointID"
+ }
+ ],
+ "tags": [
+ "OICP"
+ ],
+ "responses": {
+ "200": {
+ "description": "Return OICP Endpoint",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OICPEndpoint"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ },
+ "550": {
+ "$ref": "#/components/responses/ResourceDoesNotExists"
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update an OICP Endpoint",
+ "tags": [
+ "OICP"
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/OICPEndpoint"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OICP Endpoint updated successfully",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ },
+ "550": {
+ "$ref": "#/components/responses/ResourceDoesNotExists"
+ }
+ }
+ }
+ },
"/api/oicp/endpoints/{id}/ping": {
"put": {
"security": [

MODIFY
src/server/rest/v1/router/api/OICPEndpointRouter.ts
src/server/rest/v1/router/api/OICPEndpointRouter.ts
@@ -17,6 +17,9 @@ export default class OICPEndpointRouter {
this.buildRouteOicpEndpointPing();
this.buildRouteOicpEndpointSendEvseStatuses();
this.buildRouteOicpEndpointSendEvses();
+ this.buildRouteOicpEndpoints();
+ this.buildRouteOicpEndpoint();
+ this.buildRouteOicpEndpointUpdate();
return this.router;
}
@@ -46,4 +49,24 @@ export default class OICPEndpointRouter {
await RouterUtils.handleServerAction(OICPEndpointService.handleSendEVSEsOicpEndpoint.bind(this), ServerAction.OICP_ENDPOINT_SEND_EVSES, req, res, next);
});
}
+
+ private buildRouteOicpEndpoints(): void {
+ this.router.get(`/${ServerRoute.REST_OICP_ENDPOINTS}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(OICPEndpointService.handleGetOicpEndpoints.bind(this), ServerAction.OICP_ENDPOINTS, req, res, next);
+ });
+ }
+
+ private buildRouteOicpEndpoint(): void {
+ this.router.get(`/${ServerRoute.REST_OICP_ENDPOINT}`, async (req: Request, res: Response, next: NextFunction) => {
+ req.query.ID = req.params.id;
+ await RouterUtils.handleServerAction(OICPEndpointService.handleGetOicpEndpoint.bind(this), ServerAction.OICP_ENDPOINT, req, res, next);
+ });
+ }
+
+ private buildRouteOicpEndpointUpdate(): void {
+ this.router.put(`/${ServerRoute.REST_OICP_ENDPOINT}`, async (req: Request, res: Response, next: NextFunction) => {
+ req.body.id = req.params.id;
+ await RouterUtils.handleServerAction(OICPEndpointService.handleUpdateOicpEndpoint.bind(this), ServerAction.OICP_ENDPOINT_UPDATE, req, res, next);
+ });
+ }
}

Added OICP getMany/getOne/update endpoints