17
17
import jakarta .servlet .http .HttpServletResponse ;
18
18
import org .apache .commons .lang3 .StringUtils ;
19
19
import org .gridsuite .study .server .StudyApi ;
20
+ import org .gridsuite .study .server .StudyConstants .ModificationsActionType ;
21
+ import org .gridsuite .study .server .StudyConstants .SldDisplayMode ;
20
22
import org .gridsuite .study .server .StudyException ;
21
23
import org .gridsuite .study .server .StudyException .Type ;
22
24
import org .gridsuite .study .server .dto .*;
@@ -180,9 +182,8 @@ public ResponseEntity<CreatedStudyBasicInfos> getStudy(@PathVariable("studyUuid"
180
182
@ DeleteMapping (value = "/studies/{studyUuid}" )
181
183
@ Operation (summary = "delete the study" )
182
184
@ ApiResponse (responseCode = "200" , description = "Study deleted" )
183
- public ResponseEntity <Void > deleteStudy (@ PathVariable ("studyUuid" ) UUID studyUuid ,
184
- @ RequestHeader (HEADER_USER_ID ) String userId ) {
185
- studyService .deleteStudyIfNotCreationInProgress (studyUuid , userId );
185
+ public ResponseEntity <Void > deleteStudy (@ PathVariable ("studyUuid" ) UUID studyUuid ) {
186
+ studyService .deleteStudyIfNotCreationInProgress (studyUuid );
186
187
return ResponseEntity .ok ().build ();
187
188
}
188
189
@@ -1208,33 +1209,33 @@ public ResponseEntity<List<Report>> getParentNodesReport(@Parameter(description
1208
1209
return ResponseEntity .ok ().contentType (MediaType .APPLICATION_JSON ).body (studyService .getParentNodesReport (nodeUuid , rootNetworkUuid , nodeOnlyReport , reportType , severityLevels ));
1209
1210
}
1210
1211
1211
- @ GetMapping (value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/report/{reportId}/ logs" , produces = MediaType .APPLICATION_JSON_VALUE )
1212
- @ Operation (summary = "Get node report logs" )
1213
- @ ApiResponses (value = {@ ApiResponse (responseCode = "200" , description = "The node report logs" ), @ ApiResponse (responseCode = "404" , description = "The study/node is not found" )})
1214
- public ResponseEntity <ReportPage > getNodeReportLogs (@ Parameter (description = "Study uuid" ) @ PathVariable ("studyUuid" ) UUID studyUuid ,
1215
- @ Parameter (description = "root network id" ) @ PathVariable ("rootNetworkUuid" ) UUID rootNetworkUuid ,
1216
- @ Parameter (description = "node id" ) @ PathVariable ("nodeUuid" ) UUID nodeUuid ,
1217
- @ Parameter (description = "reportId " ) @ PathVariable ( "reportId" ) String reportId ,
1218
- @ Parameter (description = "The message filter" ) @ RequestParam (name = "message" , required = false ) String messageFilter ,
1219
- @ Parameter (description = "Severity levels filter" ) @ RequestParam (name = "severityLevels" , required = false ) Set <String > severityLevels ,
1220
- @ Parameter (description = "Whether we want paged logs " ) @ RequestParam (name = "paged" , required = false , defaultValue = "false" ) boolean paged ,
1221
- Pageable pageable ) {
1212
+ @ GetMapping (value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/report/logs" , produces = MediaType .APPLICATION_JSON_VALUE )
1213
+ @ Operation (summary = "Get the report logs of the given node and all its parents " )
1214
+ @ ApiResponses (value = {@ ApiResponse (responseCode = "200" , description = "The report logs of the node and all its parent " ), @ ApiResponse (responseCode = "404" , description = "The study/node is not found" )})
1215
+ public ResponseEntity <ReportPage > getReportLogs (@ Parameter (description = "Study uuid" ) @ PathVariable ("studyUuid" ) UUID studyUuid ,
1216
+ @ Parameter (description = "root network id" ) @ PathVariable ("rootNetworkUuid" ) UUID rootNetworkUuid ,
1217
+ @ Parameter (description = "node id" ) @ PathVariable ("nodeUuid" ) UUID nodeUuid ,
1218
+ @ Parameter (description = "report id " ) @ RequestParam ( name = "reportId" , required = false ) UUID reportId ,
1219
+ @ Parameter (description = "The message filter" ) @ RequestParam (name = "message" , required = false ) String messageFilter ,
1220
+ @ Parameter (description = "Severity levels filter" ) @ RequestParam (name = "severityLevels" , required = false ) Set <String > severityLevels ,
1221
+ @ Parameter (description = "If we wanted the paged version of the results or not " ) @ RequestParam (name = "paged" , required = false , defaultValue = "false" ) boolean paged ,
1222
+ Pageable pageable ) {
1222
1223
studyService .assertIsStudyAndNodeExist (studyUuid , nodeUuid );
1223
1224
rootNetworkService .assertIsRootNetworkInStudy (studyUuid , rootNetworkUuid );
1224
- return ResponseEntity .ok ().contentType (MediaType .APPLICATION_JSON ).body (studyService .getReportLogs (reportId , messageFilter , severityLevels , paged , pageable ));
1225
+ return ResponseEntity .ok ().contentType (MediaType .APPLICATION_JSON ).body (studyService .getReportLogs (nodeUuid , rootNetworkUuid , reportId , messageFilter , severityLevels , paged , pageable ));
1225
1226
}
1226
1227
1227
- @ GetMapping (value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/report/{reportId}/ logs/search" , produces = MediaType .APPLICATION_JSON_VALUE )
1228
- @ Operation (summary = "Get search term matches in node report logs" )
1228
+ @ GetMapping (value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/report/logs/search" , produces = MediaType .APPLICATION_JSON_VALUE )
1229
+ @ Operation (summary = "Get search term matches in parent nodes filtered logs" )
1229
1230
@ ApiResponses (value = {
1230
- @ ApiResponse (responseCode = "200" , description = "The search term matches in the node report logs" ),
1231
+ @ ApiResponse (responseCode = "200" , description = "The search term matches in the parent nodes filtered logs" ),
1231
1232
@ ApiResponse (responseCode = "404" , description = "The study/node is not found" )
1232
1233
})
1233
- public ResponseEntity <String > getNodeReportLogsSearchTermMatches (
1234
+ public ResponseEntity <String > getSearchTermMatchesInFilteredLogs (
1234
1235
@ Parameter (description = "Study uuid" ) @ PathVariable ("studyUuid" ) UUID studyUuid ,
1235
1236
@ Parameter (description = "root network id" ) @ PathVariable ("rootNetworkUuid" ) UUID rootNetworkUuid ,
1236
1237
@ Parameter (description = "node id" ) @ PathVariable ("nodeUuid" ) UUID nodeUuid ,
1237
- @ Parameter (description = "reportId " ) @ PathVariable ( "reportId" ) UUID reportId ,
1238
+ @ Parameter (description = "report id " ) @ RequestParam ( name = "reportId" , required = false ) UUID reportId ,
1238
1239
@ Parameter (description = "The message filter" ) @ RequestParam (name = "message" , required = false ) String messageFilter ,
1239
1240
@ Parameter (description = "Severity levels filter" ) @ RequestParam (name = "severityLevels" , required = false ) Set <String > severityLevels ,
1240
1241
@ Parameter (description = "The search term" ) @ RequestParam (name = "searchTerm" ) String searchTerm ,
@@ -1243,43 +1244,19 @@ public ResponseEntity<String> getNodeReportLogsSearchTermMatches(
1243
1244
studyService .assertIsStudyAndNodeExist (studyUuid , nodeUuid );
1244
1245
rootNetworkService .assertIsRootNetworkInStudy (studyUuid , rootNetworkUuid );
1245
1246
return ResponseEntity .ok ().contentType (MediaType .APPLICATION_JSON ).body (
1246
- studyService .getSearchTermMatchesInFilteredLogs (reportId , severityLevels , messageFilter , searchTerm , pageSize ));
1247
- }
1248
-
1249
- @ GetMapping (value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/report/{reportId}/aggregated-severities" , produces = MediaType .APPLICATION_JSON_VALUE )
1250
- @ Operation (summary = "Get node report severities" )
1251
- @ ApiResponses (value = {@ ApiResponse (responseCode = "200" , description = "The node report severities" ), @ ApiResponse (responseCode = "404" , description = "The study/node is not found" )})
1252
- public ResponseEntity <Set <String >> getNodeReportAggregatedSeverities (@ Parameter (description = "Study uuid" ) @ PathVariable ("studyUuid" ) UUID studyUuid ,
1253
- @ Parameter (description = "root network id" ) @ PathVariable ("rootNetworkUuid" ) UUID rootNetworkUuid ,
1254
- @ Parameter (description = "node id" ) @ PathVariable ("nodeUuid" ) UUID nodeUuid ,
1255
- @ Parameter (description = "reportId" ) @ PathVariable ("reportId" ) UUID reportId ) {
1256
- studyService .assertIsStudyAndNodeExist (studyUuid , nodeUuid );
1257
- rootNetworkService .assertIsRootNetworkInStudy (studyUuid , rootNetworkUuid );
1258
- return ResponseEntity .ok ().contentType (MediaType .APPLICATION_JSON ).body (studyService .getNodeReportAggregatedSeverities (reportId ));
1247
+ studyService .getSearchTermMatchesInFilteredLogs (nodeUuid , rootNetworkUuid , reportId , severityLevels , messageFilter , searchTerm , pageSize ));
1259
1248
}
1260
1249
1261
1250
@ GetMapping (value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/report/aggregated-severities" , produces = MediaType .APPLICATION_JSON_VALUE )
1262
1251
@ Operation (summary = "Get the report severities of the given node and all its parents" )
1263
1252
@ ApiResponses (value = {@ ApiResponse (responseCode = "200" , description = "The report severities of the node and all its parent" ), @ ApiResponse (responseCode = "404" , description = "The study/node is not found" )})
1264
1253
public ResponseEntity <Set <String >> getParentNodesAggregatedReportSeverities (@ Parameter (description = "Study uuid" ) @ PathVariable ("studyUuid" ) UUID studyUuid ,
1265
1254
@ Parameter (description = "root network id" ) @ PathVariable ("rootNetworkUuid" ) UUID rootNetworkUuid ,
1266
- @ Parameter (description = "node id" ) @ PathVariable ("nodeUuid" ) UUID nodeUuid ) {
1267
- studyService .assertIsStudyAndNodeExist (studyUuid , nodeUuid );
1268
- rootNetworkService .assertIsRootNetworkInStudy (studyUuid , rootNetworkUuid );
1269
- return ResponseEntity .ok ().contentType (MediaType .APPLICATION_JSON ).body (studyService .getParentNodesAggregatedReportSeverities (nodeUuid , rootNetworkUuid ));
1270
- }
1271
-
1272
- @ GetMapping (value = "/studies/{studyUuid}/root-networks/{rootNetworkUuid}/nodes/{nodeUuid}/report/logs" , produces = MediaType .APPLICATION_JSON_VALUE )
1273
- @ Operation (summary = "Get the report logs of the given node and all its parents" )
1274
- @ ApiResponses (value = {@ ApiResponse (responseCode = "200" , description = "The report logs of the node and all its parent" ), @ ApiResponse (responseCode = "404" , description = "The study/node is not found" )})
1275
- public ResponseEntity <List <ReportLog >> getParentNodesReportLogs (@ Parameter (description = "Study uuid" ) @ PathVariable ("studyUuid" ) UUID studyUuid ,
1276
- @ Parameter (description = "root network id" ) @ PathVariable ("rootNetworkUuid" ) UUID rootNetworkUuid ,
1277
- @ Parameter (description = "node id" ) @ PathVariable ("nodeUuid" ) UUID nodeUuid ,
1278
- @ Parameter (description = "The message filter" ) @ RequestParam (name = "message" , required = false ) String messageFilter ,
1279
- @ Parameter (description = "Severity levels filter" ) @ RequestParam (name = "severityLevels" , required = false ) Set <String > severityLevels ) {
1255
+ @ Parameter (description = "node id" ) @ PathVariable ("nodeUuid" ) UUID nodeUuid ,
1256
+ @ Parameter (description = "reportId" ) @ RequestParam (name = "reportId" , required = false ) UUID reportId ) {
1280
1257
studyService .assertIsStudyAndNodeExist (studyUuid , nodeUuid );
1281
1258
rootNetworkService .assertIsRootNetworkInStudy (studyUuid , rootNetworkUuid );
1282
- return ResponseEntity .ok ().contentType (MediaType .APPLICATION_JSON ).body (studyService .getParentNodesReportLogs (nodeUuid , rootNetworkUuid , messageFilter , severityLevels ));
1259
+ return ResponseEntity .ok ().contentType (MediaType .APPLICATION_JSON ).body (studyService .getAggregatedReportSeverities (nodeUuid , rootNetworkUuid , reportId ));
1283
1260
}
1284
1261
1285
1262
@ GetMapping (value = "/svg-component-libraries" )
0 commit comments