Added OCPIEndpoint pullSessions/pullLocations/pullCDRs/checkSessions endpoints
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
}
}
}
+ },
+ "/api/ocpi/endpoints/{id}/sessions/check": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Check OCPI Endpoint's sessions",
+ "tags": [
+ "OCPI"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/OCPIEndpointID"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OCPI Endpoint's sessions checked",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
+ },
+ "/api/ocpi/endpoints/{id}/cdr/pull": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Pull OCPI Endpoint's CDRs",
+ "tags": [
+ "OCPI"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/OCPIEndpointID"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OCPI Endpoint's cdrs pulled",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
+ },
+ "/api/ocpi/endpoints/{id}/locations/pull": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Pull OCPI Endpoint's locations",
+ "tags": [
+ "OCPI"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/OCPIEndpointID"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OCPI Endpoint's locations pulled",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
+ },
+ "/api/ocpi/endpoints/{id}/sessions/pull": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Pull OCPI Endpoint's sessions",
+ "tags": [
+ "OCPI"
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/OCPIEndpointID"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OCPI Endpoint's sessions pulled",
+ "content": {
+ "application/json": {
+ "example": {
+ "status": "Success"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/UnauthorizedError"
+ },
+ "403": {
+ "$ref": "#/components/responses/ForbiddenError"
+ },
+ "500": {
+ "$ref": "#/components/responses/BackendError"
+ }
+ }
+ }
}
},
"components": {

MODIFY
src/server/rest/v1/router/api/OCPIRouter.ts
src/server/rest/v1/router/api/OCPIRouter.ts
@@ -15,8 +15,12 @@ export default class OCPIRouter {
public buildRoutes(): express.Router {
this.buildRouteOcpiEndpointCreate();
this.buildRouteOcpiEndpointPing();
- this.buildRouteOcpiEndpointCheckCDRS();
+ this.buildRouteOcpiEndpointCheckCDRs();
this.buildRouteOcpiEndpointCheckLocations();
+ this.buildRouteOcpiEndpointCheckSessions();
+ this.buildRouteOcpiEndpointPullCDRs();
+ this.buildRouteOcpiEndpointPullLocations();
+ this.buildRouteOcpiEndpointPullSessions();
return this.router;
}
@@ -32,7 +36,7 @@ export default class OCPIRouter {
});
}
- protected buildRouteOcpiEndpointCheckCDRS(): void {
+ protected buildRouteOcpiEndpointCheckCDRs(): void {
this.router.put(`/${ServerRoute.REST_OCPI_ENDPOINT_CHECK_CDRS}`, async (req: Request, res: Response, next: NextFunction) => {
await RouterUtils.handleServerAction(OCPIEndpointService.handleCheckCdrsEndpoint.bind(this), ServerAction.OCPI_ENDPOINT_CHECK_CDRS, req, res, next);
});
@@ -43,4 +47,28 @@ export default class OCPIRouter {
await RouterUtils.handleServerAction(OCPIEndpointService.handleCheckLocationsEndpoint.bind(this), ServerAction.OCPI_ENDPOINT_CHECK_LOCATIONS, req, res, next);
});
}
+
+ protected buildRouteOcpiEndpointCheckSessions(): void {
+ this.router.put(`/${ServerRoute.REST_OCPI_ENDPOINT_CHECK_SESSIONS}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(OCPIEndpointService.handleCheckSessionsEndpoint.bind(this), ServerAction.OCPI_ENDPOINT_CHECK_SESSIONS, req, res, next);
+ });
+ }
+
+ protected buildRouteOcpiEndpointPullCDRs(): void {
+ this.router.put(`/${ServerRoute.REST_OCPI_ENDPOINT_PULL_CDRS}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(OCPIEndpointService.handlePullCdrsEndpoint.bind(this), ServerAction.OCPI_PULL_CDRS, req, res, next);
+ });
+ }
+
+ protected buildRouteOcpiEndpointPullLocations(): void {
+ this.router.put(`/${ServerRoute.REST_OCPI_ENDPOINT_PULL_LOCATIONS}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(OCPIEndpointService.handlePullLocationsEndpoint.bind(this), ServerAction.OCPI_PULL_LOCATIONS, req, res, next);
+ });
+ }
+
+ protected buildRouteOcpiEndpointPullSessions(): void {
+ this.router.put(`/${ServerRoute.REST_OCPI_ENDPOINT_PULL_SESSIONS}`, async (req: Request, res: Response, next: NextFunction) => {
+ await RouterUtils.handleServerAction(OCPIEndpointService.handlePullSessionsEndpoint.bind(this), ServerAction.OCPI_PULL_SESSIONS, req, res, next);
+ });
+ }
}

Added OCPIEndpoint pullSessions/pullLocations/pullCDRs/checkSessions endpoints