Class DataCleanupController
java.lang.Object
org.qubership.atp.tdm.controllers.DataCleanupController
@RequestMapping("/api/tdm/cleanup")
@RestController
public class DataCleanupController
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.springframework.http.ResponseEntity<CleanupSettings> getCleanupConfig(UUID id) Get cleanup configuration for specified dataset / table ID.org.springframework.http.ResponseEntity<String> getNextScheduledRun(String cronExpression) Get next run's date / time details.runDataCleanup(CleanupSettings cleanupConfig) Force run data cleanup.saveCleanupConfig(CleanupSettings cleanupConfig) Save / update data cleanup settings.
-
Constructor Details
-
DataCleanupController
-
-
Method Details
-
getCleanupConfig
@PreAuthorize("@entityAccess.checkAccess(T(org.qubership.atp.tdm.utils.UsersManagementEntities).TEST_DATA.getName(),@catalogRepository.findAllByCleanupConfigId(#id).get(0).getProjectId(), \'READ\')") @GetMapping(path="/config/{id}") public org.springframework.http.ResponseEntity<CleanupSettings> getCleanupConfig(@PathVariable UUID id) Get cleanup configuration for specified dataset / table ID.- Parameters:
id- - cleanup config id- Returns:
- cleanup configuration object
-
saveCleanupConfig
@PreAuthorize("@entityAccess.checkAccess(T(org.qubership.atp.tdm.utils.UsersManagementEntities).TEST_DATA.getName(),@catalogRepository.findByTableName(#cleanupConfig.tableName).getProjectId(), \'CREATE\')") @PostMapping("/config") public CleanupSettings saveCleanupConfig(@RequestBody CleanupSettings cleanupConfig) throws Exception Save / update data cleanup settings.- Throws:
Exception
-
runDataCleanup
@PreAuthorize("@entityAccess.checkAccess(T(org.qubership.atp.tdm.utils.UsersManagementEntities).TEST_DATA.getName(),@catalogRepository.findByTableName(#cleanupConfig.tableName).getProjectId(), \'CREATE\')") @PostMapping("/run") public List<CleanupResults> runDataCleanup(@RequestBody CleanupSettings cleanupConfig) throws Exception Force run data cleanup.- Throws:
Exception
-
getNextScheduledRun
@GetMapping("/next/run") public org.springframework.http.ResponseEntity<String> getNextScheduledRun(@RequestParam("cronExpression") String cronExpression) throws ParseException Get next run's date / time details.- Parameters:
cronExpression- cron expression to calculate next run based on- Returns:
- ResponseMessage that contains the details
- Throws:
ParseException- Thrown in case if invalid cron expression was provided
-
fillCleanupTypeColumn
@GetMapping(path="/fill/cleanup/type") public void fillCleanupTypeColumn()
-