From 3412e9dc7eb230d8b237366b9d37edb8713c894f Mon Sep 17 00:00:00 2001 From: alainbodiguel Date: Fri, 17 May 2024 12:12:57 +0200 Subject: [PATCH] Update to swagger 2 --- arlas-tagger-core/pom.xml | 9 +- .../arlas/tagger/service/TagExecService.java | 2 +- .../arlas/tagger/rest/tag/TagRESTService.java | 119 +- .../tagger/rest/tag/TagStatusRESTService.java | 87 +- .../java/io/arlas/tagger/CollectionTool.java | 3 - .../io/arlas/tagger/rest/tag/TagAuthIT.java | 2 +- .../java/io/arlas/tagger/app/ArlasTagger.java | 13 +- conf/configuration.yaml | 9 +- conf/doc/widdershins.json | 6 + conf/npm/package-build.json | 4 +- conf/npm/package-doc.json | 5 +- conf/npm/package-publish.json | 4 +- docker/docker-files/Dockerfile | 2 +- docker/docker-files/Dockerfile-package-only | 2 +- .../docker-compose-arlas-server.yml | 2 +- .../docker-compose-elasticsearch.yml | 2 +- docs/api/definitions.md | 158 --- docs/api/overview.md | 35 - docs/api/paths.md | 205 --- docs/api/reference.md | 1263 +++++++++++++++++ docs/api/security.md | 2 - docs/arlas-tagger-overview.md | 22 +- mkDocs.sh | 13 +- openapi/openapi.json | 677 +++++++++ openapi/openapi.yaml | 479 +++++++ openapi/swagger.json | 562 -------- openapi/swagger.yaml | 438 ------ pom.xml | 75 +- release.sh | 31 +- scripts/ci/tests-integration.sh | 4 +- 30 files changed, 2641 insertions(+), 1594 deletions(-) create mode 100644 conf/doc/widdershins.json delete mode 100644 docs/api/definitions.md delete mode 100644 docs/api/overview.md delete mode 100644 docs/api/paths.md create mode 100644 docs/api/reference.md delete mode 100644 docs/api/security.md create mode 100644 openapi/openapi.json create mode 100644 openapi/openapi.yaml delete mode 100644 openapi/swagger.json delete mode 100644 openapi/swagger.yaml diff --git a/arlas-tagger-core/pom.xml b/arlas-tagger-core/pom.xml index 2c020aa..9d4b5ab 100644 --- a/arlas-tagger-core/pom.xml +++ b/arlas-tagger-core/pom.xml @@ -29,11 +29,6 @@ - - org.apache.kafka - kafka-clients - ${kafka.version} - org.apache.kafka connect-json @@ -47,6 +42,10 @@ jackson-datatype-jdk8 com.fasterxml.jackson.datatype + + slf4j-api + org.slf4j + diff --git a/arlas-tagger-core/src/main/java/io/arlas/tagger/service/TagExecService.java b/arlas-tagger-core/src/main/java/io/arlas/tagger/service/TagExecService.java index 1436336..3a62be2 100644 --- a/arlas-tagger-core/src/main/java/io/arlas/tagger/service/TagExecService.java +++ b/arlas-tagger-core/src/main/java/io/arlas/tagger/service/TagExecService.java @@ -35,7 +35,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.NotFoundException; +import jakarta.ws.rs.NotFoundException; import java.io.IOException; import java.util.Optional; diff --git a/arlas-tagger-rest/src/main/java/io/arlas/tagger/rest/tag/TagRESTService.java b/arlas-tagger-rest/src/main/java/io/arlas/tagger/rest/tag/TagRESTService.java index 0c9dae8..662afb4 100644 --- a/arlas-tagger-rest/src/main/java/io/arlas/tagger/rest/tag/TagRESTService.java +++ b/arlas-tagger-rest/src/main/java/io/arlas/tagger/rest/tag/TagRESTService.java @@ -32,24 +32,43 @@ import io.arlas.tagger.model.response.UpdateResponse; import io.arlas.tagger.service.ManagedKafkaConsumers; import io.arlas.tagger.util.TagRequestFieldsExtractor; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.info.Contact; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.tags.Tag; -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.util.Optional; import static io.arlas.commons.rest.utils.ServerConstants.*; @Path("/write") -@Api(value = "/write") -@SwaggerDefinition( - info = @Info(contact = @Contact(email = "contact@gisaia.com", name = "Gisaia", url = "http://www.gisaia.com/"), - title = "ARLAS Tagger API", +@Tag(name="write", description="Tagger API") +@OpenAPIDefinition( + info = @Info( + title = "ARLAS Tagger APIs", description = "(Un)Tag fields of ARLAS collections", license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html"), + contact = @Contact(email = "contact@gisaia.com", name = "Gisaia", url = "http://www.gisaia.com/"), version = "API_VERSION"), - schemes = { SwaggerDefinition.Scheme.HTTP, SwaggerDefinition.Scheme.HTTPS }) + externalDocs = @ExternalDocumentation( + description = "API documentation", + url="https://docs.arlas.io/arlas-api/"), + servers = { + @Server(url = "/arlas_tagger", description = "default server") + } +) public class TagRESTService { public static final String UTF8JSON = MediaType.APPLICATION_JSON + ";charset=utf-8"; @@ -67,16 +86,25 @@ public TagRESTService(ManagedKafkaConsumers consumersManager, Long statusTimeout @POST @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Tag", produces = UTF8JSON, notes = Documentation.TAG_OPERATION, consumes = UTF8JSON, response = UpdateResponse.class) - @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful operation", response = UpdateResponse.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class) }) + @Operation( + summary = "Tag", + description = Documentation.TAG_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = UpdateResponse.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response tagPost( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collection", - value = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- @@ -88,20 +116,20 @@ public Response tagPost( // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) - @HeaderParam(value= PARTITION_FILTER) String partitionFilter, + @Parameter(hidden = true) + @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name ="pretty", value=Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name ="pretty", description=Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value="pretty") Boolean pretty ) throws ArlasException { assertColumnFilter(collection, tagRequest, Optional.ofNullable(columnFilter), Optional.ofNullable(organisations)); @@ -118,30 +146,38 @@ public Response tagPost( @POST @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "TagReplay", produces = UTF8JSON, notes = Documentation.TAG_REPLAY, consumes = UTF8JSON, response = Long.class) - @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful operation", response = Long.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class) }) + @Operation( + summary = "TagReplay", + description = Documentation.TAG_REPLAY + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = Long.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) }) public Response tagReplay( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collection", - value = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- SEARCH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "offset", value = Documentation.TAG_REPLAY_PARAM_OFFSET, + @Parameter(name = "offset", description = Documentation.TAG_REPLAY_PARAM_OFFSET, required = true) @QueryParam(value = "offset") Long offset, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name ="pretty", value=Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name ="pretty", description=Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value="pretty") Boolean pretty ) { @@ -154,16 +190,21 @@ public Response tagReplay( @POST @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Untag", produces = UTF8JSON, notes = Documentation.UNTAG_OPERATION, consumes = UTF8JSON, response = UpdateResponse.class) - @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful operation", response = UpdateResponse.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class) }) + @Operation(summary = "Untag", description = Documentation.UNTAG_OPERATION) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = UpdateResponse.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) }) public Response untagPost( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collection", - value = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- @@ -175,20 +216,20 @@ public Response untagPost( // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) - @HeaderParam(value=PARTITION_FILTER) String partitionFilter, + @Parameter(hidden = true) + @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name ="pretty", value=Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name ="pretty", description=Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value="pretty") Boolean pretty ) throws ArlasException { assertColumnFilter(collection, tagRequest, Optional.ofNullable(columnFilter), Optional.ofNullable(organisations)); diff --git a/arlas-tagger-rest/src/main/java/io/arlas/tagger/rest/tag/TagStatusRESTService.java b/arlas-tagger-rest/src/main/java/io/arlas/tagger/rest/tag/TagStatusRESTService.java index 9862808..05cc8ee 100644 --- a/arlas-tagger-rest/src/main/java/io/arlas/tagger/rest/tag/TagStatusRESTService.java +++ b/arlas-tagger-rest/src/main/java/io/arlas/tagger/rest/tag/TagStatusRESTService.java @@ -26,14 +26,42 @@ import io.arlas.tagger.model.request.TagRefRequest; import io.arlas.tagger.model.response.UpdateResponse; import io.arlas.tagger.service.TagExploreService; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.info.Contact; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.servers.Server; +import io.swagger.v3.oas.annotations.tags.Tag; -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; @Path("/status") -@Api(value = "/status") +@Tag(name="status", description="Tagger status API") +@OpenAPIDefinition( + info = @Info( + title = "ARLAS Tagger APIs", + description = "(Un)Tag fields of ARLAS collections", + license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html"), + contact = @Contact(email = "contact@gisaia.com", name = "Gisaia", url = "http://www.gisaia.com/"), + version = "API_VERSION"), + externalDocs = @ExternalDocumentation( + description = "API documentation", + url="https://docs.arlas.io/arlas-api/"), + servers = { + @Server(url = "/arlas_tagger", description = "default server") + } +) + public class TagStatusRESTService { public static final String UTF8JSON = MediaType.APPLICATION_JSON + ";charset=utf-8"; private final TaggingStatus status; @@ -49,27 +77,37 @@ public TagStatusRESTService(TagExploreService tagExploreService) { @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "TagStatus", produces = UTF8JSON, notes = Documentation.TAGSTATUS_OPERATION, consumes = UTF8JSON, response = UpdateResponse.class) - @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful operation", response = UpdateResponse.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class) }) + @Operation( + summary = "TagStatus", + description = Documentation.TAGSTATUS_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = UpdateResponse.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response taggingGet( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collection", - value = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, - @ApiParam(name = "id", value = Documentation.TAGSTATUS_PARAM_ID, + @Parameter(name = "id", description = Documentation.TAGSTATUS_PARAM_ID, required = true) @PathParam(value = "id") String id, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name ="pretty", value=Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name ="pretty", + description=Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value="pretty") Boolean pretty ) { return Response.ok(status.getStatus(id).orElseGet(UpdateResponse::new)).build(); @@ -80,24 +118,33 @@ public Response taggingGet( @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "TagList", produces = UTF8JSON, notes = Documentation.TAGLIST_OPERATION, consumes = UTF8JSON, response = TagRefRequest.class, responseContainer = "List") - @ApiResponses(value = { @ApiResponse(code = 200, message = "Successful operation", response = TagRefRequest.class, responseContainer = "List"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class) }) + @Operation( + summary = "TagList", + description = Documentation.TAGLIST_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(array = @ArraySchema(schema = @Schema(implementation = TagRefRequest.class)))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response taggingGetList( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collection", - value = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name ="pretty", value=Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name ="pretty", description=Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value="pretty") Boolean pretty ) { diff --git a/arlas-tagger-tests/src/test/java/io/arlas/tagger/CollectionTool.java b/arlas-tagger-tests/src/test/java/io/arlas/tagger/CollectionTool.java index 4681e82..65c0ac8 100644 --- a/arlas-tagger-tests/src/test/java/io/arlas/tagger/CollectionTool.java +++ b/arlas-tagger-tests/src/test/java/io/arlas/tagger/CollectionTool.java @@ -70,8 +70,6 @@ public void load(long sleepAfter) { params.centroidPath = DataSetTool.DATASET_CENTROID_PATH; params.timestampPath = DataSetTool.DATASET_TIMESTAMP_PATH; params.taggableFields = DataSetTool.DATASET_TAGGABLE_FIELDS; - params.h3Path = DataSetTool.DATASET_H3_PATH; - // PUT new collection given().contentType("application/json").body(params).when().put(getUrlPath()).then().statusCode(200); @@ -110,7 +108,6 @@ public void loadCsw(long sleepAfter) throws IOException { params.centroidPath = DataSetTool.DATASET_CENTROID_PATH; params.timestampPath = DataSetTool.DATASET_TIMESTAMP_PATH; params.taggableFields = DataSetTool.DATASET_TAGGABLE_FIELDS; - params.h3Path = DataSetTool.DATASET_H3_PATH; params.dublinCoreElementName=dublinCoreElementName; String url = arlasPath + "collections/" + dublinCoreElementName.title.split(" ")[0].toLowerCase(); // PUT new collection diff --git a/arlas-tagger-tests/src/test/java/io/arlas/tagger/rest/tag/TagAuthIT.java b/arlas-tagger-tests/src/test/java/io/arlas/tagger/rest/tag/TagAuthIT.java index adddb64..5b0471f 100644 --- a/arlas-tagger-tests/src/test/java/io/arlas/tagger/rest/tag/TagAuthIT.java +++ b/arlas-tagger-tests/src/test/java/io/arlas/tagger/rest/tag/TagAuthIT.java @@ -31,7 +31,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.HttpHeaders; import static io.restassured.RestAssured.given; diff --git a/arlas-tagger/src/main/java/io/arlas/tagger/app/ArlasTagger.java b/arlas-tagger/src/main/java/io/arlas/tagger/app/ArlasTagger.java index 8e90d3c..df7937f 100644 --- a/arlas-tagger/src/main/java/io/arlas/tagger/app/ArlasTagger.java +++ b/arlas-tagger/src/main/java/io/arlas/tagger/app/ArlasTagger.java @@ -38,22 +38,22 @@ import io.arlas.tagger.service.ManagedKafkaConsumers; import io.arlas.tagger.service.TagExploreService; import io.arlas.tagger.service.UpdateServices; -import io.dropwizard.Application; import io.dropwizard.assets.AssetsBundle; import io.dropwizard.configuration.EnvironmentVariableSubstitutor; import io.dropwizard.configuration.SubstitutingSourceProvider; -import io.dropwizard.setup.Bootstrap; -import io.dropwizard.setup.Environment; +import io.dropwizard.core.Application; +import io.dropwizard.core.setup.Bootstrap; +import io.dropwizard.core.setup.Environment; import io.federecio.dropwizard.swagger.SwaggerBundle; import io.federecio.dropwizard.swagger.SwaggerBundleConfiguration; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.FilterRegistration; +import jakarta.ws.rs.core.HttpHeaders; import org.eclipse.jetty.servlets.CrossOriginFilter; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.DispatcherType; -import javax.servlet.FilterRegistration; -import javax.ws.rs.core.HttpHeaders; import java.util.EnumSet; public class ArlasTagger extends Application { @@ -80,6 +80,7 @@ protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(ArlasTaggerCo @Override public void run(ArlasTaggerConfiguration configuration, Environment environment) throws Exception { configuration.check(); + LOGGER.info("Checked configuration: " + environment.getObjectMapper().writer().writeValueAsString(configuration)); CacheFactory cacheFactory = (CacheFactory) Class .forName(configuration.arlasCacheFactoryClass) diff --git a/conf/configuration.yaml b/conf/configuration.yaml index 74e7ae0..da7c391 100644 --- a/conf/configuration.yaml +++ b/conf/configuration.yaml @@ -46,9 +46,12 @@ logging: ######################################################## swagger: # Configuration of SWAGGER for generating documentation and APIs resourcePackage: io.arlas.tagger.rest # The java package to process for extracting the APIs - # temporary patch for bug https://github.com/smoketurner/dropwizard-swagger/issues/206 - # to be removed when version of dropwizard.swagger.version is upgraded - customJavascript: ${ARLAS_TAGGER_CUSTOM_JS:-/arlas/swagger-static/custom-request-interceptor.js} + # not supported in 3.0.0-1 but PR existing and merged + servers: + - url: ${ARLAS_TAGGER_PREFIX:-/arlas_tagger} + description: "Backend server from client browser" + - url: http://arlas-tagger{ARLAS_TAGGER_PREFIX:-/arlas_tagger} + description: "Backend server from docker network" kafka_configuration: kafka_commit_max_retries: ${KAFKA_COMMIT_MAX_RETRIES:-3} diff --git a/conf/doc/widdershins.json b/conf/doc/widdershins.json new file mode 100644 index 0000000..870db04 --- /dev/null +++ b/conf/doc/widdershins.json @@ -0,0 +1,6 @@ +{ + "language_tabs": [], + "omitHeader": true, + "tocSummary": true, + "codeSamples": false +} \ No newline at end of file diff --git a/conf/npm/package-build.json b/conf/npm/package-build.json index d3b3a47..300f7b0 100644 --- a/conf/npm/package-build.json +++ b/conf/npm/package-build.json @@ -8,14 +8,14 @@ }, "private": true, "dependencies": { - "portable-fetch": "3.0.0", + "isomorphic-fetch": "3.0.0", "url": "0.11.0" }, "devDependencies": { "typescript": "~2.3.3" }, "overrides": { - "portable-fetch": { + "isomorphic-fetch": { "node-fetch": "3.3.0" } } diff --git a/conf/npm/package-doc.json b/conf/npm/package-doc.json index 12dd49d..710d3b1 100644 --- a/conf/npm/package-doc.json +++ b/conf/npm/package-doc.json @@ -9,15 +9,14 @@ "private": true, "dependencies": { "es6-promise": "4.2.4", - "portable-fetch": "3.0.0", + "isomorphic-fetch": "3.0.0", "url": "0.11.0" }, "devDependencies": { - "tslint": "~5.3.2", "typescript": "^4.0.0" }, "overrides": { - "portable-fetch": { + "isomorphic-fetch": { "node-fetch": "3.3.0" } } diff --git a/conf/npm/package-publish.json b/conf/npm/package-publish.json index 4883f29..3398832 100644 --- a/conf/npm/package-publish.json +++ b/conf/npm/package-publish.json @@ -10,11 +10,11 @@ "tagger" ], "dependencies": { - "portable-fetch": "3.0.0", + "isomorphic-fetch": "3.0.0", "url": "0.11.0" }, "overrides": { - "portable-fetch": { + "isomorphic-fetch": { "node-fetch": "3.3.0" } } diff --git a/docker/docker-files/Dockerfile b/docker/docker-files/Dockerfile index 141b8b4..14fb4e4 100644 --- a/docker/docker-files/Dockerfile +++ b/docker/docker-files/Dockerfile @@ -17,7 +17,7 @@ RUN mvn install \ ################### # PACKAGING STAGE # ################### -FROM gisaia/arlas-openjdk-17-distroless:20240325094836 +FROM gisaia/arlas-openjdk-17-distroless:20240505183515 # application placed into /opt/app WORKDIR /opt/app diff --git a/docker/docker-files/Dockerfile-package-only b/docker/docker-files/Dockerfile-package-only index 507b1e4..5fc7286 100644 --- a/docker/docker-files/Dockerfile-package-only +++ b/docker/docker-files/Dockerfile-package-only @@ -1,7 +1,7 @@ ################### # PACKAGING STAGE # ################### -FROM gisaia/arlas-openjdk-17-distroless:20240325094836 +FROM gisaia/arlas-openjdk-17-distroless:20240505183515 # application placed into /opt/app WORKDIR /opt/app diff --git a/docker/docker-files/docker-compose-arlas-server.yml b/docker/docker-files/docker-compose-arlas-server.yml index 8a8f3cc..ba877c2 100644 --- a/docker/docker-files/docker-compose-arlas-server.yml +++ b/docker/docker-files/docker-compose-arlas-server.yml @@ -2,7 +2,7 @@ version: '3' services: arlas-server: - image: gisaia/arlas-server:${ARLAS_VERSION:-24.1.2} + image: gisaia/arlas-server:${ARLAS_VERSION:-25.0.0} container_name: arlas-server restart: always environment: diff --git a/docker/docker-files/docker-compose-elasticsearch.yml b/docker/docker-files/docker-compose-elasticsearch.yml index 78a9a5c..5a971aa 100644 --- a/docker/docker-files/docker-compose-elasticsearch.yml +++ b/docker/docker-files/docker-compose-elasticsearch.yml @@ -2,7 +2,7 @@ version: '3' services: elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION:-8.7.0} + image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION:-8.13.3} container_name: elasticsearch restart: always environment: diff --git a/docs/api/definitions.md b/docs/api/definitions.md deleted file mode 100644 index e3fb6ae..0000000 --- a/docs/api/definitions.md +++ /dev/null @@ -1,158 +0,0 @@ - - -## Definitions - - -### Error - -|Name|Schema| -|---|---| -|**error**
*optional*|string| -|**message**
*optional*|string| -|**status**
*optional*|integer (int32)| - - - -### Expression - -|Name|Schema| -|---|---| -|**field**
*optional*|string| -|**op**
*optional*|enum (eq, gte, gt, lte, lt, like, ne, range, within, notwithin, intersects, notintersects)| -|**value**
*optional*|string| - - - -### Failure - -|Name|Schema| -|---|---| -|**id**
*optional*|string| -|**message**
*optional*|string| -|**type**
*optional*|string| - - - -### Filter - -|Name|Schema| -|---|---| -|**dateformat**
*optional*|string| -|**f**
*optional*|< < [Expression](#expression) > array > array| -|**q**
*optional*|< < string > array > array| -|**righthand**
*optional*|boolean| - - - -### Form - -|Name|Schema| -|---|---| -|**flat**
*optional*|boolean| -|**pretty**
*optional*|boolean| - - - -### Page - -|Name|Schema| -|---|---| -|**after**
*optional*|string| -|**before**
*optional*|string| -|**from**
*optional*|integer (int32)| -|**size**
*optional*|integer (int32)| -|**sort**
*optional*|string| - - - -### Projection - -|Name|Schema| -|---|---| -|**excludes**
*optional*|string| -|**includes**
*optional*|string| - - - -### Propagation - -|Name|Schema| -|---|---| -|**field**
*optional*|string| -|**filter**
*optional*|[Filter](#filter)| - - - -### Search - -|Name|Schema| -|---|---| -|**filter**
*optional*|[Filter](#filter)| -|**form**
*optional*|[Form](#form)| -|**page**
*optional*|[Page](#page)| -|**projection**
*optional*|[Projection](#projection)| -|**returned_geometries**
*optional*|string| - - - -### Tag - -|Name|Schema| -|---|---| -|**path**
*optional*|string| -|**value**
*optional*|object| - - - -### TagRefRequest - -|Name|Schema| -|---|---| -|**action**
*optional*|enum (ADD, REMOVE, REMOVEALL)| -|**collection**
*optional*|string| -|**creationTime**
*optional*|integer (int64)| -|**filter**
*optional*|[Filter](#filter)| -|**form**
*optional*|[Form](#form)| -|**id**
*optional*|string| -|**label**
*optional*|string| -|**offset**
*optional*|integer (int64)| -|**partitionFilter**
*optional*|string| -|**propagated**
*optional*|integer (int64)| -|**propagation**
*optional*|[Propagation](#propagation)| -|**search**
*optional*|[Search](#search)| -|**tag**
*optional*|[Tag](#tag)| - - - -### TagRequest - -|Name|Schema| -|---|---| -|**filter**
*optional*|[Filter](#filter)| -|**form**
*optional*|[Form](#form)| -|**label**
*optional*|string| -|**propagation**
*optional*|[Propagation](#propagation)| -|**search**
*optional*|[Search](#search)| -|**tag**
*optional*|[Tag](#tag)| - - - -### UpdateResponse - -|Name|Schema| -|---|---| -|**action**
*optional*|enum (ADD, REMOVE, REMOVEALL)| -|**endTime**
*optional*|integer (int64)| -|**failed**
*optional*|integer (int64)| -|**failures**
*optional*|< [Failure](#failure) > array| -|**id**
*optional*|string| -|**label**
*optional*|string| -|**nbRequest**
*optional*|integer (int64)| -|**processingTimeMs**
*optional*|integer (int64)| -|**progress**
*optional*|number (float)| -|**propagated**
*optional*|integer (int64)| -|**startTime**
*optional*|integer (int64)| -|**updated**
*optional*|integer (int64)| - - - diff --git a/docs/api/overview.md b/docs/api/overview.md deleted file mode 100644 index cfc34a4..0000000 --- a/docs/api/overview.md +++ /dev/null @@ -1,35 +0,0 @@ -# ARLAS Tagger API - - - -## Overview -(Un)Tag fields of ARLAS collections - - -### Version information -*Version* : 24.1.0 - - -### Contact information -*Contact* : Gisaia -*Contact Email* : contact@gisaia.com - - -### License information -*License* : Apache 2.0 -*License URL* : https://www.apache.org/licenses/LICENSE-2.0.html -*Terms of service* : null - - -### URI scheme -*BasePath* : /arlas_tagger -*Schemes* : HTTP, HTTPS - - -### Tags - -* status -* write - - - diff --git a/docs/api/paths.md b/docs/api/paths.md deleted file mode 100644 index b88267c..0000000 --- a/docs/api/paths.md +++ /dev/null @@ -1,205 +0,0 @@ - - -## Resources - - -### Status - - -#### TagStatus -``` -GET /status/{collection}/_tag/{id} -``` - - -##### Description -Get the status of the (un)tagging operation, given the id of a previously requested operation - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Path**|**id**
*required*|The id of a previously requested (un)tag operation.|string|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[UpdateResponse](#updateresponse)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### TagList -``` -GET /status/{collection}/_taglist -``` - - -##### Description -Get the list of previously submitted tag requests - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|< [TagRefRequest](#tagrefrequest) > array| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -### Write - - -#### Tag -``` -POST /write/{collection}/_tag -``` - - -##### Description -Search and tag the elements found in the collection, given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**body**
*optional*||[TagRequest](#tagrequest)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[UpdateResponse](#updateresponse)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### TagReplay -``` -POST /write/{collection}/_tagreplay -``` - - -##### Description -Scan the tagref topic and replay tagging operations from the given offset - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**offset**
*required*|The offset from which the replay must be done.|integer (int64)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|integer (int64)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Untag -``` -POST /write/{collection}/_untag -``` - - -##### Description -Search and untag the elements found in the collection, given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**body**
*optional*||[TagRequest](#tagrequest)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[UpdateResponse](#updateresponse)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - diff --git a/docs/api/reference.md b/docs/api/reference.md new file mode 100644 index 0000000..44ced00 --- /dev/null +++ b/docs/api/reference.md @@ -0,0 +1,1263 @@ + + +

ARLAS Tagger APIs vAPI_VERSION

+ +> Scroll down for example requests and responses. + +(Un)Tag fields of ARLAS collections + +Base URLs: + +* /arlas_tagger + +Email: Gisaia Web: Gisaia +License: Apache 2.0 + +

write

+ +Tagger API + +## Tag + + + +`POST /write/{collection}/_tag` + +Search and tag the elements found in the collection, given the filters + +> Body parameter + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "search": { + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "page": { + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" + }, + "projection": { + "includes": "string", + "excludes": "string" + }, + "returned_geometries": "string" + }, + "tag": { + "path": "string", + "value": {} + }, + "propagation": { + "field": "string", + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + } + }, + "label": "string" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|body|body|[TagRequest](#schematagrequest)|false|none| + +> Example responses + +> 200 Response + +```json +{ + "id": "string", + "label": "string", + "action": "ADD", + "failures": [ + { + "id": "string", + "message": "string", + "type": "string" + } + ], + "failed": 0, + "updated": 0, + "progress": 0.1, + "nbRequest": 0, + "propagated": 0, + "startTime": 0, + "endTime": 0, + "processingTimeMs": 0 +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[UpdateResponse](#schemaupdateresponse)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## TagReplay + + + +`POST /write/{collection}/_tagreplay` + +Scan the tagref topic and replay tagging operations from the given offset + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|offset|query|integer(int64)|true|The offset from which the replay must be done.| +|pretty|query|boolean|false|Pretty print| + +> Example responses + +> 200 Response + +```json +0 +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|integer| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## Untag + + + +`POST /write/{collection}/_untag` + +Search and untag the elements found in the collection, given the filters + +> Body parameter + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "search": { + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "page": { + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" + }, + "projection": { + "includes": "string", + "excludes": "string" + }, + "returned_geometries": "string" + }, + "tag": { + "path": "string", + "value": {} + }, + "propagation": { + "field": "string", + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + } + }, + "label": "string" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|body|body|[TagRequest](#schematagrequest)|false|none| + +> Example responses + +> 200 Response + +```json +{ + "id": "string", + "label": "string", + "action": "ADD", + "failures": [ + { + "id": "string", + "message": "string", + "type": "string" + } + ], + "failed": 0, + "updated": 0, + "progress": 0.1, + "nbRequest": 0, + "propagated": 0, + "startTime": 0, + "endTime": 0, + "processingTimeMs": 0 +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[UpdateResponse](#schemaupdateresponse)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +

status

+ +Tagger status API + +## TagStatus + + + +`GET /status/{collection}/_tag/{id}` + +Get the status of the (un)tagging operation, given the id of a previously requested operation + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|id|path|string|true|The id of a previously requested (un)tag operation.| +|pretty|query|boolean|false|Pretty print| + +> Example responses + +> 200 Response + +```json +{ + "id": "string", + "label": "string", + "action": "ADD", + "failures": [ + { + "id": "string", + "message": "string", + "type": "string" + } + ], + "failed": 0, + "updated": 0, + "progress": 0.1, + "nbRequest": 0, + "propagated": 0, + "startTime": 0, + "endTime": 0, + "processingTimeMs": 0 +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[UpdateResponse](#schemaupdateresponse)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## TagList + + + +`GET /status/{collection}/_taglist` + +Get the list of previously submitted tag requests + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| + +> Example responses + +> 200 Response + +```json +[ + { + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "search": { + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "page": { + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" + }, + "projection": { + "includes": "string", + "excludes": "string" + }, + "returned_geometries": "string" + }, + "tag": { + "path": "string", + "value": {} + }, + "propagation": { + "field": "string", + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + } + }, + "label": "string", + "id": "string", + "action": "ADD", + "collection": "string", + "partitionFilter": "string", + "propagated": 0, + "creationTime": 0, + "offset": 0 + } +] +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|Inline| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + +

Response Schema

+ +Status Code **200** + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[[TagRefRequest](#schematagrefrequest)]|false|none|none| +|» filter|[Filter](#schemafilter)|false|none|none| +|»» f|[array]|false|none|none| +|»»» field|string|false|none|none| +|»»» op|string|false|none|none| +|»»» value|string|false|none|none| +|»»» empty|boolean|false|none|none| +|q|[array]|false|none|none| +|» empty|boolean|false|none|none| +|dateformat|string|false|none|none| +|righthand|boolean|false|none|none| +|form|[Form](#schemaform)|false|none|none| +|» pretty|boolean|false|none|none| +|» flat|boolean|false|none|none| +|search|[Search](#schemasearch)|false|none|none| +|» filter|[Filter](#schemafilter)|false|none|none| +|» form|[Form](#schemaform)|false|none|none| +|» page|[Page](#schemapage)|false|none|none| +|»» size|integer(int32)|false|none|none| +|»» from|integer(int32)|false|none|none| +|»» sort|string|false|none|none| +|»» after|string|false|none|none| +|»» before|string|false|none|none| +|» projection|[Projection](#schemaprojection)|false|none|none| +|»» includes|string|false|none|none| +|»» excludes|string|false|none|none| +|» returned_geometries|string|false|none|none| +|tag|[Tag](#schematag)|false|none|none| +|» path|string|false|none|none| +|» value|object|false|none|none| +|propagation|[Propagation](#schemapropagation)|false|none|none| +|» field|string|false|none|none| +|» filter|[Filter](#schemafilter)|false|none|none| +|label|string|false|none|none| +|id|string|false|none|none| +|action|string|false|none|none| +|collection|string|false|none|none| +|partitionFilter|string|false|none|none| +|propagated|integer(int64)|false|none|none| +|creationTime|integer(int64)|false|none|none| +|offset|integer(int64)|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|op|eq| +|op|gte| +|op|gt| +|op|lte| +|op|lt| +|op|like| +|op|ne| +|op|range| +|op|within| +|op|notwithin| +|op|intersects| +|op|notintersects| +|action|ADD| +|action|REMOVE| +|action|REMOVEALL| + + + +# Schemas + +

Failure

+ + + + + + +```json +{ + "id": "string", + "message": "string", + "type": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|id|string|false|none|none| +|message|string|false|none|none| +|type|string|false|none|none| + +

UpdateResponse

+ + + + + + +```json +{ + "id": "string", + "label": "string", + "action": "ADD", + "failures": [ + { + "id": "string", + "message": "string", + "type": "string" + } + ], + "failed": 0, + "updated": 0, + "progress": 0.1, + "nbRequest": 0, + "propagated": 0, + "startTime": 0, + "endTime": 0, + "processingTimeMs": 0 +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|id|string|false|none|none| +|label|string|false|none|none| +|action|string|false|none|none| +|failures|[[Failure](#schemafailure)]|false|none|none| +|failed|integer(int64)|false|none|none| +|updated|integer(int64)|false|none|none| +|progress|number(float)|false|none|none| +|nbRequest|integer(int64)|false|none|none| +|propagated|integer(int64)|false|none|none| +|startTime|integer(int64)|false|none|none| +|endTime|integer(int64)|false|none|none| +|processingTimeMs|integer(int64)|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|action|ADD| +|action|REMOVE| +|action|REMOVEALL| + +

Error

+ + + + + + +```json +{ + "status": 0, + "message": "string", + "error": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|status|integer(int32)|false|none|none| +|message|string|false|none|none| +|error|string|false|none|none| + +

Expression

+ + + + + + +```json +{ + "field": "string", + "op": "eq", + "value": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|field|string|false|none|none| +|op|string|false|none|none| +|value|string|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|op|eq| +|op|gte| +|op|gt| +|op|lte| +|op|lt| +|op|like| +|op|ne| +|op|range| +|op|within| +|op|notwithin| +|op|intersects| +|op|notintersects| + +

Filter

+ + + + + + +```json +{ + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|f|[array]|false|none|none| +|» empty|boolean|false|none|none| +|q|[array]|false|none|none| +|» empty|boolean|false|none|none| +|dateformat|string|false|none|none| +|righthand|boolean|false|none|none| + +

Form

+ + + + + + +```json +{ + "pretty": true, + "flat": true +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|pretty|boolean|false|none|none| +|flat|boolean|false|none|none| + +

MultiValueFilterExpression

+ + + + + + +```json +[ + { + "field": "string", + "op": "eq", + "value": "string" + } +] + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[[Expression](#schemaexpression)]|false|none|none| +|empty|boolean|false|none|none| + +

MultiValueFilterString

+ + + + + + +```json +[ + "string" +] + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|empty|boolean|false|none|none| + +

Page

+ + + + + + +```json +{ + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|size|integer(int32)|false|none|none| +|from|integer(int32)|false|none|none| +|sort|string|false|none|none| +|after|string|false|none|none| +|before|string|false|none|none| + +

Projection

+ + + + + + +```json +{ + "includes": "string", + "excludes": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|includes|string|false|none|none| +|excludes|string|false|none|none| + +

Propagation

+ + + + + + +```json +{ + "field": "string", + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|field|string|false|none|none| +|filter|[Filter](#schemafilter)|false|none|none| + + + + + + + + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "page": { + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" + }, + "projection": { + "includes": "string", + "excludes": "string" + }, + "returned_geometries": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|filter|[Filter](#schemafilter)|false|none|none| +|form|[Form](#schemaform)|false|none|none| +|page|[Page](#schemapage)|false|none|none| +|projection|[Projection](#schemaprojection)|false|none|none| +|returned_geometries|string|false|none|none| + +

Tag

+ + + + + + +```json +{ + "path": "string", + "value": {} +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|path|string|false|none|none| +|value|object|false|none|none| + +

TagRequest

+ + + + + + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "search": { + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "page": { + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" + }, + "projection": { + "includes": "string", + "excludes": "string" + }, + "returned_geometries": "string" + }, + "tag": { + "path": "string", + "value": {} + }, + "propagation": { + "field": "string", + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + } + }, + "label": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|filter|[Filter](#schemafilter)|false|none|none| +|form|[Form](#schemaform)|false|none|none| +|search|[Search](#schemasearch)|false|none|none| +|tag|[Tag](#schematag)|false|none|none| +|propagation|[Propagation](#schemapropagation)|false|none|none| +|label|string|false|none|none| + +

TagRefRequest

+ + + + + + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "search": { + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "page": { + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" + }, + "projection": { + "includes": "string", + "excludes": "string" + }, + "returned_geometries": "string" + }, + "tag": { + "path": "string", + "value": {} + }, + "propagation": { + "field": "string", + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + } + }, + "label": "string", + "id": "string", + "action": "ADD", + "collection": "string", + "partitionFilter": "string", + "propagated": 0, + "creationTime": 0, + "offset": 0 +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|filter|[Filter](#schemafilter)|false|none|none| +|form|[Form](#schemaform)|false|none|none| +|search|[Search](#schemasearch)|false|none|none| +|tag|[Tag](#schematag)|false|none|none| +|propagation|[Propagation](#schemapropagation)|false|none|none| +|label|string|false|none|none| +|id|string|false|none|none| +|action|string|false|none|none| +|collection|string|false|none|none| +|partitionFilter|string|false|none|none| +|propagated|integer(int64)|false|none|none| +|creationTime|integer(int64)|false|none|none| +|offset|integer(int64)|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|action|ADD| +|action|REMOVE| +|action|REMOVEALL| + diff --git a/docs/api/security.md b/docs/api/security.md deleted file mode 100644 index 139597f..0000000 --- a/docs/api/security.md +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/docs/arlas-tagger-overview.md b/docs/arlas-tagger-overview.md index 775ce58..76c685d 100644 --- a/docs/arlas-tagger-overview.md +++ b/docs/arlas-tagger-overview.md @@ -11,18 +11,18 @@ The ARLAS Tagger offers 3 APIs: The monitoring API provides some information about the health and the performances of the ARLAS Tagger that can be of interest: -| URL | Description | -| --- | --- | -| http://.../admin/metrics?pretty=true | Metrics about the performances of the ARLAS Tagger. Metrics about the `write` and `status` APIs are prefixed with `io.arlas.tagger`| -| http://.../admin/ping | Returns pong | -| http://.../admin/threads | List of running threads | -| http://.../admin/healthcheck?pretty=true | Whether the service is healthy or not | +| URL | Description | +|------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------| +| http://.../admin/metrics?pretty=true | Metrics about the performances of the ARLAS Tagger. Metrics about the `write` and `status` APIs are prefixed with `io.arlas.tagger` | +| http://.../admin/ping | Returns pong | +| http://.../admin/threads | List of running threads | +| http://.../admin/healthcheck?pretty=true | Whether the service is healthy or not | ## Swagger -| URL | Description | -| --- | --- | -| http://.../arlas/swagger | The web application for testing the API | -| http://.../arlas/swagger.yaml | The swagger definition of the collections/exploration API with YAML format | -| http://.../arlas/swagger.json | The swagger definition of the collections/exploration API with JSON format | +| URL | Description | +|--------------------------------------|----------------------------------------------------------------------------| +| http://.../arlas_tagger/swagger | The web application for testing the API | +| http://.../arlas_tagger/openapi.yaml | The swagger definition of the collections/exploration API with YAML format | +| http://.../arlas_tagger/openapi.json | The swagger definition of the collections/exploration API with JSON format | diff --git a/mkDocs.sh b/mkDocs.sh index f0cc246..c6e78a9 100755 --- a/mkDocs.sh +++ b/mkDocs.sh @@ -30,9 +30,9 @@ docker run --rm \ echo "=> Generate API" docker run --rm \ - --mount dst=/input/api.json,src="$PWD/openapi/swagger.json",type=bind,ro \ + --mount dst=/input/api.json,src="$PWD/openapi/openapi.json",type=bind,ro \ --mount dst=/output,src="$PWD/target/tmp/typescript-fetch",type=bind \ - gisaia/swagger-codegen-2.4.14 \ + gisaia/swagger-codegen-3.0.42 \ -l typescript-fetch --additional-properties modelPropertyNaming=snake_case echo "=> Generate Typescript client documentation" @@ -60,10 +60,7 @@ docker run --rm \ -v $PWD:/opt/maven \ -v $HOME/.m2:/root/.m2 \ busybox \ - sh -c 'cat /opt/maven/docs/api/overview.md > /opt/maven/target/generated-docs/tagger_reference.md \ - && cat /opt/maven/docs/api/paths.md >> /opt/maven/target/generated-docs/tagger_reference.md \ - && cat /opt/maven/docs/api/definitions.md >> /opt/maven/target/generated-docs/tagger_reference.md \ - && cat /opt/maven/docs/api/security.md >> /opt/maven/target/generated-docs/tagger_reference.md' + sh -c 'cat /opt/maven/docs/api/reference.md > /opt/maven/target/generated-docs/reference.md' echo "=> Copy CHANGELOG.md" docker run --rm \ @@ -77,7 +74,7 @@ if [[ ! -f ${BASEDIR}/target/generated-docs/typescript-doc/classes/WriteApi.md ] echo 'File "_api_.writeapi.md" was not generated, aborting.' exit -1 fi -if [[ ! -f ${BASEDIR}/target/generated-docs/tagger_reference.md ]] ; then - echo 'File "tagger_reference.md" was not generated, aborting.' +if [[ ! -f ${BASEDIR}/target/generated-docs/reference.md ]] ; then + echo 'File "reference.md" was not generated, aborting.' exit -1 fi \ No newline at end of file diff --git a/openapi/openapi.json b/openapi/openapi.json new file mode 100644 index 0000000..6027990 --- /dev/null +++ b/openapi/openapi.json @@ -0,0 +1,677 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "ARLAS Tagger APIs", + "description" : "(Un)Tag fields of ARLAS collections", + "contact" : { + "name" : "Gisaia", + "url" : "http://www.gisaia.com/", + "email" : "contact@gisaia.com" + }, + "license" : { + "name" : "Apache 2.0", + "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version" : "API_VERSION" + }, + "externalDocs" : { + "description" : "API documentation", + "url" : "https://docs.arlas.io/arlas-api/" + }, + "servers" : [ { + "url" : "/arlas_tagger", + "description" : "default server" + } ], + "tags" : [ { + "name" : "write", + "description" : "Tagger API" + }, { + "name" : "status", + "description" : "Tagger status API" + } ], + "paths" : { + "/write/{collection}/_tag" : { + "post" : { + "tags" : [ "write" ], + "summary" : "Tag", + "description" : "Search and tag the elements found in the collection, given the filters", + "operationId" : "tagPost", + "parameters" : [ { + "name" : "collection", + "in" : "path", + "description" : "collection", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "pretty", + "in" : "query", + "description" : "Pretty print", + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "requestBody" : { + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/TagRequest" + } + } + } + }, + "responses" : { + "200" : { + "description" : "Successful operation", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/UpdateResponse" + } + } + } + }, + "500" : { + "description" : "Arlas Server Error.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/write/{collection}/_tagreplay" : { + "post" : { + "tags" : [ "write" ], + "summary" : "TagReplay", + "description" : "Scan the tagref topic and replay tagging operations from the given offset", + "operationId" : "tagReplay", + "parameters" : [ { + "name" : "collection", + "in" : "path", + "description" : "collection", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "offset", + "in" : "query", + "description" : "The offset from which the replay must be done.", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + }, { + "name" : "pretty", + "in" : "query", + "description" : "Pretty print", + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "responses" : { + "200" : { + "description" : "Successful operation", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "type" : "integer", + "format" : "int64" + } + } + } + }, + "500" : { + "description" : "Arlas Server Error.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/write/{collection}/_untag" : { + "post" : { + "tags" : [ "write" ], + "summary" : "Untag", + "description" : "Search and untag the elements found in the collection, given the filters", + "operationId" : "untagPost", + "parameters" : [ { + "name" : "collection", + "in" : "path", + "description" : "collection", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "pretty", + "in" : "query", + "description" : "Pretty print", + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "requestBody" : { + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/TagRequest" + } + } + } + }, + "responses" : { + "200" : { + "description" : "Successful operation", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/UpdateResponse" + } + } + } + }, + "500" : { + "description" : "Arlas Server Error.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/status/{collection}/_tag/{id}" : { + "get" : { + "tags" : [ "status" ], + "summary" : "TagStatus", + "description" : "Get the status of the (un)tagging operation, given the id of a previously requested operation", + "operationId" : "taggingGet", + "parameters" : [ { + "name" : "collection", + "in" : "path", + "description" : "collection", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "id", + "in" : "path", + "description" : "The id of a previously requested (un)tag operation.", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "pretty", + "in" : "query", + "description" : "Pretty print", + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "responses" : { + "200" : { + "description" : "Successful operation", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/UpdateResponse" + } + } + } + }, + "500" : { + "description" : "Arlas Server Error.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/status/{collection}/_taglist" : { + "get" : { + "tags" : [ "status" ], + "summary" : "TagList", + "description" : "Get the list of previously submitted tag requests", + "operationId" : "taggingGetList", + "parameters" : [ { + "name" : "collection", + "in" : "path", + "description" : "collection", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "pretty", + "in" : "query", + "description" : "Pretty print", + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "responses" : { + "200" : { + "description" : "Successful operation", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/TagRefRequest" + } + } + } + } + }, + "500" : { + "description" : "Arlas Server Error.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + } + } + } + }, + "components" : { + "schemas" : { + "Failure" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "message" : { + "type" : "string" + }, + "type" : { + "type" : "string" + } + } + }, + "UpdateResponse" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "label" : { + "type" : "string" + }, + "action" : { + "type" : "string", + "enum" : [ "ADD", "REMOVE", "REMOVEALL" ] + }, + "failures" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Failure" + } + }, + "failed" : { + "type" : "integer", + "format" : "int64" + }, + "updated" : { + "type" : "integer", + "format" : "int64" + }, + "progress" : { + "type" : "number", + "format" : "float" + }, + "nbRequest" : { + "type" : "integer", + "format" : "int64" + }, + "propagated" : { + "type" : "integer", + "format" : "int64" + }, + "startTime" : { + "type" : "integer", + "format" : "int64" + }, + "endTime" : { + "type" : "integer", + "format" : "int64" + }, + "processingTimeMs" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "Error" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "integer", + "format" : "int32" + }, + "message" : { + "type" : "string" + }, + "error" : { + "type" : "string" + } + } + }, + "Expression" : { + "type" : "object", + "properties" : { + "field" : { + "type" : "string" + }, + "op" : { + "type" : "string", + "enum" : [ "eq", "gte", "gt", "lte", "lt", "like", "ne", "range", "within", "notwithin", "intersects", "notintersects" ] + }, + "value" : { + "type" : "string" + } + } + }, + "Filter" : { + "type" : "object", + "properties" : { + "f" : { + "type" : "array", + "items" : { + "type" : "array", + "properties" : { + "empty" : { + "type" : "boolean" + } + }, + "items" : { + "$ref" : "#/components/schemas/Expression" + } + } + }, + "q" : { + "type" : "array", + "items" : { + "type" : "array", + "properties" : { + "empty" : { + "type" : "boolean" + } + }, + "items" : { + "type" : "string" + } + } + }, + "dateformat" : { + "type" : "string" + }, + "righthand" : { + "type" : "boolean" + } + } + }, + "Form" : { + "type" : "object", + "properties" : { + "pretty" : { + "type" : "boolean" + }, + "flat" : { + "type" : "boolean" + } + } + }, + "MultiValueFilterExpression" : { + "type" : "array", + "properties" : { + "empty" : { + "type" : "boolean" + } + }, + "items" : { + "$ref" : "#/components/schemas/Expression" + } + }, + "MultiValueFilterString" : { + "type" : "array", + "properties" : { + "empty" : { + "type" : "boolean" + } + }, + "items" : { + "type" : "string" + } + }, + "Page" : { + "type" : "object", + "properties" : { + "size" : { + "type" : "integer", + "format" : "int32" + }, + "from" : { + "type" : "integer", + "format" : "int32" + }, + "sort" : { + "type" : "string" + }, + "after" : { + "type" : "string" + }, + "before" : { + "type" : "string" + } + } + }, + "Projection" : { + "type" : "object", + "properties" : { + "includes" : { + "type" : "string" + }, + "excludes" : { + "type" : "string" + } + } + }, + "Propagation" : { + "type" : "object", + "properties" : { + "field" : { + "type" : "string" + }, + "filter" : { + "$ref" : "#/components/schemas/Filter" + } + } + }, + "Search" : { + "type" : "object", + "properties" : { + "filter" : { + "$ref" : "#/components/schemas/Filter" + }, + "form" : { + "$ref" : "#/components/schemas/Form" + }, + "page" : { + "$ref" : "#/components/schemas/Page" + }, + "projection" : { + "$ref" : "#/components/schemas/Projection" + }, + "returned_geometries" : { + "type" : "string" + } + } + }, + "Tag" : { + "type" : "object", + "properties" : { + "path" : { + "type" : "string" + }, + "value" : { + "type" : "object" + } + } + }, + "TagRequest" : { + "type" : "object", + "properties" : { + "filter" : { + "$ref" : "#/components/schemas/Filter" + }, + "form" : { + "$ref" : "#/components/schemas/Form" + }, + "search" : { + "$ref" : "#/components/schemas/Search" + }, + "tag" : { + "$ref" : "#/components/schemas/Tag" + }, + "propagation" : { + "$ref" : "#/components/schemas/Propagation" + }, + "label" : { + "type" : "string" + } + } + }, + "TagRefRequest" : { + "type" : "object", + "properties" : { + "filter" : { + "$ref" : "#/components/schemas/Filter" + }, + "form" : { + "$ref" : "#/components/schemas/Form" + }, + "search" : { + "$ref" : "#/components/schemas/Search" + }, + "tag" : { + "$ref" : "#/components/schemas/Tag" + }, + "propagation" : { + "$ref" : "#/components/schemas/Propagation" + }, + "label" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "action" : { + "type" : "string", + "enum" : [ "ADD", "REMOVE", "REMOVEALL" ] + }, + "collection" : { + "type" : "string" + }, + "partitionFilter" : { + "type" : "string" + }, + "propagated" : { + "type" : "integer", + "format" : "int64" + }, + "creationTime" : { + "type" : "integer", + "format" : "int64" + }, + "offset" : { + "type" : "integer", + "format" : "int64" + } + } + } + } + } +} \ No newline at end of file diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml new file mode 100644 index 0000000..f308812 --- /dev/null +++ b/openapi/openapi.yaml @@ -0,0 +1,479 @@ +openapi: 3.0.1 +info: + title: ARLAS Tagger APIs + description: (Un)Tag fields of ARLAS collections + contact: + name: Gisaia + url: http://www.gisaia.com/ + email: contact@gisaia.com + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + version: API_VERSION +externalDocs: + description: API documentation + url: https://docs.arlas.io/arlas-api/ +servers: +- url: /arlas_tagger + description: default server +tags: +- name: write + description: Tagger API +- name: status + description: Tagger status API +paths: + /write/{collection}/_tag: + post: + tags: + - write + summary: Tag + description: "Search and tag the elements found in the collection, given the\ + \ filters" + operationId: tagPost + parameters: + - name: collection + in: path + description: collection + required: true + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + requestBody: + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + "200": + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/UpdateResponse' + "500": + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + "400": + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /write/{collection}/_tagreplay: + post: + tags: + - write + summary: TagReplay + description: Scan the tagref topic and replay tagging operations from the given + offset + operationId: tagReplay + parameters: + - name: collection + in: path + description: collection + required: true + schema: + type: string + - name: offset + in: query + description: The offset from which the replay must be done. + required: true + schema: + type: integer + format: int64 + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + responses: + "200": + description: Successful operation + content: + application/json;charset=utf-8: + schema: + type: integer + format: int64 + "500": + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + "400": + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /write/{collection}/_untag: + post: + tags: + - write + summary: Untag + description: "Search and untag the elements found in the collection, given the\ + \ filters" + operationId: untagPost + parameters: + - name: collection + in: path + description: collection + required: true + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + requestBody: + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/TagRequest' + responses: + "200": + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/UpdateResponse' + "500": + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + "400": + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /status/{collection}/_tag/{id}: + get: + tags: + - status + summary: TagStatus + description: "Get the status of the (un)tagging operation, given the id of a\ + \ previously requested operation" + operationId: taggingGet + parameters: + - name: collection + in: path + description: collection + required: true + schema: + type: string + - name: id + in: path + description: The id of a previously requested (un)tag operation. + required: true + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + responses: + "200": + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/UpdateResponse' + "500": + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + "400": + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /status/{collection}/_taglist: + get: + tags: + - status + summary: TagList + description: Get the list of previously submitted tag requests + operationId: taggingGetList + parameters: + - name: collection + in: path + description: collection + required: true + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + responses: + "200": + description: Successful operation + content: + application/json;charset=utf-8: + schema: + type: array + items: + $ref: '#/components/schemas/TagRefRequest' + "500": + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + "400": + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' +components: + schemas: + Failure: + type: object + properties: + id: + type: string + message: + type: string + type: + type: string + UpdateResponse: + type: object + properties: + id: + type: string + label: + type: string + action: + type: string + enum: + - ADD + - REMOVE + - REMOVEALL + failures: + type: array + items: + $ref: '#/components/schemas/Failure' + failed: + type: integer + format: int64 + updated: + type: integer + format: int64 + progress: + type: number + format: float + nbRequest: + type: integer + format: int64 + propagated: + type: integer + format: int64 + startTime: + type: integer + format: int64 + endTime: + type: integer + format: int64 + processingTimeMs: + type: integer + format: int64 + Error: + type: object + properties: + status: + type: integer + format: int32 + message: + type: string + error: + type: string + Expression: + type: object + properties: + field: + type: string + op: + type: string + enum: + - eq + - gte + - gt + - lte + - lt + - like + - ne + - range + - within + - notwithin + - intersects + - notintersects + value: + type: string + Filter: + type: object + properties: + f: + type: array + items: + type: array + properties: + empty: + type: boolean + items: + $ref: '#/components/schemas/Expression' + q: + type: array + items: + type: array + properties: + empty: + type: boolean + items: + type: string + dateformat: + type: string + righthand: + type: boolean + Form: + type: object + properties: + pretty: + type: boolean + flat: + type: boolean + MultiValueFilterExpression: + type: array + properties: + empty: + type: boolean + items: + $ref: '#/components/schemas/Expression' + MultiValueFilterString: + type: array + properties: + empty: + type: boolean + items: + type: string + Page: + type: object + properties: + size: + type: integer + format: int32 + from: + type: integer + format: int32 + sort: + type: string + after: + type: string + before: + type: string + Projection: + type: object + properties: + includes: + type: string + excludes: + type: string + Propagation: + type: object + properties: + field: + type: string + filter: + $ref: '#/components/schemas/Filter' + Search: + type: object + properties: + filter: + $ref: '#/components/schemas/Filter' + form: + $ref: '#/components/schemas/Form' + page: + $ref: '#/components/schemas/Page' + projection: + $ref: '#/components/schemas/Projection' + returned_geometries: + type: string + Tag: + type: object + properties: + path: + type: string + value: + type: object + TagRequest: + type: object + properties: + filter: + $ref: '#/components/schemas/Filter' + form: + $ref: '#/components/schemas/Form' + search: + $ref: '#/components/schemas/Search' + tag: + $ref: '#/components/schemas/Tag' + propagation: + $ref: '#/components/schemas/Propagation' + label: + type: string + TagRefRequest: + type: object + properties: + filter: + $ref: '#/components/schemas/Filter' + form: + $ref: '#/components/schemas/Form' + search: + $ref: '#/components/schemas/Search' + tag: + $ref: '#/components/schemas/Tag' + propagation: + $ref: '#/components/schemas/Propagation' + label: + type: string + id: + type: string + action: + type: string + enum: + - ADD + - REMOVE + - REMOVEALL + collection: + type: string + partitionFilter: + type: string + propagated: + type: integer + format: int64 + creationTime: + type: integer + format: int64 + offset: + type: integer + format: int64 diff --git a/openapi/swagger.json b/openapi/swagger.json deleted file mode 100644 index 17305be..0000000 --- a/openapi/swagger.json +++ /dev/null @@ -1,562 +0,0 @@ -{ - "swagger" : "2.0", - "info" : { - "description" : "(Un)Tag fields of ARLAS collections", - "version" : "24.1.1-SNAPSHOT", - "title" : "ARLAS Tagger API", - "contact" : { - "name" : "Gisaia", - "url" : "http://www.gisaia.com/", - "email" : "contact@gisaia.com" - }, - "license" : { - "name" : "Apache 2.0", - "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "basePath" : "/arlas_tagger", - "tags" : [ { - "name" : "write" - }, { - "name" : "status" - } ], - "schemes" : [ "http", "https" ], - "paths" : { - "/write/{collection}/_tag" : { - "post" : { - "tags" : [ "write" ], - "summary" : "Tag", - "description" : "Search and tag the elements found in the collection, given the filters", - "operationId" : "tagPost", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], - "parameters" : [ { - "name" : "collection", - "in" : "path", - "description" : "collection", - "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/TagRequest" - } - }, { - "name" : "pretty", - "in" : "query", - "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false - } ], - "responses" : { - "200" : { - "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/UpdateResponse" - } - }, - "500" : { - "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" - } - }, - "400" : { - "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" - } - } - } - } - }, - "/write/{collection}/_tagreplay" : { - "post" : { - "tags" : [ "write" ], - "summary" : "TagReplay", - "description" : "Scan the tagref topic and replay tagging operations from the given offset", - "operationId" : "tagReplay", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], - "parameters" : [ { - "name" : "collection", - "in" : "path", - "description" : "collection", - "required" : true, - "type" : "string" - }, { - "name" : "offset", - "in" : "query", - "description" : "The offset from which the replay must be done.", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "pretty", - "in" : "query", - "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false - } ], - "responses" : { - "200" : { - "description" : "Successful operation", - "schema" : { - "type" : "integer", - "format" : "int64" - } - }, - "500" : { - "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" - } - }, - "400" : { - "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" - } - } - } - } - }, - "/write/{collection}/_untag" : { - "post" : { - "tags" : [ "write" ], - "summary" : "Untag", - "description" : "Search and untag the elements found in the collection, given the filters", - "operationId" : "untagPost", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], - "parameters" : [ { - "name" : "collection", - "in" : "path", - "description" : "collection", - "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "required" : false, - "schema" : { - "$ref" : "#/definitions/TagRequest" - } - }, { - "name" : "pretty", - "in" : "query", - "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false - } ], - "responses" : { - "200" : { - "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/UpdateResponse" - } - }, - "500" : { - "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" - } - }, - "400" : { - "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" - } - } - } - } - }, - "/status/{collection}/_tag/{id}" : { - "get" : { - "tags" : [ "status" ], - "summary" : "TagStatus", - "description" : "Get the status of the (un)tagging operation, given the id of a previously requested operation", - "operationId" : "taggingGet", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], - "parameters" : [ { - "name" : "collection", - "in" : "path", - "description" : "collection", - "required" : true, - "type" : "string" - }, { - "name" : "id", - "in" : "path", - "description" : "The id of a previously requested (un)tag operation.", - "required" : true, - "type" : "string" - }, { - "name" : "pretty", - "in" : "query", - "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false - } ], - "responses" : { - "200" : { - "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/UpdateResponse" - } - }, - "500" : { - "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" - } - }, - "400" : { - "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" - } - } - } - } - }, - "/status/{collection}/_taglist" : { - "get" : { - "tags" : [ "status" ], - "summary" : "TagList", - "description" : "Get the list of previously submitted tag requests", - "operationId" : "taggingGetList", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], - "parameters" : [ { - "name" : "collection", - "in" : "path", - "description" : "collection", - "required" : true, - "type" : "string" - }, { - "name" : "pretty", - "in" : "query", - "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false - } ], - "responses" : { - "200" : { - "description" : "Successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/TagRefRequest" - } - } - }, - "500" : { - "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" - } - }, - "400" : { - "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" - } - } - } - } - } - }, - "definitions" : { - "Failure" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - }, - "message" : { - "type" : "string" - }, - "type" : { - "type" : "string" - } - } - }, - "UpdateResponse" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - }, - "label" : { - "type" : "string" - }, - "action" : { - "type" : "string", - "enum" : [ "ADD", "REMOVE", "REMOVEALL" ] - }, - "failures" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Failure" - } - }, - "failed" : { - "type" : "integer", - "format" : "int64" - }, - "updated" : { - "type" : "integer", - "format" : "int64" - }, - "progress" : { - "type" : "number", - "format" : "float" - }, - "nbRequest" : { - "type" : "integer", - "format" : "int64" - }, - "propagated" : { - "type" : "integer", - "format" : "int64" - }, - "startTime" : { - "type" : "integer", - "format" : "int64" - }, - "endTime" : { - "type" : "integer", - "format" : "int64" - }, - "processingTimeMs" : { - "type" : "integer", - "format" : "int64" - } - } - }, - "Error" : { - "type" : "object", - "properties" : { - "status" : { - "type" : "integer", - "format" : "int32" - }, - "message" : { - "type" : "string" - }, - "error" : { - "type" : "string" - } - } - }, - "Expression" : { - "type" : "object", - "properties" : { - "field" : { - "type" : "string" - }, - "op" : { - "type" : "string", - "enum" : [ "eq", "gte", "gt", "lte", "lt", "like", "ne", "range", "within", "notwithin", "intersects", "notintersects" ] - }, - "value" : { - "type" : "string" - } - } - }, - "Filter" : { - "type" : "object", - "properties" : { - "f" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Expression" - } - } - }, - "q" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, - "dateformat" : { - "type" : "string" - }, - "righthand" : { - "type" : "boolean" - } - } - }, - "Form" : { - "type" : "object", - "properties" : { - "pretty" : { - "type" : "boolean" - }, - "flat" : { - "type" : "boolean" - } - } - }, - "Page" : { - "type" : "object", - "properties" : { - "size" : { - "type" : "integer", - "format" : "int32" - }, - "from" : { - "type" : "integer", - "format" : "int32" - }, - "sort" : { - "type" : "string" - }, - "after" : { - "type" : "string" - }, - "before" : { - "type" : "string" - } - } - }, - "Projection" : { - "type" : "object", - "properties" : { - "includes" : { - "type" : "string" - }, - "excludes" : { - "type" : "string" - } - } - }, - "Propagation" : { - "type" : "object", - "properties" : { - "field" : { - "type" : "string" - }, - "filter" : { - "$ref" : "#/definitions/Filter" - } - } - }, - "Search" : { - "type" : "object", - "properties" : { - "filter" : { - "$ref" : "#/definitions/Filter" - }, - "form" : { - "$ref" : "#/definitions/Form" - }, - "page" : { - "$ref" : "#/definitions/Page" - }, - "projection" : { - "$ref" : "#/definitions/Projection" - }, - "returned_geometries" : { - "type" : "string" - } - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "path" : { - "type" : "string" - }, - "value" : { - "type" : "object" - } - } - }, - "TagRequest" : { - "type" : "object", - "properties" : { - "filter" : { - "$ref" : "#/definitions/Filter" - }, - "form" : { - "$ref" : "#/definitions/Form" - }, - "search" : { - "$ref" : "#/definitions/Search" - }, - "tag" : { - "$ref" : "#/definitions/Tag" - }, - "propagation" : { - "$ref" : "#/definitions/Propagation" - }, - "label" : { - "type" : "string" - } - } - }, - "TagRefRequest" : { - "type" : "object", - "properties" : { - "filter" : { - "$ref" : "#/definitions/Filter" - }, - "form" : { - "$ref" : "#/definitions/Form" - }, - "search" : { - "$ref" : "#/definitions/Search" - }, - "tag" : { - "$ref" : "#/definitions/Tag" - }, - "propagation" : { - "$ref" : "#/definitions/Propagation" - }, - "label" : { - "type" : "string" - }, - "id" : { - "type" : "string" - }, - "action" : { - "type" : "string", - "enum" : [ "ADD", "REMOVE", "REMOVEALL" ] - }, - "collection" : { - "type" : "string" - }, - "partitionFilter" : { - "type" : "string" - }, - "propagated" : { - "type" : "integer", - "format" : "int64" - }, - "creationTime" : { - "type" : "integer", - "format" : "int64" - }, - "offset" : { - "type" : "integer", - "format" : "int64" - } - } - } - } -} \ No newline at end of file diff --git a/openapi/swagger.yaml b/openapi/swagger.yaml deleted file mode 100644 index 57b4299..0000000 --- a/openapi/swagger.yaml +++ /dev/null @@ -1,438 +0,0 @@ ---- -swagger: "2.0" -info: - description: "(Un)Tag fields of ARLAS collections" - version: "24.1.1-SNAPSHOT" - title: "ARLAS Tagger API" - contact: - name: "Gisaia" - url: "http://www.gisaia.com/" - email: "contact@gisaia.com" - license: - name: "Apache 2.0" - url: "https://www.apache.org/licenses/LICENSE-2.0.html" -basePath: "/arlas_tagger" -tags: -- name: "write" -- name: "status" -schemes: -- "http" -- "https" -paths: - /write/{collection}/_tag: - post: - tags: - - "write" - summary: "Tag" - description: "Search and tag the elements found in the collection, given the\ - \ filters" - operationId: "tagPost" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" - parameters: - - name: "collection" - in: "path" - description: "collection" - required: true - type: "string" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/TagRequest" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - responses: - "200": - description: "Successful operation" - schema: - $ref: "#/definitions/UpdateResponse" - "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" - "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" - /write/{collection}/_tagreplay: - post: - tags: - - "write" - summary: "TagReplay" - description: "Scan the tagref topic and replay tagging operations from the given\ - \ offset" - operationId: "tagReplay" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" - parameters: - - name: "collection" - in: "path" - description: "collection" - required: true - type: "string" - - name: "offset" - in: "query" - description: "The offset from which the replay must be done." - required: true - type: "integer" - format: "int64" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - responses: - "200": - description: "Successful operation" - schema: - type: "integer" - format: "int64" - "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" - "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" - /write/{collection}/_untag: - post: - tags: - - "write" - summary: "Untag" - description: "Search and untag the elements found in the collection, given the\ - \ filters" - operationId: "untagPost" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" - parameters: - - name: "collection" - in: "path" - description: "collection" - required: true - type: "string" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/TagRequest" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - responses: - "200": - description: "Successful operation" - schema: - $ref: "#/definitions/UpdateResponse" - "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" - "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" - /status/{collection}/_tag/{id}: - get: - tags: - - "status" - summary: "TagStatus" - description: "Get the status of the (un)tagging operation, given the id of a\ - \ previously requested operation" - operationId: "taggingGet" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" - parameters: - - name: "collection" - in: "path" - description: "collection" - required: true - type: "string" - - name: "id" - in: "path" - description: "The id of a previously requested (un)tag operation." - required: true - type: "string" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - responses: - "200": - description: "Successful operation" - schema: - $ref: "#/definitions/UpdateResponse" - "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" - "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" - /status/{collection}/_taglist: - get: - tags: - - "status" - summary: "TagList" - description: "Get the list of previously submitted tag requests" - operationId: "taggingGetList" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" - parameters: - - name: "collection" - in: "path" - description: "collection" - required: true - type: "string" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - responses: - "200": - description: "Successful operation" - schema: - type: "array" - items: - $ref: "#/definitions/TagRefRequest" - "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" - "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" -definitions: - Failure: - type: "object" - properties: - id: - type: "string" - message: - type: "string" - type: - type: "string" - UpdateResponse: - type: "object" - properties: - id: - type: "string" - label: - type: "string" - action: - type: "string" - enum: - - "ADD" - - "REMOVE" - - "REMOVEALL" - failures: - type: "array" - items: - $ref: "#/definitions/Failure" - failed: - type: "integer" - format: "int64" - updated: - type: "integer" - format: "int64" - progress: - type: "number" - format: "float" - nbRequest: - type: "integer" - format: "int64" - propagated: - type: "integer" - format: "int64" - startTime: - type: "integer" - format: "int64" - endTime: - type: "integer" - format: "int64" - processingTimeMs: - type: "integer" - format: "int64" - Error: - type: "object" - properties: - status: - type: "integer" - format: "int32" - message: - type: "string" - error: - type: "string" - Expression: - type: "object" - properties: - field: - type: "string" - op: - type: "string" - enum: - - "eq" - - "gte" - - "gt" - - "lte" - - "lt" - - "like" - - "ne" - - "range" - - "within" - - "notwithin" - - "intersects" - - "notintersects" - value: - type: "string" - Filter: - type: "object" - properties: - f: - type: "array" - items: - type: "array" - items: - $ref: "#/definitions/Expression" - q: - type: "array" - items: - type: "array" - items: - type: "string" - dateformat: - type: "string" - righthand: - type: "boolean" - Form: - type: "object" - properties: - pretty: - type: "boolean" - flat: - type: "boolean" - Page: - type: "object" - properties: - size: - type: "integer" - format: "int32" - from: - type: "integer" - format: "int32" - sort: - type: "string" - after: - type: "string" - before: - type: "string" - Projection: - type: "object" - properties: - includes: - type: "string" - excludes: - type: "string" - Propagation: - type: "object" - properties: - field: - type: "string" - filter: - $ref: "#/definitions/Filter" - Search: - type: "object" - properties: - filter: - $ref: "#/definitions/Filter" - form: - $ref: "#/definitions/Form" - page: - $ref: "#/definitions/Page" - projection: - $ref: "#/definitions/Projection" - returned_geometries: - type: "string" - Tag: - type: "object" - properties: - path: - type: "string" - value: - type: "object" - TagRequest: - type: "object" - properties: - filter: - $ref: "#/definitions/Filter" - form: - $ref: "#/definitions/Form" - search: - $ref: "#/definitions/Search" - tag: - $ref: "#/definitions/Tag" - propagation: - $ref: "#/definitions/Propagation" - label: - type: "string" - TagRefRequest: - type: "object" - properties: - filter: - $ref: "#/definitions/Filter" - form: - $ref: "#/definitions/Form" - search: - $ref: "#/definitions/Search" - tag: - $ref: "#/definitions/Tag" - propagation: - $ref: "#/definitions/Propagation" - label: - type: "string" - id: - type: "string" - action: - type: "string" - enum: - - "ADD" - - "REMOVE" - - "REMOVEALL" - collection: - type: "string" - partitionFilter: - type: "string" - propagated: - type: "integer" - format: "int64" - creationTime: - type: "integer" - format: "int64" - offset: - type: "integer" - format: "int64" diff --git a/pom.xml b/pom.xml index dc550b2..b6fd6e8 100644 --- a/pom.xml +++ b/pom.xml @@ -21,11 +21,11 @@ 3.10.1 2.22.2 2.22.2 - 2.19.0 + 2.23.1 - 24.1.1 + 25.0.0 - 3.6.1 + 3.7.0 10.4.1 @@ -33,16 +33,7 @@ 4.13.2 2.2 - 5.3.2 - - - 1.3.4 - 1.3.7 - 1.3.3 - - openapi/swagger.json - target/generated-docs/ - + 5.4.0 @@ -114,65 +105,7 @@ maven-surefire-plugin ${surefire.version} - - - - io.github.swagger2markup - swagger2markup-maven-plugin - ${swagger2markup.plugin.version} - - - io.github.swagger2markup - swagger2markup-import-files-ext - ${swagger2markup.extension.version} - - - io.github.swagger2markup - swagger2markup - ${swagger2markup.version} - - - - ${swagger.input} - ${swagger.output} - - ASCIIDOC - TAGS - ${project.basedir}/src/docs/asciidoc/extensions/overview - ${project.basedir}/src/docs/asciidoc/extensions/definitions - ${project.basedir}/src/docs/asciidoc/extensions/paths - ${project.basedir}src/docs/asciidoc/extensions/security - - - - - - io.github.swagger2markup - swagger2markup-maven-plugin - ${swagger2markup.plugin.version} - - - io.github.swagger2markup - swagger2markup-import-files-ext - ${swagger2markup.extension.version} - - - io.github.swagger2markup - swagger2markup - ${swagger2markup.version} - - - - ${swagger.input} - ${swagger.output} - - MARKDOWN - - - - - diff --git a/release.sh b/release.sh index 0722519..cafea1e 100755 --- a/release.sh +++ b/release.sh @@ -194,18 +194,23 @@ i=1; until nc -w 2 ${DOCKER_IP} 19998; do if [ $i -lt 30 ]; then sleep 1; else b echo "=> Get swagger documentation" mkdir -p target/tmp || echo "target/tmp exists" -i=1; until curl -XGET http://${DOCKER_IP}:19998/arlas_tagger/swagger.json -o target/tmp/swagger.json; do if [ $i -lt 60 ]; then sleep 1; else break; fi; i=$(($i + 1)); done -i=1; until curl -XGET http://${DOCKER_IP}:19998/arlas_tagger/swagger.yaml -o target/tmp/swagger.yaml; do if [ $i -lt 60 ]; then sleep 1; else break; fi; i=$(($i + 1)); done +i=1; until curl -XGET http://${DOCKER_IP}:19998/arlas_tagger/openapi.json -o target/tmp/openapi.json; do if [ $i -lt 60 ]; then sleep 1; else break; fi; i=$(($i + 1)); done +i=1; until curl -XGET http://${DOCKER_IP}:19998/arlas_tagger/openapi.yaml -o target/tmp/openapi.yaml; do if [ $i -lt 60 ]; then sleep 1; else break; fi; i=$(($i + 1)); done mkdir -p openapi -cp target/tmp/swagger.yaml openapi -cp target/tmp/swagger.json openapi +cp target/tmp/openapi.yaml openapi +cp target/tmp/openapi.json openapi echo "=> Stop arlas-tagger stack" docker-compose -f ${DOCKER_COMPOSE_TAGGER} -f ${DOCKER_COMPOSE_ES} -f ${DOCKER_COMPOSE_KAFKA} --project-name arlas down -v echo "=> Generate API documentation" -mvn "-Dswagger.output=docs/api" swagger2markup:convertSwagger2markup +mkdir -p docs/api +docker run --rm \ + --mount dst=/input/api.json,src="$PWD/openapi/openapi.json",type=bind,ro \ + --mount dst=/input/env.json,src="$PWD/conf/doc/widdershins.json",type=bind,ro \ + --mount dst=/output,src="$PWD/docs/api",type=bind \ + gisaia/widdershins:4.0.1 itests() { echo "=> Run integration tests" @@ -228,9 +233,9 @@ else docker run --rm \ -e GROUP_ID="$(id -g)" \ -e USER_ID="$(id -u)" \ - --mount dst=/input/api.json,src="$PWD/target/tmp/swagger.json",type=bind,ro \ + --mount dst=/input/api.json,src="$PWD/target/tmp/openapi.json",type=bind,ro \ --mount dst=/output,src="$PWD/target/tmp/typescript-fetch",type=bind \ - gisaia/swagger-codegen-2.3.1 \ + gisaia/swagger-codegen-3.0.42 \ -l typescript-fetch --additional-properties modelPropertyNaming=snake_case echo "=> Build Typescript API "${FULL_API_VERSION} @@ -282,8 +287,8 @@ if [ "$RELEASE" == "YES" ]; then git push origin :v${ARLAS_TAGGER_VERSION} echo "=> Commit release version" git add docs/api - git add openapi/swagger.json - git add openapi/swagger.yaml + git add openapi/openapi.json + git add openapi/openapi.yaml git commit -a -m "release version ${ARLAS_TAGGER_VERSION}" git tag v${ARLAS_TAGGER_VERSION} git push origin v${ARLAS_TAGGER_VERSION} @@ -308,10 +313,10 @@ echo "=> Update REST API version in JAVA source code" sed -i.bak 's/\"'${FULL_API_VERSION}'\"/\"API_VERSION\"/' arlas-tagger-rest/src/main/java/io/arlas/tagger/rest/tag/TagRESTService.java if [ "$RELEASE" == "YES" ]; then - sed -i.bak 's/\"'${FULL_API_VERSION}'\"/\"'${API_DEV_VERSION}-SNAPSHOT'\"/' openapi/swagger.yaml - sed -i.bak 's/\"'${FULL_API_VERSION}'\"/\"'${API_DEV_VERSION}-SNAPSHOT'\"/' openapi/swagger.json - git add openapi/swagger.json - git add openapi/swagger.yaml + sed -i.bak 's/\"'${FULL_API_VERSION}'\"/\"'${API_DEV_VERSION}-SNAPSHOT'\"/' openapi/openapi.yaml + sed -i.bak 's/\"'${FULL_API_VERSION}'\"/\"'${API_DEV_VERSION}-SNAPSHOT'\"/' openapi/openapi.json + git add openapi/openapi.json + git add openapi/openapi.yaml git commit -a -m "development version ${ARLAS_DEV_VERSION}-SNAPSHOT" git push origin develop else echo "=> Skip git push develop"; fi \ No newline at end of file diff --git a/scripts/ci/tests-integration.sh b/scripts/ci/tests-integration.sh index 38d65e4..58cdd76 100755 --- a/scripts/ci/tests-integration.sh +++ b/scripts/ci/tests-integration.sh @@ -1,8 +1,8 @@ #!/bin/bash set -o errexit -o pipefail -export ELASTIC_VERSION="8.7.0" -export ARLAS_VERSION="24.0.1" +export ELASTIC_VERSION="8.13.3" +export ARLAS_VERSION="25.0.0" function clean_exit { ARG=$?