diff --git a/api/pom.xml b/api/pom.xml index 136e6676753dbb7d6e5caf052c62ce91503a8723..6edfb76a4fb035c32f807dfd108e84b6f9515310 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -4,7 +4,7 @@ <parent> <groupId>com.indiscale.fdo</groupId> <artifactId>fdo-manager-service</artifactId> - <version>0.1.0-rc1</version> + <version>0.1.0-rc2</version> <relativePath>../pom.xml</relativePath> </parent> <properties> diff --git a/api/src/main/resources/api.yaml b/api/src/main/resources/api.yaml index 4af674a0d2b2b2c566db5b09d462d4c6f252a4b0..9dff4e4b4ca554846f236eaf95816d2a8916a723 100644 --- a/api/src/main/resources/api.yaml +++ b/api/src/main/resources/api.yaml @@ -1,393 +1,406 @@ -openapi: "3.1.0" -info: - version: '0.1' - title: 'FDO Manager Service API' - description: "The FDO Manager Service API for creating FAIR Digital Objects." - contact: - name: IndiScale GmbH - email: t.fitschen@indiscale.com - url: https://www.indiscale.com - -servers: - - url: http://localhost:8080 - -tags: - - name: Repositories - description: Repositories for storing FDO data and metadata. - - name: Profiles - description: FDO Profiles specify the attributes of FDOs. - - name: Logging - description: Logging of operations handled by this FDO Manager Service Instance. - - name: FDOs - description: Fair Digital Objects. - - name: Info - description: General information about the Service. -paths: - /logging: - get: - tags: - - Logging - description: "List latest log events" - operationId: listLogEvents - parameters: - - in: query - name: "page[number]" - schema: - type: integer - default: 0 - - in: query - name: "page[size]" - schema: - type: integer - default: 100 - responses: - "200": - description: "Success." - content: - application/json: - schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OperationsLogRecord' - links: - $ref: '#/components/schemas/PaginationLinks' - - - /profiles: - get: - tags: - - Profiles - description: "List known profiles." - operationId: listProfiles - responses: - "200": - description: "Success." - content: - application/json: - schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Profile' - links: - $ref: '#/components/schemas/Links' - - /profiles/{profileId}: - get: - tags: - - Profiles - description: "Get information on a single profile." - operationId: getProfile - parameters: - - name: profileId - in: path - description: "Profile ID" - required: true - schema: - $ref: '#/components/schemas/ProfileID' - responses: - "200": - description: "Success." - content: - application/json: - schema: - type: object - required: ["data"] - properties: - data: - $ref: '#/components/schemas/Profile' - links: - $ref: '#/components/schemas/Links' - "404": - description: "Unknown profile id." - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /hello: - get: - tags: - - Info - description: Say hello to the server. - operationId: hello - responses: - "200": - description: A hello from the server. - content: - application/json: - schema: - $ref: '#/components/schemas/Hello' - /info: - get: - tags: - - Info - description: Retrieve general information on the service. - operationId: getInfo - responses: - "200": - description: General service information. - content: - application/json: - schema: - type: object - required: ["data"] - properties: - data: - $ref: "#/components/schemas/Info" - links: - $ref: '#/components/schemas/Links' - /repositories: - get: - tags: - - Repositories - description: "List trusted repositories." - operationId: listRepositories - responses: - "200": - description: "Success." - content: - application/json: - schema: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Repository' - links: - $ref: '#/components/schemas/Links' - /repositories/{repositoryId}: - get: - tags: - - Repositories - description: "Get information on a single repository." - operationId: getRepository - parameters: - - name: repositoryId - in: path - description: "Repository ID" - required: true - schema: - $ref: '#/components/schemas/RepositoryID' - responses: - "200": - description: "Success." - content: - application/json: - schema: - type: object - required: ["data"] - properties: - data: - $ref: '#/components/schemas/Repository' - links: - $ref: '#/components/schemas/Links' - "404": - description: "Unknown repository id." - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - /fdo: - post: - tags: - - FDOs - description: "Create an FDO." - operationId: createFDO - requestBody: - content: - multipart/form-data: - schema: - type: object - required: ["repositories", "data", "metadata"] - properties: - repositories: - $ref: "#/components/schemas/TargetRepositories" - data: - type: string - format: binary - metadata: - type: string - format: binary - responses: - "201": - description: "The Location header points to the newly created FDO." - /fdo/{prefix}/{suffix}: - get: - tags: - - FDOs - description: "Resolve a pid." - operationId: "resolvePID" - parameters: - - $ref: '#/components/parameters/Prefix' - - $ref: '#/components/parameters/Suffix' - responses: - "200": - description: "A successfully resolved pid." - content: - application/json: - schema: - type: object - required: ["data"] - properties: - data: - $ref: '#/components/schemas/DigitalObject' - links: - $ref: '#/components/schemas/Links' - "404": - description: "Could not resolve pid." - content: - application/json: - schema: - $ref: '#/components/schemas/Error' -components: - schemas: - OperationsLogRecord: - type: object - properties: - id: - type: string - type: - type: string - const: "OperationsLogRecord" - attributes: - type: object - properties: - operation: - type: string - enum: ["Op.Create"] - timestamp: - type: string - format: date-time - repositories: - $ref: '#/components/schemas/TargetRepositories' - fdo: - $ref: '#/components/schemas/DigitalObject' - links: - $ref: '#/components/schemas/SelfLink' - TargetRepositories: - type: object - properties: - fdo: - type: string - metadata: - type: string - data: - type: string - SelfLink: - type: object - properties: - self: - type: string - nullable: true - PaginationLinks: - type: object - properties: - self: - type: string - format: uri - first: - type: string - format: uri - prev: - type: string - format: uri - next: - type: string - format: uri - last: - type: string - format: uri - Links: - type: object - properties: - self: - type: string - nullable: true - collection: - type: string - nullable: true - Error: - type: object - required: ["detail", "status"] - properties: - detail: - type: string - nullable: true - status: - type: string - nullable: true - RepositoryID: - type: string - nullable: true - examples: - - "gwdg-cordra-1" - - "fdo.indiscale.com" - - "b2share@gwdg" - Repository: - type: object - properties: - id: - $ref: '#/components/schemas/RepositoryID' - links: - $ref: '#/components/schemas/Links' - ProfileID: - type: string - nullable: true - Profile: - type: object - properties: - id: - $ref: '#/components/schemas/ProfileID' - links: - $ref: '#/components/schemas/Links' - Hello: - type: object - properties: - message: - type: string - example: 'Hello marie.curie@sorbonne-universite.fr. This is FDO Manager Service v0.1-SNAPSHOT/API v0.1' - default: 'Hello anonymous. This is FDO Manager Service v0.1-SNAPSHOT/API v0.1' - DigitalObject: - type: object - required: ["pid", "isFdo"] - properties: - pid: - type: string - isFdo: - type: boolean - dataPid: - type: string - metadataPid: - type: string - Info: - type: object - properties: - fdoServiceVersion: - type: string - fdoSdkVersion: - type: string - serviceProvider: - type: string - links: - $ref: '#/components/schemas/SelfLink' - parameters: - Prefix: - name: prefix - in: path - description: "Persistent Identifier Prefix" - required: true - schema: - type: string - Suffix: - name: suffix - in: path - description: "Persistent Identifier Suffix" - required: true - schema: - type: string +openapi: "3.1.0" +info: + version: '0.1' + title: 'FDO Manager Service API' + description: "The FDO Manager Service API for creating FAIR Digital Objects." + contact: + name: IndiScale GmbH + email: t.fitschen@indiscale.com + url: https://www.indiscale.com + +servers: + - url: http://localhost:8080 + +tags: + - name: Repositories + description: Repositories for storing FDO data and metadata. + - name: Profiles + description: FDO Profiles specify the attributes of FDOs. + - name: Logging + description: Logging of operations handled by this FDO Manager Service Instance. + - name: FDOs + description: Fair Digital Objects. + - name: Info + description: General information about the Service. +paths: + /logging: + get: + tags: + - Logging + description: "List latest log events" + operationId: listLogEvents + parameters: + - in: query + name: "page[number]" + schema: + type: integer + default: 0 + - in: query + name: "page[size]" + schema: + type: integer + default: 100 + responses: + "200": + description: "Success." + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/OperationsLogRecord' + links: + $ref: '#/components/schemas/PaginationLinks' + + + /profiles: + get: + tags: + - Profiles + description: "List known profiles." + operationId: listProfiles + responses: + "200": + description: "Success." + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Profile' + links: + $ref: '#/components/schemas/Links' + + /profiles/{profileId}: + get: + tags: + - Profiles + description: "Get information on a single profile." + operationId: getProfile + parameters: + - name: profileId + in: path + description: "Profile ID" + required: true + schema: + $ref: '#/components/schemas/ProfileID' + responses: + "200": + description: "Success." + content: + application/json: + schema: + type: object + required: ["data"] + properties: + data: + $ref: '#/components/schemas/Profile' + links: + $ref: '#/components/schemas/Links' + "404": + description: "Unknown profile id." + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /hello: + get: + tags: + - Info + description: Say hello to the server. + operationId: hello + responses: + "200": + description: A hello from the server. + content: + application/json: + schema: + $ref: '#/components/schemas/Hello' + /info: + get: + tags: + - Info + description: Retrieve general information on the service. + operationId: getInfo + responses: + "200": + description: General service information. + content: + application/json: + schema: + type: object + required: ["data"] + properties: + data: + $ref: "#/components/schemas/Info" + links: + $ref: '#/components/schemas/Links' + /repositories: + get: + tags: + - Repositories + description: "List trusted repositories." + operationId: listRepositories + responses: + "200": + description: "Success." + content: + application/json: + schema: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/Repository' + links: + $ref: '#/components/schemas/Links' + /repositories/{repositoryId}: + get: + tags: + - Repositories + description: "Get information on a single repository." + operationId: getRepository + parameters: + - name: repositoryId + in: path + description: "Repository ID" + required: true + schema: + $ref: '#/components/schemas/RepositoryID' + responses: + "200": + description: "Success." + content: + application/json: + schema: + type: object + required: ["data"] + properties: + data: + $ref: '#/components/schemas/Repository' + links: + $ref: '#/components/schemas/Links' + "404": + description: "Unknown repository id." + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + /fdo: + post: + tags: + - FDOs + description: "Create an FDO." + operationId: createFDO + requestBody: + content: + multipart/form-data: + schema: + type: object + required: ["repositories", "data", "metadata"] + properties: + repositories: + $ref: "#/components/schemas/TargetRepositories" + data: + type: string + format: binary + metadata: + type: string + format: binary + responses: + "201": + description: "The Location header points to the newly created FDO." + /fdo/{prefix}/{suffix}: + get: + tags: + - FDOs + description: "Resolve a pid." + operationId: "resolvePID" + parameters: + - $ref: '#/components/parameters/Prefix' + - $ref: '#/components/parameters/Suffix' + responses: + "200": + description: "A successfully resolved pid." + content: + application/json: + schema: + type: object + required: ["data"] + properties: + data: + $ref: '#/components/schemas/DigitalObject' + links: + $ref: '#/components/schemas/Links' + "404": + description: "Could not resolve pid." + content: + application/json: + schema: + $ref: '#/components/schemas/Error' +components: + schemas: + OperationsLogRecord: + type: object + properties: + id: + type: string + type: + type: string + const: "OperationsLogRecord" + attributes: + type: object + properties: + operation: + type: string + enum: ["Op.Create"] + timestamp: + type: string + format: date-time + repositories: + $ref: '#/components/schemas/TargetRepositories' + fdo: + $ref: '#/components/schemas/DigitalObject' + links: + $ref: '#/components/schemas/SelfLink' + TargetRepositories: + type: object + properties: + fdo: + type: string + metadata: + type: string + data: + type: string + SelfLink: + type: object + properties: + self: + type: string + nullable: true + PaginationLinks: + type: object + properties: + self: + type: string + format: uri + first: + type: string + format: uri + prev: + type: string + format: uri + next: + type: string + format: uri + last: + type: string + format: uri + Links: + type: object + properties: + self: + type: string + nullable: true + collection: + type: string + nullable: true + Error: + type: object + required: ["detail", "status"] + properties: + detail: + type: string + nullable: true + status: + type: string + nullable: true + RepositoryID: + type: string + nullable: true + examples: + - "gwdg-cordra-1" + - "fdo.indiscale.com" + - "b2share@gwdg" + Repository: + type: object + properties: + id: + $ref: '#/components/schemas/RepositoryID' + type: + type: string + enum: ["Repository"] + attributes: + type: object + properties: + description: + type: string + maintainer: + type: string + attributes: + type: object + additionalProperties: true + links: + $ref: '#/components/schemas/Links' + ProfileID: + type: string + nullable: true + Profile: + type: object + properties: + id: + $ref: '#/components/schemas/ProfileID' + links: + $ref: '#/components/schemas/Links' + Hello: + type: object + properties: + message: + type: string + example: 'Hello marie.curie@sorbonne-universite.fr. This is FDO Manager Service v0.1-SNAPSHOT/API v0.1' + default: 'Hello anonymous. This is FDO Manager Service v0.1-SNAPSHOT/API v0.1' + DigitalObject: + type: object + required: ["pid", "isFdo"] + properties: + pid: + type: string + isFdo: + type: boolean + dataPid: + type: string + metadataPid: + type: string + Info: + type: object + properties: + fdoServiceVersion: + type: string + fdoSdkVersion: + type: string + serviceProvider: + type: string + links: + $ref: '#/components/schemas/SelfLink' + parameters: + Prefix: + name: prefix + in: path + description: "Persistent Identifier Prefix" + required: true + schema: + type: string + Suffix: + name: suffix + in: path + description: "Persistent Identifier Suffix" + required: true + schema: + type: string diff --git a/application/pom.xml b/application/pom.xml index b618dc692e84c9ae4111abc772a1452105135372..833903d5fbb79ad7e14d406f5ff96977c384d282 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -3,7 +3,7 @@ <parent> <groupId>com.indiscale.fdo</groupId> <artifactId>fdo-manager-service</artifactId> - <version>0.1.0-rc1</version> + <version>0.1.0-rc2</version> <relativePath>../pom.xml</relativePath> </parent> <modelVersion>4.0.0</modelVersion> @@ -11,7 +11,7 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.outputEncoding>UTF-8</project.build.outputEncoding> <sourceDir>${project.basedir}/src/main</sourceDir> - <fdo.sdk.version>0.1.0-rc2</fdo.sdk.version> + <fdo.sdk.version>0.1.0-rc3</fdo.sdk.version> </properties> <artifactId>fdo-manager-service.application</artifactId> <dependencies> diff --git a/application/src/main/java/com/indiscale/fdo/manager/service/mock/MockRepositoryFactory.java b/application/src/main/java/com/indiscale/fdo/manager/service/mock/MockRepositoryFactory.java index 9d9bb770c8384fefee25ad0924e67afadcf035e9..fb61effba003eb0d0a80656821d6e1980ee13b7a 100644 --- a/application/src/main/java/com/indiscale/fdo/manager/service/mock/MockRepositoryFactory.java +++ b/application/src/main/java/com/indiscale/fdo/manager/service/mock/MockRepositoryFactory.java @@ -107,6 +107,16 @@ public class MockRepositoryFactory implements RepositoryConnectionFactory { public String get(String key) { return null; } + + @Override + public String getDescription() { + return "This is not real."; + } + + @Override + public String getMaintainer() { + return "Mocking Institute of Technology"; + } } public static final RepositoryType TYPE = diff --git a/application/src/main/java/com/indiscale/fdo/manager/service/repositories/RepositoriesImpl.java b/application/src/main/java/com/indiscale/fdo/manager/service/repositories/RepositoriesImpl.java index cbd4e3b7f8687e4c258cc1be45bee283060f2a49..85e09d37bf748551a479d8bfa4f3443aca154d2f 100644 --- a/application/src/main/java/com/indiscale/fdo/manager/service/repositories/RepositoriesImpl.java +++ b/application/src/main/java/com/indiscale/fdo/manager/service/repositories/RepositoriesImpl.java @@ -10,6 +10,7 @@ import com.indiscale.fdo.manager.service.BaseController; import com.indiscale.fdo.manager.service.api.model.GetRepository200Response; import com.indiscale.fdo.manager.service.api.model.Links; import com.indiscale.fdo.manager.service.api.model.ListRepositories200Response; +import com.indiscale.fdo.manager.service.api.model.RepositoryAttributes; import com.indiscale.fdo.manager.service.api.operation.RepositoriesApi; import java.util.LinkedList; import java.util.List; @@ -30,6 +31,10 @@ public class RepositoriesImpl extends BaseController implements RepositoriesApi public Repository(RepositoryConfig config) { this.setId(config.getId()); + RepositoryAttributes attr = new RepositoryAttributes(); + attr.setDescription(config.getDescription()); + attr.setMaintainer(config.getMaintainer()); + this.setAttributes(attr); } String getSelfRel() { diff --git a/pom.xml b/pom.xml index 9510d88951b3ac5392618be7ec96b311931a4659..5a331db2bf10ec8aaae3e0e1fc0b0e41e4472a59 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ <groupId>com.indiscale.fdo</groupId> <artifactId>fdo-manager-service</artifactId> <packaging>pom</packaging> - <version>0.1.0-rc1</version> + <version>0.1.0-rc2</version> <modules> <module>api</module> <module>application</module>