From 96cd9a64aef9caf29ca668aeafc1ffb089acbe2b Mon Sep 17 00:00:00 2001 From: Manuel Bentele Date: Thu, 23 Dec 2021 15:12:17 +0100 Subject: [SERVER] Add Maven profile to generate server API automatically --- dozentenmodulserver/pom.xml | 38 ++ .../src/main/openapi/bwlp-server-openapi.yaml | 475 +++++++++++++++++++++ pom.xml | 1 + 3 files changed, 514 insertions(+) create mode 100644 dozentenmodulserver/src/main/openapi/bwlp-server-openapi.yaml 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 @@ + + api:generate + + generate-sources + + + org.openapitools + openapi-generator-maven-plugin + 5.3.1 + + + generate-sources + + generate + + + ${basedir}/src/main/openapi/bwlp-server-openapi.yaml + spring + ${basedir}/api + org.openslx.bwlp.sat.api + dozmod-server-api + org.openslx.bwlp.sat.api.handler + org.openslx.bwlp.sat.api.model + org.openslx.bwlp.sat.api.handler + true + + + + + + + @@ -207,6 +239,12 @@ + + org.openslx.bwlp.sat.api + dozmod-server-api + 1.0.0 + compile + mysql mysql-connector-java 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 diff --git a/pom.xml b/pom.xml index 84e71b7c..f33b1968 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,7 @@ dozentenmodul + dozentenmodulserver/api dozentenmodulserver -- cgit v1.2.3-55-g7522