View Javadoc
1   package de.dlr.shepard.endpoints;
2   
3   import java.io.IOException;
4   import java.util.Set;
5   
6   import de.dlr.shepard.influxDB.FillOption;
7   import de.dlr.shepard.influxDB.SingleValuedUnaryFunction;
8   import de.dlr.shepard.influxDB.TimeseriesPayload;
9   import de.dlr.shepard.neo4Core.io.TimeseriesReferenceIO;
10  import de.dlr.shepard.util.Constants;
11  import io.swagger.v3.oas.annotations.Operation;
12  import io.swagger.v3.oas.annotations.media.ArraySchema;
13  import io.swagger.v3.oas.annotations.media.Content;
14  import io.swagger.v3.oas.annotations.media.Schema;
15  import io.swagger.v3.oas.annotations.parameters.RequestBody;
16  import io.swagger.v3.oas.annotations.responses.ApiResponse;
17  import io.swagger.v3.oas.annotations.tags.Tag;
18  import jakarta.validation.Valid;
19  import jakarta.ws.rs.core.MediaType;
20  import jakarta.ws.rs.core.Response;
21  
22  public interface TimeseriesReferenceRest {
23  
24  	@Tag(name = Constants.TIMESERIES_REFERENCE)
25  	@Operation(description = "Get all timeseries references")
26  	@ApiResponse(description = "ok", responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TimeseriesReferenceIO.class))))
27  	@ApiResponse(description = "not found", responseCode = "404")
28  	Response getAllTimeseriesReferences(long collectionId, long dataObjectId);
29  
30  	@Tag(name = Constants.TIMESERIES_REFERENCE)
31  	@Operation(description = "Get timeseries reference")
32  	@ApiResponse(description = "ok", responseCode = "200", content = @Content(schema = @Schema(implementation = TimeseriesReferenceIO.class)))
33  	@ApiResponse(description = "not found", responseCode = "404")
34  	Response getTimeseriesReference(long collectionId, long dataObjectId, long timeseriesReferenceId);
35  
36  	@Tag(name = Constants.TIMESERIES_REFERENCE)
37  	@Operation(description = "Create a new timeseries reference")
38  	@ApiResponse(description = "created", responseCode = "201", content = @Content(schema = @Schema(implementation = TimeseriesReferenceIO.class)))
39  	@ApiResponse(description = "not found", responseCode = "404")
40  	Response createTimeseriesReference(long collectionId, long dataObjectId,
41  			@RequestBody(required = true, content = @Content(schema = @Schema(implementation = TimeseriesReferenceIO.class))) @Valid TimeseriesReferenceIO timeseriesReference);
42  
43  	@Tag(name = Constants.TIMESERIES_REFERENCE)
44  	@Operation(description = "Delete timeseries reference")
45  	@ApiResponse(description = "deleted", responseCode = "204")
46  	@ApiResponse(description = "not found", responseCode = "404")
47  	Response deleteTimeseriesReference(long collectionId, long dataObjectId, long timeseriesReferenceId);
48  
49  	@Tag(name = Constants.TIMESERIES_REFERENCE)
50  	@Operation(description = "Get timeseries reference payload")
51  	@ApiResponse(description = "ok", responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = TimeseriesPayload.class))))
52  	@ApiResponse(description = "not found", responseCode = "404")
53  	Response getTimeseriesPayload(long collectionId, long dataObjectId, long timeseriesReferenceId,
54  			SingleValuedUnaryFunction function, Long groupBy, FillOption fillOption, Set<String> deviceFilterTag,
55  			Set<String> locationFilterTag, Set<String> symbolicNameFilterTag);
56  
57  	@Tag(name = Constants.TIMESERIES_REFERENCE)
58  	@Operation(description = "Export timeseries reference payload")
59  	@ApiResponse(description = "ok", responseCode = "200", content = @Content(mediaType = MediaType.APPLICATION_OCTET_STREAM, schema = @Schema(type = "string", format = "binary")))
60  	@ApiResponse(description = "not found", responseCode = "404")
61  	Response exportTimeseriesPayload(long collectionId, long dataObjectId, long timeseriesReferenceId,
62  			SingleValuedUnaryFunction function, Long groupBy, FillOption fillOption, Set<String> deviceFilterTag,
63  			Set<String> locationFilterTag, Set<String> symbolicNameFilterTag) throws IOException;
64  
65  }