diff options
author | Manuel Bentele | 2021-12-23 15:12:17 +0100 |
---|---|---|
committer | Manuel Bentele | 2021-12-23 15:12:17 +0100 |
commit | 96cd9a64aef9caf29ca668aeafc1ffb089acbe2b (patch) | |
tree | 6053685b1ac7790783d8ecf68b9350b80af1ded7 | |
parent | [SERVER] Update Mysql Java driver class path (diff) | |
download | tutor-module-96cd9a64aef9caf29ca668aeafc1ffb089acbe2b.tar.gz tutor-module-96cd9a64aef9caf29ca668aeafc1ffb089acbe2b.tar.xz tutor-module-96cd9a64aef9caf29ca668aeafc1ffb089acbe2b.zip |
[SERVER] Add Maven profile to generate server API automatically
-rw-r--r-- | dozentenmodulserver/pom.xml | 38 | ||||
-rw-r--r-- | dozentenmodulserver/src/main/openapi/bwlp-server-openapi.yaml | 475 | ||||
-rw-r--r-- | pom.xml | 1 |
3 files changed, 514 insertions, 0 deletions
diff --git a/dozentenmodulserver/pom.xml b/dozentenmodulserver/pom.xml index dae50672..1dd968fd 100644 --- a/dozentenmodulserver/pom.xml +++ b/dozentenmodulserver/pom.xml @@ -110,6 +110,38 @@ </plugins> </build> </profile> + <profile> + <id>api:generate</id> + <build> + <defaultGoal>generate-sources</defaultGoal> + <plugins> + <plugin> + <groupId>org.openapitools</groupId> + <artifactId>openapi-generator-maven-plugin</artifactId> + <version>5.3.1</version> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>generate</goal> + </goals> + <configuration> + <inputSpec>${basedir}/src/main/openapi/bwlp-server-openapi.yaml</inputSpec> + <generatorName>spring</generatorName> + <output>${basedir}/api</output> + <groupId>org.openslx.bwlp.sat.api</groupId> + <artifactId>dozmod-server-api</artifactId> + <apiPackage>org.openslx.bwlp.sat.api.handler</apiPackage> + <modelPackage>org.openslx.bwlp.sat.api.model</modelPackage> + <invokerPackage>org.openslx.bwlp.sat.api.handler</invokerPackage> + <generateModels>true</generateModels> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> </profiles> <build> @@ -208,6 +240,12 @@ <dependencies> <dependency> + <groupId>org.openslx.bwlp.sat.api</groupId> + <artifactId>dozmod-server-api</artifactId> + <version>1.0.0</version> + <scope>compile</scope> + </dependency> + <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>[8.0,9.0)</version> diff --git a/dozentenmodulserver/src/main/openapi/bwlp-server-openapi.yaml b/dozentenmodulserver/src/main/openapi/bwlp-server-openapi.yaml new file mode 100644 index 00000000..856d3fad --- /dev/null +++ b/dozentenmodulserver/src/main/openapi/bwlp-server-openapi.yaml @@ -0,0 +1,475 @@ +openapi: 3.0.0 +info: + title: bwLehrpool-Server + description: 'This is the description document of the bwLehrpool-Server API. The API provides functionality to create, modify, and query events or virtual machine images. You can find out more about the bwLehrpool-Server at [https://git.openslx.org/openslx-ng/tutor-module.git](https://git.openslx.org/openslx-ng/tutor-module.git).' + contact: + name: bwLehrpool-Server + url: https://git.openslx.org/openslx-ng/tutor-module.git + version: 1.0.0 +servers: + - url: http://192.168.200.20:9080 +tags: + - name: vmchooser + description: Query bwLehrpool events and virtual machine images + - name: container + description: Query bwLehrpool container images + - name: server + description: Status and actions of the bwLehrpool-Server +paths: + /vmchooser/list: + get: + tags: + - vmchooser + summary: List all bwLehrpool virtual machine images + operationId: vmchooserGetList + parameters: + - name: locations + in: query + description: IDs of locations that need to be considered for the filter + required: false + style: spaceDelimited + explode: false + schema: + type: array + items: + type: integer + - name: exams + in: query + description: Include exam events for the filter + required: false + style: form + schema: + type: boolean + default: false + responses: + 200: + description: Successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/VirtualMachineImages' + 500: + description: Failed to retrieve list + /vmchooser/lecture/{uuid}/metadata: + get: + tags: + - vmchooser + summary: Get metadata for specified lecture + operationId: vmchooserGetLectureMetadata + parameters: + - name: uuid + in: path + description: UUID of the lecture + required: true + schema: + type: string + format: uuid + responses: + 200: + description: Successful operation + content: + application/gzip: {} + 500: + description: Faild to retrieve metadata + /vmchooser/lecture/{uuid}/netrules: + get: + tags: + - vmchooser + summary: Get network rules for specified lecture + operationId: vmchooserGetLectureNetRules + parameters: + - name: uuid + in: path + description: UUID of the lecture + required: true + schema: + type: string + format: uuid + responses: + 200: + description: Successful operation + content: + text/plain: {} + 500: + description: Faild to retrieve network rules + /vmchooser/lecture/{uuid}/imagemeta: + get: + tags: + - vmchooser + summary: Get metadata of virtual mchine image for specified lecture + operationId: vmchooserGetLectureImageMeta + parameters: + - name: uuid + in: path + description: UUID of the lecture + required: true + schema: + type: string + format: uuid + responses: + 200: + description: Successful operation + content: + application/json: {} + 500: + description: Faild to retrieve metadata + /bwlp/container/clusterimages: + get: + tags: + - container + summary: List all bwLehrpool container images + operationId: bwlpGetClusterImagesList + responses: + 200: + description: Successful operation + content: + application/json: {} + 500: + description: Failed to retrieve container images + /image/container/{uuid}/metadata: + get: + tags: + - container + summary: Get metadata for specified container image + operationId: getContainerImageMetadata + parameters: + - name: uuid + in: path + description: UUID of the container + required: true + schema: + type: string + format: uuid + responses: + 200: + description: Successful operation + content: + application/json: {} + 500: + description: Failed to retrieve container metadata + /status/fileserver: + get: + tags: + - server + summary: Get bwLehrpool-Server status + operationId: getFileserverStatus + responses: + 200: + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/StatusFileserver' + /do/mailtest: + post: + tags: + - server + summary: Send a test mail from the bwLehrpool-Server + operationId: doMailtestOnFileserver + parameters: + - name: host + in: query + description: Domain of SMTP mail server + required: true + schema: + type: string + - name: port + in: query + description: Port of SMTP mail server + required: true + schema: + type: integer + format: int32 + - name: ssl + in: query + description: Encryption mode for the SMTP mail server + required: true + schema: + type: string + enum: + - 'NONE' + - 'IMPLICIT' + - 'EXPLICIT' + - name: serverName + in: query + description: Name of the SMTP mail server + required: true + schema: + type: string + - name: username + in: query + description: Username for the SMTP mail server + required: true + schema: + type: string + - name: password + in: query + description: Password for the SMTP mail server + required: true + schema: + type: string + - name: senderAddress + in: query + description: Sender address for the test mail + required: true + schema: + type: string + - name: recipient + in: query + description: Recipient for the test mail + required: true + schema: + type: string + - name: replyTo + in: query + description: Reply-To address for the test mail + required: true + schema: + type: string + responses: + 200: + description: Successful operation + content: + text/plain: {} + 400: + description: Failed to send test mail + /do/delete-images: + post: + tags: + - server + summary: Delete old images on the bwLehrpool-Server + operationId: doDeleteOldImagesOnFileserver + responses: + 200: + description: Successful operation + content: + text/plain: {} + 500: + description: Failed to delete old images + /do/start-image-check: + post: + tags: + - server + summary: Start image check on the bwLehrpool-Server + operationId: doStartImageCheckOnFileserver + parameters: + - name: versionid + in: query + description: Image version for the image check + required: true + schema: + type: string + format: uuid + - name: hash + in: query + description: Check hashes of images + required: true + schema: + type: boolean + - name: update + in: query + description: Update state of images + required: true + schema: + type: boolean + responses: + 200: + description: Successful operation + content: + text/plain: {} + 500: + description: Failed to start image check + /do/query-image-check: + post: + tags: + - server + summary: Query image check on the bwLehrpool-Server + operationId: doQueryImageCheckOnFileserver + parameters: + - name: versionid + in: query + description: Query image check for specified image version + required: false + schema: + type: string + format: uuid + responses: + 200: + description: Successful operation + content: + application/json: {} + 500: + description: Failed to query image check + /do/reset-mail-templates: + post: + tags: + - server + summary: Rest mail templates on the bwLehrpool-Server + operationId: doResetMailTemplatesOnFileserver + responses: + 200: + description: Successful operation + content: + text/plain: {} + 500: + description: Failed to reset mail templates + /do/scan-orphaned-files: + post: + tags: + - server + summary: Scan orphaned files on the bwLehrpool-Server + operationId: doScanOrphanedFilesOnFileserver + parameters: + - name: action + in: query + description: Action for orphaned files + required: false + schema: + type: string + enum: + - 'delete' + responses: + 200: + description: Successful operation + content: + application/json: {} + 500: + description: Failed to scan orphaned files +components: + schemas: + VirtualMachineImages: + type: object + properties: + settings: + type: array + items: + $ref: '#/components/schemas/VirtualMachineImage' + xml: + name: 'settings' + VirtualMachineImage: + type: object + properties: + name: + type: object + properties: + param: + type: string + xml: + attribute: true + xml: + name: 'image_name' + priority: + type: object + properties: + param: + type: integer + format: int32 + xml: + attribute: true + creator: + type: object + properties: + param: + type: string + xml: + attribute: true + shortDescription: + type: object + properties: + param: + type: string + xml: + attribute: true + xml: + name: 'short_description' + longDescription: + type: object + properties: + param: + type: string + xml: + attribute: true + xml: + name: 'long_description' + uuid: + type: object + properties: + param: + type: string + format: uuid + xml: + attribute: true + virtualMachine: + type: object + properties: + param: + type: string + xml: + attribute: true + xml: + name: 'virtualmachine' + os: + type: object + properties: + param: + type: string + xml: + attribute: true + icon: + type: object + properties: + param: + type: string + xml: + attribute: true + virtualizerName: + type: object + properties: + param: + type: string + xml: + attribute: true + xml: + name: 'virtualizer_name' + osName: + type: object + properties: + param: + type: string + xml: + attribute: true + xml: + name: 'os_name' + forLocation: + type: object + properties: + param: + type: string + xml: + attribute: true + xml: + name: 'for_location' + isTemplate: + type: object + properties: + param: + type: integer + format: int32 + enum: + - 0 + - 1 + xml: + attribute: true + xml: + name: 'is_template' + xml: + name: 'eintrag' + StatusFileserver: + type: object + properties: + activeUploads: + type: integer + format: int32 + activeDownloads: + type: integer + format: int32 @@ -13,6 +13,7 @@ <modules> <module>dozentenmodul</module> + <module>dozentenmodulserver/api</module> <module>dozentenmodulserver</module> </modules> </project> |