Class DataCleanupController

java.lang.Object
org.qubership.atp.tdm.controllers.DataCleanupController

@RequestMapping("/api/tdm/cleanup") @RestController public class DataCleanupController extends Object
  • Constructor Details

  • 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()