diff --git a/.docs/api-analyse.yaml b/.docs/api-analyse.yaml index 881130d530dd5587715ee701b6fbce6c5ef9919f..b05862a7fef01438b9d7603131394a9f5fd70d85 100644 --- a/.docs/api-analyse.yaml +++ b/.docs/api-analyse.yaml @@ -1 +1,105 @@ -{"definitions":{},"externalDocs":{"description":"Sourcecode Documentation","url":"https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services"},"info":{"contact":{"email":"andreas.rauber@tuwien.ac.at","name":"Prof. Andreas Rauber"},"description":"Service that analyses data structures","license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"},"title":"Database Repository Analyse Service API","version":"1.3.0"},"openapi":"3.0.0","paths":{"/api/analyse/determinedt":{"post":{"consumes":["application/json"],"description":"This is a simple API which returns the datatypes of a (path) csv file","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"enum":{"example":true,"type":"boolean"},"enum_tol":{"example":0.1},"filename":{"example":"sample.csv","type":"string"},"separator":{"example":",","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Determine datatypes"}},"/api/analyse/determinepk":{"post":{"consumes":["application/json"],"description":"This is a simple API which returns the primary keys + ranking of a (path) csv file","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"filepath":{"example":"/data/testdt08.csv","type":"string"},"seperator":{"example":",","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Determine primary keys"}},"/health":{"get":{"consumes":["application/json"],"description":"This is a simple API which checks if the application is healthy","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"status":{"example":"UP","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"}},"summary":"Check if application is running"}}},"servers":[{"description":"Generated server url","url":"http://localhost:5000"},{"description":"Sandbox","url":"https://dbrepo2.tuwien.ac.at"}]} +components: + schemas: {} +externalDocs: + description: Sourcecode Documentation + url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services +info: + contact: + email: andreas.rauber@tuwien.ac.at + name: Prof. Andreas Rauber + description: Service that analyses data structures + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0 + title: Database Repository Analyse Service API + version: 1.4.0 +openapi: 3.0.0 +paths: + /api/analyse/determinedt: + post: + consumes: + - application/json + description: This is a simple API which returns the datatypes of a (path) csv + file + parameters: + - description: to-do description + in: body + name: body + required: true + schema: + properties: + enum: + example: true + type: boolean + enum_tol: + example: 0.1 + filename: + example: sample.csv + type: string + separator: + example: ',' + type: string + type: object + produces: + - application/json + responses: + '200': + description: OK + '405': + description: Invalid input + summary: Determine datatypes + /api/analyse/determinepk: + post: + consumes: + - application/json + description: This is a simple API which returns the primary keys + ranking of + a (path) csv file + parameters: + - description: to-do description + in: body + name: body + required: true + schema: + properties: + filepath: + example: /data/testdt08.csv + type: string + seperator: + example: ',' + type: string + type: object + produces: + - application/json + responses: + '200': + description: OK + '405': + description: Invalid input + summary: Determine primary keys + /health: + get: + consumes: + - application/json + description: This is a simple API which checks if the application is healthy + parameters: + - description: to-do description + in: body + name: body + required: true + schema: + properties: + status: + example: UP + type: string + type: object + produces: + - application/json + responses: + '200': + description: OK + summary: Check if application is running +servers: + - description: Generated server url + url: http://localhost:5000 + - description: Sandbox + url: https://dbrepo2.tuwien.ac.at diff --git a/.docs/api-data.yaml b/.docs/api-data.yaml index 4d40f4a702c2c8b62c8e555bf4c7191543902132..e50267b7b7fdb0bc532a2deab644fef177abbd2e 100644 --- a/.docs/api-data.yaml +++ b/.docs/api-data.yaml @@ -8,7 +8,7 @@ info: license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0 - version: 1.3.0 + version: 1.4.0 externalDocs: description: Sourcecode Documentation url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services diff --git a/.docs/api-metadata.yaml b/.docs/api-metadata.yaml index 41d0bbee22d7cfa46a03646a1c77bf0f281d044e..547c365fd6d1df5b40a744e6d902fbcb77ab467a 100644 --- a/.docs/api-metadata.yaml +++ b/.docs/api-metadata.yaml @@ -8,14 +8,14 @@ info: license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0 - version: 1.3.0 + version: 1.4.0 externalDocs: description: Sourcecode Documentation url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services servers: - url: http://localhost:9099 description: Generated server url -- url: https://dbrepo2.tuwien.ac.at +- url: https://test.dbrepo.tuwien.ac.at description: Sandbox paths: /api/database/{databaseId}/table/{tableId}/history: @@ -38,12 +38,6 @@ paths: type: integer format: int64 responses: - "400": - description: Table history query is malformed - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' "200": description: Find table history successfully content: @@ -58,20 +52,20 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Find table history is not permitted + "400": + description: Table history query is malformed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "503": - description: Connection to the database failed + "409": + description: Query store failed to query table history content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "504": - description: Query store failed to query table history + "403": + description: Find table history is not permitted content: application/json: schema: @@ -97,12 +91,6 @@ paths: type: integer format: int64 responses: - "400": - description: Table history query is malformed - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' "200": description: Find table history successfully content: @@ -117,20 +105,20 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Find table history is not permitted + "400": + description: Table history query is malformed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "503": - description: Connection to the database failed + "409": + description: Query store failed to query table history content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "504": - description: Query store failed to query table history + "403": + description: Find table history is not permitted content: application/json: schema: @@ -188,12 +176,36 @@ paths: schema: type: string responses: - "200": - description: OK + "404": + description: Table or database could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Get table data successfully content: '*/*': schema: $ref: '#/components/schemas/QueryResultDto' + "422": + description: Could not import csv via sidecar + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Table data is malformed or image is not supported + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Access to the database is forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] post: @@ -221,8 +233,30 @@ paths: $ref: '#/components/schemas/TableCsvDto' required: true responses: - "200": - description: OK + "202": + description: Inserted data successfully + content: + '*/*': + schema: + type: object + "404": + description: Table or database could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Insert table data is malformed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Access to the database is forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] delete: @@ -250,8 +284,26 @@ paths: $ref: '#/components/schemas/TableCsvDeleteDto' required: true responses: - "200": - description: OK + "202": + description: Deleted table data successfully + "404": + description: Table or database could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Table data or query is malformed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Access to the database is forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] head: @@ -304,12 +356,36 @@ paths: schema: type: string responses: - "200": - description: OK + "404": + description: Table or database could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Get table data successfully content: '*/*': schema: $ref: '#/components/schemas/QueryResultDto' + "422": + description: Could not import csv via sidecar + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Table data is malformed or image is not supported + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Access to the database is forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/user/{id}: @@ -326,24 +402,24 @@ paths: type: string format: uuid responses: - "200": - description: Found user + "404": + description: User was not found content: application/json: schema: - $ref: '#/components/schemas/UserDto' - "405": + $ref: '#/components/schemas/ApiErrorDto' + "403": description: Find user is not permitted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: User was not found + "200": + description: Found user content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + $ref: '#/components/schemas/UserDto' security: - bearerAuth: [] put: @@ -365,24 +441,36 @@ paths: $ref: '#/components/schemas/UserUpdateDto' required: true responses: - "404": - description: User attribute was not found + "400": + description: Modify user query is malformed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": + "202": + description: Modified user information + content: + application/json: + schema: + $ref: '#/components/schemas/UserDto' + "403": description: Modify user is not permitted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "202": - description: Modified user information + "405": + description: Foreign user modification content: application/json: schema: - $ref: '#/components/schemas/UserDto' + $ref: '#/components/schemas/ApiErrorDto' + "404": + description: User attribute was not found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/user/{id}/theme: @@ -405,20 +493,26 @@ paths: $ref: '#/components/schemas/UserThemeSetDto' required: true responses: - "202": - description: Modified user theme + "404": + description: User or user attribute was not found content: application/json: schema: - $ref: '#/components/schemas/UserDto' - "404": - description: User or user attribute was not found + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Modify user is not permitted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Modified user theme + content: + application/json: + schema: + $ref: '#/components/schemas/UserDto' "405": - description: Modify user is not permitted + description: Foreign user modification content: application/json: schema: @@ -457,8 +551,20 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Modify is not allowed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": - description: Modify user is not permitted + description: Foreign user modification + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "503": + description: Authentication service does not respond content: application/json: schema: @@ -479,18 +585,18 @@ paths: type: integer format: int64 responses: - "200": - description: Find one ontology - content: - application/json: - schema: - $ref: '#/components/schemas/OntologyDto' "404": description: Could not find ontology content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "200": + description: Find one ontology + content: + application/json: + schema: + $ref: '#/components/schemas/OntologyDto' put: tags: - ontology-endpoint @@ -510,18 +616,18 @@ paths: $ref: '#/components/schemas/OntologyModifyDto' required: true responses: - "202": - description: Updated ontology successfully - content: - application/json: - schema: - $ref: '#/components/schemas/OntologyDto' "404": description: Could not find ontology content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Updated ontology successfully + content: + application/json: + schema: + $ref: '#/components/schemas/OntologyDto' security: - bearerAuth: [] delete: @@ -537,16 +643,16 @@ paths: type: integer format: int64 responses: - "202": - description: Deleted ontology successfully - content: - application/json: {} "404": description: Could not find ontology content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Deleted ontology successfully + content: + application/json: {} security: - bearerAuth: [] /api/maintenance/message/{id}: @@ -563,6 +669,12 @@ paths: type: integer format: int64 responses: + "404": + description: Could not find message + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: Get messages content: @@ -593,7 +705,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BannerMessageNotFoundException' + $ref: '#/components/schemas/ApiErrorDto' "202": description: Updated message content: @@ -618,7 +730,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BannerMessageNotFoundException' + $ref: '#/components/schemas/ApiErrorDto' "202": description: Deleted message content: @@ -637,18 +749,18 @@ paths: type: integer format: int64 responses: - "200": - description: Found image - content: - application/json: - schema: - $ref: '#/components/schemas/ImageDto' "404": description: Image could not be found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "200": + description: Found image + content: + application/json: + schema: + $ref: '#/components/schemas/ImageDto' put: tags: - image-endpoint @@ -695,14 +807,14 @@ paths: type: integer format: int64 responses: - "202": - description: Deleted image successfully "404": description: Image could not be found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Deleted image successfully security: - bearerAuth: [] /api/database/{id}/visibility: @@ -725,24 +837,24 @@ paths: $ref: '#/components/schemas/DatabaseModifyVisibilityDto' required: true responses: - "404": - description: Database or user could not be found + "202": + description: Visibility modified successfully content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Visibility modification is not permitted + $ref: '#/components/schemas/DatabaseDto' + "404": + description: Database could not be found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "202": - description: Visibility modified successfully + "403": + description: Visibility modification is not permitted content: application/json: schema: - $ref: '#/components/schemas/DatabaseDto' + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/database/{id}/transfer: @@ -765,24 +877,24 @@ paths: $ref: '#/components/schemas/DatabaseTransferDto' required: true responses: + "202": + description: Transfer of ownership was successful + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseDto' "404": description: Database or user could not be found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": + "403": description: Transfer of ownership is not permitted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "202": - description: Transfer of ownership was successful - content: - application/json: - schema: - $ref: '#/components/schemas/DatabaseDto' security: - bearerAuth: [] /api/database/{id}/table/{tableId}/column/{columnId}: @@ -822,18 +934,18 @@ paths: $ref: '#/components/schemas/ColumnSemanticsUpdateDto' required: true responses: - "202": - description: Updated column semantics successfully + "404": + description: Table or database could not be found content: application/json: schema: - $ref: '#/components/schemas/ColumnDto' - "403": - description: Access to the database is forbidden + $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Updated column semantics successfully content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + $ref: '#/components/schemas/ColumnDto' "400": description: Update semantic concept query is malformed or update unit of measurement query is malformed @@ -841,19 +953,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: "Table, database, semantic concept, unit of measurement or\ - \ container could not be found" + "403": + description: Access to the database is forbidden content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Update column semantics not permitted - content: - application/json: - schema: - $ref: '#/components/schemas/ColumnDto' security: - bearerAuth: [] /api/database/{id}/access/{userId}: @@ -889,12 +994,6 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Modify access query or database connection is malformed - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' "404": description: Database or user not found content: @@ -903,6 +1002,12 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "202": description: Modify access succeeded + "400": + description: Modify access query or database connection is malformed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] post: @@ -930,16 +1035,14 @@ paths: $ref: '#/components/schemas/DatabaseGiveAccessDto' required: true responses: - "400": - description: Granting access query or database connection is malformed + "405": + description: Granting access not permitted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "202": - description: Granting access succeeded - "405": - description: Granting access not permitted + "403": + description: Failed giving access content: application/json: schema: @@ -950,6 +1053,14 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Granting access query or database connection is malformed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Granting access succeeded security: - bearerAuth: [] delete: @@ -971,28 +1082,22 @@ paths: type: string format: uuid responses: - "404": - description: User with access was not found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Revoke of access not permitted + "403": + description: Revoke of access not permitted as no access was found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Revoked access successfully "400": description: Modify access query or database connection is malformed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "202": - description: Revoked access successfully - "403": - description: Revoke of access not permitted as no access was found + "404": + description: "User, database with access was not found" content: application/json: schema: @@ -1019,26 +1124,32 @@ paths: type: integer format: int64 responses: + "501": + description: Image is not supported + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' "504": description: Query store failed to select query content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: "Database, query or user could not be found" + "200": + description: List queries content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + $ref: '#/components/schemas/QueryDto' "405": description: Find query is not permitted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "501": - description: Image is not supported + "404": + description: "Database, query or user could not be found" content: application/json: schema: @@ -1049,12 +1160,6 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "200": - description: List queries - content: - application/json: - schema: - $ref: '#/components/schemas/QueryDto' security: - bearerAuth: [] put: @@ -1082,38 +1187,38 @@ paths: $ref: '#/components/schemas/QueryPersistDto' required: true responses: - "200": - description: Persist query successful - content: - application/json: - schema: - $ref: '#/components/schemas/QueryDto' "405": description: Persist query is not permitted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: "Database, query or user could not be found" + "412": + description: Query is already persisted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "501": - description: Image is not supported + "200": + description: Persist query successful + content: + application/json: + schema: + $ref: '#/components/schemas/QueryDto' + "400": + description: Image not supported content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Query is already persisted + "403": + description: Not allowed to persist query content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "504": - description: Query store failed to persist query + "404": + description: "Database, query or user could not be found" content: application/json: schema: @@ -1147,22 +1252,16 @@ paths: $ref: '#/components/schemas/SignupRequestDto' required: true responses: - "400": - description: Parameters are not well-formed (likely email) - content: - application/json: {} "404": description: default role not found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: User with username already exists + "400": + description: Parameters are not well-formed (likely email) content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' + application/json: {} "201": description: Created user content: @@ -1175,6 +1274,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: User with username already exists + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' /api/semantic/ontology: get: tags: @@ -1270,36 +1375,24 @@ paths: $ref: '#/components/schemas/ImageCreateDto' required: true responses: - "502": - description: Failed to connect - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Image already exists - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "404": - description: User could not be found + "201": + description: Created image content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + $ref: '#/components/schemas/ImageDto' "400": description: Image specification is invalid content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "201": - description: Created image + "409": + description: Image already exists content: application/json: schema: - $ref: '#/components/schemas/ImageDto' + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/identifier: @@ -1364,50 +1457,62 @@ paths: $ref: '#/components/schemas/IdentifierSaveDto' required: true responses: + "503": + description: DataCite system did not respond + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' "201": description: Created identifier content: application/json: schema: $ref: '#/components/schemas/IdentifierDto' - "403": - description: Insufficient access rights or authorities + "400": + description: Identifier form contains invalid request data content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Identifier for this resource already exists + "404": + description: "Failed to find database, table or view" content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Query information could not be retrieved + "204": + description: Identifier could not be created content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "406": - description: Creating identifier not allowed + "403": + description: Insufficient access rights or authorities content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: "Failed to find database, table or view" + "409": + description: Identifier for this resource already exists content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Identifier form contains invalid request data + "405": + description: Creating identifier not permitted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Creating identifier not permitted + "406": + description: Creating identifier not allowed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Query information could not be retrieved content: application/json: schema: @@ -1427,6 +1532,12 @@ paths: schema: type: string responses: + "404": + description: User not found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: List of databases content: @@ -1447,62 +1558,43 @@ paths: $ref: '#/components/schemas/DatabaseCreateDto' required: true responses: - "406": - description: Failed to create user at broker service or virtual host could - not be reached at broker service + "409": + description: Query store could not be created content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": + "403": description: Database create permission is missing or grant permissions at broker service failed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Database create query is malformed + "404": + description: "Container, user or database could not be found" content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "201": - description: Created a new database - content: - application/json: - schema: - $ref: '#/components/schemas/DatabaseBriefDto' - "409": - description: Database name already exist or query store could not be created + "400": + description: Database create query is malformed or image is not supported content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "501": - description: Container image is not supported + "201": + description: Created a new database content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + $ref: '#/components/schemas/DatabaseBriefDto' "503": description: Connection to the database failed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Connection to the container failed - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "404": - description: "Container, user or database could not be found" - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] head: @@ -1517,8 +1609,20 @@ paths: schema: type: string responses: + "404": + description: User not found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: Count databases + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/DatabaseDto' /api/database/{databaseId}/view: get: tags: @@ -1533,6 +1637,12 @@ paths: type: integer format: int64 responses: + "404": + description: Database or user could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: Find views successfully content: @@ -1541,18 +1651,6 @@ paths: type: array items: $ref: '#/components/schemas/ViewBriefDto' - "404": - description: Database or user could not be found - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Find views is not permitted - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] post: @@ -1574,20 +1672,26 @@ paths: $ref: '#/components/schemas/ViewCreateDto' required: true responses: - "403": - description: Credentials missing + "423": + description: Create view resulted in an invalid query statement content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "401": - description: Credentials missing + "201": + description: Create view successfully + content: + application/json: + schema: + $ref: '#/components/schemas/ViewBriefDto' + "400": + description: Create view query is malformed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "503": - description: Connection to the database failed + "401": + description: Credentials missing content: application/json: schema: @@ -1604,24 +1708,18 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Create view query is malformed + "503": + description: Connection to the database failed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Create view resulted in an invalid query statement + "403": + description: Credentials missing content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "201": - description: Create view successfully - content: - application/json: - schema: - $ref: '#/components/schemas/ViewBriefDto' security: - bearerAuth: [] /api/database/{databaseId}/table: @@ -1638,26 +1736,26 @@ paths: type: integer format: int64 responses: - "405": - description: List tables not permitted + "200": + description: List tables content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + type: array + items: + $ref: '#/components/schemas/TableBriefDto' "404": description: Database could not be found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "200": - description: List tables + "403": + description: List tables not permitted content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/TableBriefDto' + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] post: @@ -1679,48 +1777,36 @@ paths: $ref: '#/components/schemas/TableCreateDto' required: true responses: - "201": - description: Created a new table - content: - application/json: - schema: - $ref: '#/components/schemas/TableBriefDto' - "404": - description: "Database, container or user could not be found" + "403": + description: Create table not permitted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Create table not permitted + "400": + description: Create table query is malformed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "501": - description: Image is not supported + "404": + description: "Database, container or user could not be found" content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "504": - description: Broker service failed to create queue + "201": + description: Created a new table content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + $ref: '#/components/schemas/TableBriefDto' "409": description: Create table conflicts with existing table name content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Create table query is malformed - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/database/{databaseId}/table/{tableId}/data/import: @@ -1749,8 +1835,32 @@ paths: $ref: '#/components/schemas/ImportDto' required: true responses: - "200": - description: OK + "202": + description: Import table data successfully + "404": + description: Table or database could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Table data is malformed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "422": + description: Could not import csv via sidecar + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Access to the database is forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/database/{databaseId}/query: @@ -1772,15 +1882,8 @@ paths: schema: type: boolean responses: - "423": - description: Selection of time-versioned query resulted in an invalid query - statement - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "404": - description: "Database, container or user could not be found" + "501": + description: Image is not supported content: application/json: schema: @@ -1791,12 +1894,6 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "501": - description: Image is not supported - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' "200": description: List queries content: @@ -1805,8 +1902,8 @@ paths: type: array items: $ref: '#/components/schemas/QueryBriefDto' - "503": - description: Connection to the database failed + "404": + description: "Database, container or user could not be found" content: application/json: schema: @@ -1817,6 +1914,19 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' + "503": + description: Connection to the database failed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "423": + description: Selection of time-versioned query resulted in an invalid query + statement + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] post: @@ -1863,12 +1973,42 @@ paths: $ref: '#/components/schemas/ExecuteStatementDto' required: true responses: - "200": - description: OK + "403": + description: Execute query not permitted content: - '*/*': + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Could not store query in query store + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Executed query + content: + application/json: schema: $ref: '#/components/schemas/QueryResultDto' + "404": + description: "Database, query or user could not be found" + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Could not parse columns + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Image is not supported + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/container: @@ -1905,24 +2045,18 @@ paths: $ref: '#/components/schemas/ContainerCreateRequestDto' required: true responses: - "502": - description: Failed to connect + "201": + description: Created a new container content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + $ref: '#/components/schemas/ContainerBriefDto' "404": description: Container image or user could not be found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "201": - description: Created a new container - content: - application/json: - schema: - $ref: '#/components/schemas/ContainerBriefDto' "409": description: Container name already exists content: @@ -1970,16 +2104,14 @@ paths: schema: type: string responses: - "200": - description: Found entities + "417": + description: Generated query or uri is malformed content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/EntityDto' - "417": - description: Generated query or uri is malformed + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Filter params are invalid content: application/json: schema: @@ -1990,12 +2122,14 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Filter params are invalid + "200": + description: Found entities content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + type: array + items: + $ref: '#/components/schemas/EntityDto' "422": description: Ontology does not have rdf or sparql endpoint content: @@ -2024,28 +2158,28 @@ paths: type: integer format: int64 responses: - "200": - description: Suggested table semantics successfully - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/TableColumnEntityDto' "417": description: Generated query is malformed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Could not find the table + "422": + description: Ontology does not have rdf or sparql endpoint content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "422": - description: Ontology does not have rdf or sparql endpoint + "200": + description: Suggested table semantics successfully + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/TableColumnEntityDto' + "404": + description: Could not find the table content: application/json: schema: @@ -2078,6 +2212,12 @@ paths: type: integer format: int64 responses: + "417": + description: Generated query is malformed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: Suggested table column semantics successfully content: @@ -2086,12 +2226,6 @@ paths: type: array items: $ref: '#/components/schemas/TableColumnEntityDto' - "417": - description: Generated query is malformed - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' "404": description: Could not find the table column content: @@ -2140,6 +2274,18 @@ paths: schema: type: string responses: + "409": + description: Exported resource was not found + content: + text/csv: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "422": + description: Failed to retrieve from database sidecar + content: + text/csv: + schema: + $ref: '#/components/schemas/ApiErrorDto' "400": description: "Identifier could not be exported, the requested style is not\ \ known" @@ -2147,6 +2293,12 @@ paths: text/bibliography: schema: $ref: '#/components/schemas/ApiErrorDto' + "410": + description: Failed to retrieve from S3 endpoint + content: + text/csv: + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: Found identifier successfully content: @@ -2160,13 +2312,12 @@ paths: text/bibliography; style=ieee: {} text/bibliography; style=bibtex: {} "404": - description: Identifier could not be exported from database as the resource - was not found + description: Identifier could not be found content: text/csv: schema: $ref: '#/components/schemas/ApiErrorDto' - "502": + "503": description: Identifier could not exported from database as it is not reachable content: text/csv: @@ -2240,7 +2391,13 @@ paths: format: int64 responses: "404": - description: Database could not be found + description: Database or exchange could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "503": + description: Connection to the broker service could not be established content: application/json: schema: @@ -2279,6 +2436,12 @@ paths: type: string format: date-time responses: + "403": + description: Operation is not allowed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' "201": description: Created identifier content: @@ -2291,32 +2454,26 @@ paths: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "503": - description: Database connection could not be established - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "404": - description: "Table, database or user was not found" + "400": + description: Images is not supported or table/query is malformed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "403": - description: Operation is not allowed + "422": + description: Sidecar operation could not be completed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "422": - description: Sidecar operation could not be completed + "404": + description: "Table, database or user was not found" content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Images is not supported or table/query is malformed + "503": + description: Database connection could not be established content: application/json: schema: @@ -2337,24 +2494,24 @@ paths: type: integer format: int64 responses: - "200": - description: Found database access + "403": + description: No access to this database content: application/json: schema: - $ref: '#/components/schemas/DatabaseAccessDto' - "405": - description: Check access is not permitted + $ref: '#/components/schemas/ApiErrorDto' + "404": + description: Database not found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "403": - description: No access to this database + "200": + description: Found database access content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + $ref: '#/components/schemas/DatabaseAccessDto' security: - bearerAuth: [] /api/database/{databaseId}/view/{viewId}: @@ -2377,24 +2534,24 @@ paths: type: integer format: int64 responses: - "200": - description: Find view successfully + "403": + description: Find view is not permitted content: application/json: schema: - $ref: '#/components/schemas/ViewDto' + $ref: '#/components/schemas/ApiErrorDto' "404": description: "Database, view or user could not be found" content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Find view is not permitted + "200": + description: Find view successfully content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + $ref: '#/components/schemas/ViewDto' security: - bearerAuth: [] delete: @@ -2416,50 +2573,44 @@ paths: type: integer format: int64 responses: - "400": - description: Delete view query is malformed + "405": + description: Delete view is not permitted content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "403": - description: Credentials missing + "423": + description: Delete view resulted in an invalid query statement content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Delete view is not permitted + "400": + description: Delete view query is malformed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "401": - description: Credentials missing + "404": + description: "Database, view or user could not be found" content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "503": - description: Connection to the database failed + "403": + description: Deletion not allowed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Delete view resulted in an invalid query statement + "503": + description: Connection to the database failed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' "200": description: Delete view successfully - "404": - description: "Database, view or user could not be found" - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/database/{databaseId}/view/{viewId}/data: @@ -2506,56 +2657,14 @@ paths: application/json: schema: $ref: '#/components/schemas/QueryResultDto' - "423": - description: Find data resulted in an invalid query statement - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "504": - description: Query store failed to query view data + "400": + description: Pagination not in valid range or find data query is malformed content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' "403": - description: Credentials missing - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "501": - description: Image is not supported - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "401": - description: Credentials missing - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Parsing of resulting columns failed - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "503": - description: Connection to the database failed - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Find data is not permitted - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Pagination not in valid range or find data query is malformed + description: View data not allowed content: application/json: schema: @@ -2583,12 +2692,36 @@ paths: format: int64 responses: "200": - description: OK + description: Count data successfully content: - '*/*': + application/json: schema: type: integer format: int64 + "404": + description: "Database, view, container or user could not be found" + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Pagination not in valid range or find data query is malformed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Could not count query data + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Count data not allowed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/database/{databaseId}/table/{tableId}: @@ -2611,14 +2744,14 @@ paths: type: integer format: int64 responses: - "403": - description: Access to the database is forbidden + "404": + description: "Table, database or container could not be found" content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: "Table, database or container could not be found" + "503": + description: Could not communicate with the broker service content: application/json: schema: @@ -2629,8 +2762,8 @@ paths: application/json: schema: $ref: '#/components/schemas/TableDto' - "405": - description: Find table not permitted + "403": + description: Access to the database is forbidden content: application/json: schema: @@ -2656,44 +2789,22 @@ paths: type: integer format: int64 responses: - "403": - description: Access to the database is forbidden - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Delete table successfully "404": description: "Table, database or container could not be found" content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Delete table not permitted - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "501": - description: Image is not supported - content: - application/json: - schema: - $ref: '#/components/schemas/ApiErrorDto' - "202": - description: Delete table successfully - content: - application/json: - schema: - $ref: '#/components/schemas/TableDto' - "423": - description: Delete table resulted in an invalid state + "400": + description: Delete table query resulted in an invalid query statement content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Delete table query resulted in an invalid query statement + "403": + description: Access to the database is forbidden content: application/json: schema: @@ -2726,13 +2837,37 @@ paths: type: string format: date-time responses: - "200": - description: OK + "404": + description: Table or database could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "422": + description: Could not import csv via sidecar + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Table data is malformed or image is not supported + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Get table data count successfully content: '*/*': schema: type: integer format: int64 + "403": + description: Access to the database is forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/database/{databaseId}/query/{queryId}/export: @@ -2760,12 +2895,48 @@ paths: schema: type: string responses: + "403": + description: Execute query not permitted + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": - description: OK + description: Executed query content: '*/*': schema: type: object + "404": + description: Database or query could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "422": + description: Sidecar failed to export + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Export of query failed + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Image is not supported + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "410": + description: Could not find in S3 storage + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/database/{databaseId}/query/{queryId}/data: @@ -2813,12 +2984,42 @@ paths: schema: type: string responses: - "200": - description: OK + "403": + description: Execute query not permitted content: - '*/*': + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Could not store query in query store + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Executed query + content: + application/json: schema: $ref: '#/components/schemas/QueryResultDto' + "404": + description: Database or query could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Could not parse columns + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Image is not supported + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/database/{databaseId}/query/{queryId}/data/count: @@ -2841,13 +3042,36 @@ paths: type: integer format: int64 responses: - "200": - description: OK + "403": + description: Execute query not permitted content: - '*/*': + application/json: schema: - type: integer - format: int64 + $ref: '#/components/schemas/ApiErrorDto' + "202": + description: Executed query + content: + application/json: + schema: + $ref: '#/components/schemas/QueryResultDto' + "404": + description: Database or query could not be found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Could not parse columns + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Image is not supported + content: + application/json: + schema: + $ref: '#/components/schemas/ApiErrorDto' security: - bearerAuth: [] /api/database/license: @@ -2879,24 +3103,18 @@ paths: type: integer format: int64 responses: - "200": - description: Found container - content: - application/json: - schema: - $ref: '#/components/schemas/ContainerDto' - "502": - description: Connection to the container failed + "404": + description: Container image could not be found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Container image could not be found + "200": + description: Found container content: application/json: schema: - $ref: '#/components/schemas/ApiErrorDto' + $ref: '#/components/schemas/ContainerDto' delete: tags: - container-endpoint @@ -2910,20 +3128,18 @@ paths: type: integer format: int64 responses: - "202": - description: Deleted container successfully - "410": - description: Container is already removed + "404": + description: Container not found content: application/json: schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Container is still running + "202": + description: Deleted container successfully content: - application/json: + '*/*': schema: - $ref: '#/components/schemas/ApiErrorDto' + type: object security: - bearerAuth: [] /api/pid/{id}: @@ -2940,7 +3156,7 @@ paths: type: integer format: int64 responses: - "405": + "403": description: Deleting identifier not permitted content: application/json: @@ -2954,10 +3170,31 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "202": description: Deleted identifier + content: + '*/*': + schema: + type: object security: - bearerAuth: [] components: schemas: + TableHistoryDto: + required: + - event + - timestamp + - total + type: object + properties: + timestamp: + type: string + format: date-time + example: 2021-03-12T15:26:21Z + event: + type: string + total: + type: integer + format: int64 + example: 1 ApiErrorDto: required: - code @@ -3044,23 +3281,6 @@ components: code: type: string example: error.service.code - TableHistoryDto: - required: - - event - - timestamp - - total - type: object - properties: - timestamp: - type: string - format: date-time - example: 2021-03-12T15:26:21Z - event: - type: string - total: - type: integer - format: int64 - example: 1 QueryResultDto: required: - headers @@ -3115,7 +3335,6 @@ components: UserDto: required: - attributes - - email - id - username type: object @@ -3133,9 +3352,6 @@ components: example: Josiah Carberry attributes: $ref: '#/components/schemas/UserAttributesDto' - email: - type: string - example: jcarberry@brown.edu qualified_name: type: string example: Josiah Carberry — @jcarberry @@ -3276,126 +3492,6 @@ components: type: string format: date-time example: 2021-03-12T15:26:21Z - BannerMessageNotFoundException: - type: object - properties: - cause: - type: object - properties: - stackTrace: - type: array - items: - type: object - properties: - classLoaderName: - type: string - moduleName: - type: string - moduleVersion: - type: string - methodName: - type: string - fileName: - type: string - lineNumber: - type: integer - format: int32 - nativeMethod: - type: boolean - className: - type: string - message: - type: string - suppressed: - type: array - items: - type: object - properties: - stackTrace: - type: array - items: - type: object - properties: - classLoaderName: - type: string - moduleName: - type: string - moduleVersion: - type: string - methodName: - type: string - fileName: - type: string - lineNumber: - type: integer - format: int32 - nativeMethod: - type: boolean - className: - type: string - message: - type: string - localizedMessage: - type: string - localizedMessage: - type: string - stackTrace: - type: array - items: - type: object - properties: - classLoaderName: - type: string - moduleName: - type: string - moduleVersion: - type: string - methodName: - type: string - fileName: - type: string - lineNumber: - type: integer - format: int32 - nativeMethod: - type: boolean - className: - type: string - message: - type: string - suppressed: - type: array - items: - type: object - properties: - stackTrace: - type: array - items: - type: object - properties: - classLoaderName: - type: string - moduleName: - type: string - moduleVersion: - type: string - methodName: - type: string - fileName: - type: string - lineNumber: - type: integer - format: int32 - nativeMethod: - type: boolean - className: - type: string - message: - type: string - localizedMessage: - type: string - localizedMessage: - type: string BannerMessageBriefDto: required: - message @@ -3775,7 +3871,7 @@ components: type: integer format: int32 image: - $ref: '#/components/schemas/ImageBriefDto' + $ref: '#/components/schemas/ImageDto' created: type: string format: date-time @@ -4709,22 +4805,6 @@ components: - Subtitle - TranslatedTitle - Other - ImageBriefDto: - required: - - id - - name - - version - type: object - properties: - id: - type: integer - format: int64 - name: - type: string - example: mariadb - version: - type: string - example: "10.5" LicenseDto: required: - identifier @@ -5053,10 +5133,9 @@ components: example: true QueryDto: required: - - cid - created - creator - - dbid + - database_id - execution - id - is_persisted @@ -5068,12 +5147,6 @@ components: id: type: integer format: int64 - cid: - type: integer - format: int64 - dbid: - type: integer - format: int64 creator: $ref: '#/components/schemas/UserDto' execution: @@ -5097,6 +5170,9 @@ components: type: string format: date-time example: 2021-03-12T15:26:21Z + database_id: + type: integer + format: int64 query_normalized: type: string example: SELECT `id` FROM `air_quality` @@ -6195,6 +6271,26 @@ components: type: integer format: int32 example: 2022 + ImageBriefDto: + required: + - id + - jdbc_method + - name + - version + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + example: mariadb + version: + type: string + example: "10.5" + jdbc_method: + type: string + example: mariadb ViewBriefDto: required: - created @@ -6546,14 +6642,14 @@ components: type: string resumptionToken: type: string + parametersString: + type: string fromDate: type: string format: date-time untilDate: type: string format: date-time - parametersString: - type: string BannerMessageDto: required: - id @@ -6743,12 +6839,12 @@ components: type: string identifier: $ref: '#/components/schemas/Identifier' - apaName: - type: string bibtexName: type: string ieeeName: type: string + apaName: + type: string Database: type: object properties: @@ -7912,6 +8008,8 @@ components: createdBy: type: string format: uuid + creator: + $ref: '#/components/schemas/User' name: type: string internalName: @@ -7942,10 +8040,9 @@ components: format: date-time QueryBriefDto: required: - - cid - created - creator - - dbid + - database_id - execution - id - is_persisted @@ -7957,12 +8054,6 @@ components: id: type: integer format: int64 - cid: - type: integer - format: int64 - dbid: - type: integer - format: int64 creator: $ref: '#/components/schemas/UserDto' execution: @@ -7977,12 +8068,17 @@ components: enum: - query - view - identifier: - $ref: '#/components/schemas/IdentifierBriefDto' + identifiers: + type: array + items: + $ref: '#/components/schemas/IdentifierBriefDto' created: type: string format: date-time example: 2021-03-12T15:26:21Z + database_id: + type: integer + format: int64 query_normalized: type: string example: SELECT `id` FROM `air_quality` diff --git a/.docs/api-mirror.yaml b/.docs/api-mirror.yaml deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/.docs/api-search.yaml b/.docs/api-search.yaml new file mode 100644 index 0000000000000000000000000000000000000000..78ad885e9bb5b663d754395218cac4a9a1656500 --- /dev/null +++ b/.docs/api-search.yaml @@ -0,0 +1,22 @@ +components: + schemas: {} +externalDocs: + description: Sourcecode Documentation + url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services +info: + contact: + email: andreas.rauber@tuwien.ac.at + name: Prof. Andreas Rauber + description: Service that searches the search database + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0 + title: Database Repository Search Service API + version: 1.4.0 +openapi: 3.0.0 +paths: {} +servers: + - description: Generated server url + url: http://localhost:4000 + - description: Sandbox + url: https://test.dbrepo.tuwien.ac.at diff --git a/.docs/api-sidecar.yaml b/.docs/api-sidecar.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c10a7078fca83a3a7ccfe06b420fe96f9f849f28 --- /dev/null +++ b/.docs/api-sidecar.yaml @@ -0,0 +1,100 @@ +components: + schemas: + Health: + properties: + status: + example: UP + type: string + required: + - status + title: Status object + type: object +externalDocs: + description: Sourcecode Documentation + url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services +info: + contact: + email: andreas.rauber@tuwien.ac.at + name: Prof. Andreas Rauber + description: Sidecar that downloads the import .csv file + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0 + title: Database Repository Data Database sidecar API + version: 1.4.0 +openapi: 3.0.0 +paths: + /health: + get: + consumes: + - application/json + description: 'Return UP if the instance is ready to serve connections. + + ' + produces: + - application/json + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/Health' + description: OK, service is up and running + '404': + description: Service is not yet ready + summary: Return a healthcheck + tags: + - actuator + /sidecar/export/{filename}: + post: + consumes: + - application/json + description: 'Exports a specific .csv file to the Storage Service via S3 + + ' + parameters: + - description: Name of the object file to export to the Storage Service + in: path + name: filename + required: true + produces: + - application/json + responses: + '202': + content: {} + description: Exported the .csv + '400': + description: The Storage Service could not be contacted or .csv was not + found. + summary: Exports a .csv to the Storage Service + tags: + - sidecar + /sidecar/import/{filename}: + post: + consumes: + - application/json + description: 'Imports a specific .csv file from the Storage Service via S3 + + ' + parameters: + - description: Name of the object file to import from the Storage Service + in: path + name: filename + required: true + produces: + - application/json + responses: + '202': + content: {} + description: Imported the .csv + '400': + description: The Storage Service could not be contacted or .csv was not + found. + summary: Imports a .csv from the Storage Service + tags: + - sidecar +servers: + - description: Generated server url + url: http://localhost:5000 + - description: Sandbox + url: https://test.dbrepo.tuwien.ac.at diff --git a/.docs/api-upload.yaml b/.docs/api-upload.yaml index 6f93138b86ac7312d0f05c8cf4c90e08013b4749..51cf3ef89d89b80c0fe710bd4d1c59b43c3670e7 100644 --- a/.docs/api-upload.yaml +++ b/.docs/api-upload.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: title: Database Repository Upload Service API description: Service that manages the uploads @@ -8,23 +8,23 @@ info: license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0 - version: 1.3.0 + version: 1.4.0 externalDocs: description: Sourcecode Documentation url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services servers: -- url: http://localhost:1080 - description: Generated server url -- url: https://test.dbrepo.tuwien.ac.at - description: Sandbox + - url: http://localhost:1080 + description: Generated server url + - url: https://test.dbrepo.tuwien.ac.at + description: Sandbox paths: /api/upload/files: post: tags: - - upload-endpoint + - upload-endpoint summary: Uploads a file operationId: upload responses: "201": description: "Successfully uploaded a file" - security: {} \ No newline at end of file + security: { } \ No newline at end of file diff --git a/.docs/generate_swagger.sh b/.docs/generate_swagger.sh index 3438e8b9b8c186b9c859110ff7ce9d9131fc8a05..2c4fa9f572cc8a8ed84e52ff8596d656c5a65185 100644 --- a/.docs/generate_swagger.sh +++ b/.docs/generate_swagger.sh @@ -1,21 +1,31 @@ #!/bin/bash declare -A services +services[4000]=search services[5000]=analyse -services[9050]=mirror services[9093]=data services[9099]=metadata +services[3305]=sidecar function retrieve () { - if [[ "$2" == analyse ]]; then + if [[ "$2" == analyse ]] || [[ "$2" == search ]] || [[ "$2" == sidecar ]]; then echo "... retrieve json api from localhost:$1" - wget "http://localhost:$1/api-$2.json" -O "./api-$2.yaml" -q + curl -sSL "http://localhost:$1/api-$2.json" | yq -y > "./.docs/api-$2.yaml" else echo "... retrieve yaml api from localhost:$1" - wget "http://localhost:$1/v3/api-docs.yaml" -O "./api-$2.yaml" -q + curl -sSL "http://localhost:$1/v3/api-docs.yaml" > "./.docs/api-$2.yaml" fi } +function version () { + echo "... version to ${TAG}" + REGEX="s/dbrepo-latest/${TAG}/g" + sed -i $REGEX ./.docs/api-$1.yaml +} + for key in "${!services[@]}"; do echo "Generating ${services[$key]} API" retrieve "$key" "${services[$key]}" -done \ No newline at end of file + version "${services[$key]}" +done +echo "Generating upload API" +version upload \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8267c84f97801d5911ce9582ab88701e17655dea..b2bb93654e904fafb91608f795686ae39133d615 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -550,10 +550,6 @@ build-api-1.3: script: - apk add bash git maven - git fetch && git checkout release-v1.3 - - mvn -f ./dbrepo-metadata-service versions:set -DnewVersion=1.3 -DgenerateBackupPoms=false - - mvn -f ./dbrepo-metadata-service versions:commit - - mvn -f ./dbrepo-data-service versions:set -DnewVersion=1.3 -DgenerateBackupPoms=false - - mvn -f ./dbrepo-data-service versions:commit - bash .docs/.swagger/generate.sh - mkdir -p ./swagger/1.3 - cp -r ./site/* ./swagger/1.3/ @@ -577,10 +573,6 @@ build-api-1.4: script: - apk add bash git maven - git fetch && git checkout release-v1.4 - - mvn -f ./dbrepo-metadata-service versions:set -DnewVersion=${VERSION} -DgenerateBackupPoms=false - - mvn -f ./dbrepo-metadata-service versions:commit - - mvn -f ./dbrepo-data-service versions:set -DnewVersion=${VERSION} -DgenerateBackupPoms=false - - mvn -f ./dbrepo-data-service versions:commit - bash .docs/.swagger/generate.sh - mkdir -p ./swagger/1.4 - cp -r ./site/* ./swagger/1.4/ diff --git a/Makefile b/Makefile index 71159bace508066cde0b9cecbb455d1211875458..5f39f77cc78a3c4fd1c84119d3c474cf65adf61d 100644 --- a/Makefile +++ b/Makefile @@ -36,8 +36,8 @@ build-frontend: yarn --cwd ./dbrepo-ui install --legacy-peer-deps yarn --cwd ./dbrepo-ui run build -build-clients: - bash ./.gitlab/swagger/generate.sh +build-swagger: + bash ./.docs/generate.sh tag: tag-analyse-service tag-authentication-service tag-metadata-db tag-ui tag-metadata-service tag-data-service tag-search-db tag-search-db-init tag-search-service tag-data-db-sidecar diff --git a/dbrepo-analyse-service/app.py b/dbrepo-analyse-service/app.py index e917b10cfe0d292d7a98240406cddaec05581b6b..9d417209705a1dd9cd0d6c079b76e354d047b174 100644 --- a/dbrepo-analyse-service/app.py +++ b/dbrepo-analyse-service/app.py @@ -65,7 +65,7 @@ template = { "info": { "title": "Database Repository Analyse Service API", "description": "Service that analyses data structures", - "version": "1.3.0", + "version": "dbrepo-latest", "contact": { "name": "Prof. Andreas Rauber", "email": "andreas.rauber@tuwien.ac.at" diff --git a/dbrepo-data-db/sidecar/app.py b/dbrepo-data-db/sidecar/app.py index 1bcf3a4a0f041d70d796d2c89319b40201583e13..5b3dd12f7f4eaa883bfa8cd8ca537e9c7e518a78 100644 --- a/dbrepo-data-db/sidecar/app.py +++ b/dbrepo-data-db/sidecar/app.py @@ -61,7 +61,7 @@ template = { "info": { "title": "Database Repository Data Database sidecar API", "description": "Sidecar that downloads the import .csv file", - "version": "1.3.0", + "version": "dbrepo-latest", "contact": { "name": "Prof. Andreas Rauber", "email": "andreas.rauber@tuwien.ac.at" diff --git a/dbrepo-data-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-data-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index cc2a45a4a37d2947a70fb63a9e08d99cb48820b9..581b8a9b6bfcf1ccbfafebbfcf3e8a3a5b441345 100644 --- a/dbrepo-data-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-data-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -7,7 +7,6 @@ import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.servers.Server; import org.springdoc.core.models.GroupedOpenApi; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -16,9 +15,6 @@ import java.util.List; @Configuration public class SwaggerConfig { - @Value("${app.version:unknown}") - private String version; - @Bean public OpenAPI springShopOpenAPI() { return new OpenAPI() @@ -28,7 +24,7 @@ public class SwaggerConfig { .name("Prof. Andreas Rauber") .email("andreas.rauber@tuwien.ac.at")) .description("Service that manages the data") - .version(version) + .version("dbrepo-latest") .license(new License() .name("Apache 2.0") .url("https://www.apache.org/licenses/LICENSE-2.0"))) diff --git a/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java b/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java index 3b5bca0c35f7a814051af669cbf5ccc668f9f95b..265d7fecce99f684465b81c67ee588e0d797c5db 100644 --- a/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java +++ b/dbrepo-metadata-service/rest-service/src/main/java/at/tuwien/config/SwaggerConfig.java @@ -7,7 +7,6 @@ import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.servers.Server; import org.springdoc.core.models.GroupedOpenApi; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -16,9 +15,6 @@ import java.util.List; @Configuration public class SwaggerConfig { - @Value("${app.version}") - private String version; - @Bean public OpenAPI springShopOpenAPI() { return new OpenAPI() @@ -28,7 +24,7 @@ public class SwaggerConfig { .name("Prof. Andreas Rauber") .email("andreas.rauber@tuwien.ac.at")) .description("Service that manages the metadata") - .version(version) + .version("dbrepo-latest") .license(new License() .name("Apache 2.0") .url("https://www.apache.org/licenses/LICENSE-2.0"))) diff --git a/dbrepo-search-service/app/__init__.py b/dbrepo-search-service/app/__init__.py index 71269f940a393e5b2f180c0ccab9bf4904a323d8..598db2e0484162a7fe8d8d7c5041711a5de8ffec 100644 --- a/dbrepo-search-service/app/__init__.py +++ b/dbrepo-search-service/app/__init__.py @@ -66,7 +66,7 @@ def create_app(config_class=Config): "info": { "title": "Database Repository Search Service API", "description": "Service that searches the search database", - "version": "1.3.0", + "version": "dbrepo-latest", "contact": { "name": "Prof. Andreas Rauber", "email": "andreas.rauber@tuwien.ac.at"