Skip to content

Commit

Permalink
add maintenance entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
cmangeat committed Jan 11, 2024
1 parent 5c9c225 commit 6ffd7fb
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.fao.geonet.api.maintenance;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;

@RequestMapping(value = {"/{portal}/api/maintenance"})
@Tag(name = "maintenance")
@Controller("maintenance")
public class DatadirCleaner {

@io.swagger.v3.oas.annotations.Operation(summary = "Clean data dir")
@RequestMapping(
path = "/cleanDatadir",
produces = MediaType.APPLICATION_JSON_VALUE,
method = RequestMethod.GET)
@ResponseStatus(value = HttpStatus.OK)
@PreAuthorize("hasAuthority('UserAdmin')")
@ResponseBody
public Object cleanDataDir() {
return "cleaned";
}
}

0 comments on commit 6ffd7fb

Please sign in to comment.