Class DatasetController

java.lang.Object
dev.dokimos.server.controller.v1.DatasetController

@RestController @RequestMapping("/api/v1/datasets") public class DatasetController extends Object
  • Constructor Details

    • DatasetController

      public DatasetController(DatasetService datasetService)
  • Method Details

    • listDatasets

      @GetMapping public List<DatasetSummary> listDatasets()
      Lists every dataset on the server with its latest version number and item count.
    • createDataset

      @PostMapping public org.springframework.http.ResponseEntity<DatasetSummary> createDataset(@Valid @RequestBody @Valid CreateDatasetRequest request)
      Creates a dataset shell with no versions. Returns 201 with a Location header pointing at the new dataset.
    • getDataset

      @GetMapping("/{name}") public DatasetDetails getDataset(@PathVariable String name)
      Returns the dataset and every one of its versions, newest first.
    • deleteDataset

      @DeleteMapping("/{name}") public org.springframework.http.ResponseEntity<Void> deleteDataset(@PathVariable String name)
      Deletes a dataset and its versions; runs that referenced any version become unlinked.
    • createVersion

      @PostMapping("/{name}/versions") public org.springframework.http.ResponseEntity<DatasetVersionDetails> createVersion(@PathVariable String name, @Valid @RequestBody @Valid CreateVersionRequest request, jakarta.servlet.http.HttpServletRequest http)
      Appends a new immutable version to the dataset with the supplied items. The created_by field is taken from the authenticated principal when present.
    • promote

      @PostMapping("/promote") public org.springframework.http.ResponseEntity<DatasetVersionDetails> promote(@Valid @RequestBody @Valid PromoteRequest request, jakarta.servlet.http.HttpServletRequest http)
      Promotes run item results into a new immutable version of an existing dataset. Returns 201 with a Location header pointing at the new version. The created_by field is taken from the authenticated principal when present.
    • getVersion

      @GetMapping("/{name}/versions/{version}") public DatasetVersionDetails getVersion(@PathVariable String name, @PathVariable String version)
      Returns a specific version of the dataset. The literal path latest resolves to the highest existing version; numeric paths are parsed as the explicit version number.
    • listItems

      @GetMapping("/{name}/versions/{version}/items") public PageResponse<DatasetItemView> listItems(@PathVariable String name, @PathVariable String version, @PageableDefault(size=50) org.springframework.data.domain.Pageable pageable)
      Returns the items of a dataset version ordered by ordinal, paginated.