openapi: '3.0.3'


info:
  title: 'FVA Simulation Hub'
  description: The FVA Simulation Hub is a web service that provides the functions of the FVA-Workbench in a network.
  version: '2.1.0'

paths:

  /actuator/health:
    get:
      summary: Health
      description: Returns the current execution status of the application.
      operationId: actuatorHealth
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/HealthResponse'
        '401':
          description: Unauthorized

  /actuator/info:
    get:
      summary: Info
      description: Provides various information about the application.
      operationId: actuatorInfo
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/InfoResponse'
        '401':
          description: Unauthorized

  /actuator/logfile:
    get:
      summary: Logfile
      description: Returns the contents of the log file to the application.
      operationId: actuatorLogfile
      responses:
        '200':
          description: OK
          content:
            'text/plain':
              schema:
                type: string
        '401':
          description: Unauthorized

  /api/2.0/auth/login:
    post:
      summary: Login
      description: Enables authentication towards the application.
      operationId: authLogin
      requestBody:
        content:
          'application/json':
            schema:
              $ref: '#/components/schemas/LoginRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/LoginResponse'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/auth/refresh:
    get:
      summary: Refresh
      description: Updates the current authentication token.
      operationId: authRefresh
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/LoginResponse'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/auth/logout:
    get:
      summary: Logout
      description: Logs out the logged in user.
      operationId: authLogout
      responses:
        '200':
          description: OK
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/user:
    get:
      summary: User
      description: Provides information about the logged in user.
      operationId: user
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/UserResponse'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/task/simulate-work/create:
    post:
      summary: Simulate Work (Create)
      description: Simulates work by blocking a workbench for a certain period of time.
      operationId: workbenchTaskSimulateWorkCreate
      requestBody:
        content:
          'application/json':
            schema:
              $ref: '#/components/schemas/SimulateWorkRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/SimulateWorkResponse'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '423':
          description: 'Locked: The requested resource is currently locked.'
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/task/simulate-work/{taskId}/result:
    get:
      summary: Simulate Work (Result)
      description: Query of results for a previous simulate work request.
      operationId: workbenchTaskSimulateWorkResult
      parameters:
        - $ref: '#/components/parameters/taskId'
        - $ref: '#/components/parameters/timeout'
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/SimulateWorkResponse'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/task/execute-batch-job/create:
    post:
      summary: Execute Batch Job (Create)
      description: Executes a batch job with a workbench.
      operationId: workbenchTaskExecuteBatchJobCreate
      requestBody:
        content:
          'application/json':
            schema:
              $ref: '#/components/schemas/ExecuteBatchJobRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ExecuteBatchJobResponse'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '423':
          description: 'Locked: The requested resource is currently locked.'
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/task/execute-batch-job/{taskId}/result:
    get:
      summary: Execute Batch Job (Result)
      description: Query of results for a previous execute batch job request.
      operationId: workbenchTaskExecuteBatchJobResult
      parameters:
        - $ref: '#/components/parameters/taskId'
        - $ref: '#/components/parameters/timeout'
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/ExecuteBatchJobResponse'
        '201':
          description: Created
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/task/list:
    get:
      summary: Task List
      description: Returns a paged list of information about all tasks.
      operationId: workbenchTaskList
      parameters:
        - $ref: '#/components/parameters/paging-page'
        - $ref: '#/components/parameters/paging-size'
        - name: id
          in: query
          description: Filters by the task ID.
          schema:
            type: string
        - name: type
          in: query
          description: Filters by the task type.
          schema:
            type: string
            enum:
            - SIMULATE_WORK
            - EXECUTE_BATCH_JOB
            - AGENT_TAKEOVER
        - name: name
          in: query
          description: Filters by the task name.
          schema:
            type: string
        - name: priority
          in: query
          description: Filters by the task priority.
          schema:
            type: string
            enum:
            - HIGHEST
            - HIGH
            - NORMAL
            - LOW
            - LOWEST
        - name: creator
          in: query
          description: Filters by the task creator.
          schema:
            type: string
        - name: status
          in: query
          description: Filters by the task status.
          schema:
            type: array
            items:
              type: string
              enum:
              - WAITING
              - SCHEDULED
              - RUNNING
              - CANCELED
              - FINISHED
              - FAILED
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/WorkbenchTaskPage'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/task/{taskId}:
    get:
      summary: Task
      description: Provides information about a task.
      operationId: workbenchTask
      parameters:
        - $ref: '#/components/parameters/taskId'
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/WorkbenchTask'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/task/{taskId}/log:
    get:
      summary: Task (Log)
      description: Returns the log output for a task.
      operationId: workbenchTaskLog
      parameters:
        - $ref: '#/components/parameters/taskId'
      responses:
        '200':
          description: OK
          content:
            'text/plain':
              schema:
                type: string
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/task/{taskId}/cancel:
    delete:
      summary: Task (Cancel)
      description: Cancels the execution of a task and deletes it from the queue.
      operationId: workbenchTaskCancel
      parameters:
        - $ref: '#/components/parameters/taskId'
      responses:
        '204':
          description: 'No Content: OK'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: 'Conflict: Task could not be canceled.'
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/task/{taskId}/delete:
    delete:
      summary: Task (Delete)
      description: Delete a task and it's result.
      operationId: workbenchTaskDelete
      parameters:
        - $ref: '#/components/parameters/taskId'
      responses:
        '204':
          description: 'No Content: OK'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '409':
          description: 'Conflict: Task could not be deleted.'
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/node/instance/list:
    get:
      summary: Node Instance List
      description: Returns a paged list of information about all FVA-Workbench instances.
      operationId: workbenchNodeInstanceList
      parameters:
        - $ref: '#/components/parameters/paging-page'
        - $ref: '#/components/parameters/paging-size'
        - name: id
          in: query
          description: Filters by the instance ID.
          schema:
            type: string
        - name: version
          in: query
          description: Filters by the instance version.
          schema:
            type: string
        - name: labels
          in: query
          description: Filters by the instance labels.
          schema:
            type: array
            items:
              type: string
        - name: status
          in: query
          description: Filters by the instance status.
          schema:
            type: array
            items:
              type: string
              enum:
              - PENDING
              - ANALYSING
              - STARTING
              - STOPPING
              - UP
              - DOWN
              - CORRUPT
        - name: working
          in: query
          description: Filters by the instance working state.
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/WorkbenchInstancePage'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/node/instance/{nodeId}:
    get:
      summary: Node Instance
      description: Provides information about an FVA-Workbench instance.
      operationId: workbenchInstance
      parameters:
        - $ref: '#/components/parameters/nodeId'
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/WorkbenchInstance'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/node/instance/{nodeId}/log/{logType}:
    get:
      summary: Node Instance (Log)
      description: Returns the log output for an FVA Workbench instance.
      operationId: workbenchInstanceLog
      parameters:
        - $ref: '#/components/parameters/nodeId'
        - name: logType
          in: path
          required: true
          description: The type of the log file.
          schema:
            type: string
            enum:
            - .log
            - fvaworkbench.log
      responses:
        '200':
          description: OK
          content:
            'text/plain':
              schema:
                type: string
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'
        '502':
          description: Bad Gateway

  /api/2.0/workbench/node/instance/{nodeId}/start:
    patch:
      summary: Node Instance (Start)
      description: Starts running an FVA-Workbench instance.
      operationId: workbenchInstanceStart
      parameters:
        - $ref: '#/components/parameters/nodeId'
      responses:
        '202':
          description: Accepted
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'
        '502':
          description: Bad Gateway

  /api/2.0/workbench/node/instance/{nodeId}/restart:
    patch:
      summary: Node Instance (Restart)
      description: Restarts an FVA-Workbench instance.
      operationId: workbenchInstanceRestart
      parameters:
        - $ref: '#/components/parameters/nodeId'
      responses:
        '202':
          description: Accepted
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'
        '502':
          description: Bad Gateway

  /api/2.0/workbench/node/instance/{nodeId}/stop:
    patch:
      summary: Node Instance (Stop)
      description: Stops running a running FVA-Workbench instance.
      operationId: workbenchInstanceStop
      parameters:
        - $ref: '#/components/parameters/nodeId'
      responses:
        '202':
          description: Accepted
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'
        '502':
          description: Bad Gateway

  /api/2.0/workbench/node/agent/list:
    get:
      summary: Node Agent List
      description: Returns a paged list of information about all connected FVA Simulation Hub agents.
      operationId: workbenchNodeAgentList
      parameters:
        - $ref: '#/components/parameters/paging-page'
        - $ref: '#/components/parameters/paging-size'
        - name: id
          in: query
          description: Filters by the agent ID.
          schema:
            type: string
        - name: version
          in: query
          description: Filters by the agent version.
          schema:
            type: string
        - name: status
          in: query
          description: Filters by the agent status.
          schema:
            type: array
            items:
              type: string
              enum:
              - PENDING
              - UP
              - DOWN
              - OFFLINE
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/WorkbenchAgentPage'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/workbench/node/agent/{nodeId}:
    get:
      summary: Node Agent
      description: Provides information about a connected FVA Simulation Hub agent.
      operationId: workbenchAgent
      parameters:
        - $ref: '#/components/parameters/nodeId'
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/WorkbenchAgent'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.1/storage/input/status:
    get:
      summary: Storage Input (Status)
      description: Returns information about the status of the input storage.
      operationId: storageInputStatus
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/StorageStatusResponse'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/storage/input/upload:
    post:
      summary: Storage Input (Upload)
      description: Loads a file into the application's input storage.
      operationId: storageInputUpload
      parameters:
        - name: overwrite
          in: query
          description: Specifies whether the file should be overwritten if it already exists.
          schema:
            type: boolean
        - name: encrypt
          in: query
          description: Specifies whether the file should be stored encrypted in the storage.
          schema:
            type: boolean
      requestBody:
        content:
          'multipart/form-data':
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '204':
          description: 'No Content: The file was saved successfully.'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '409':
          description: 'Conflict: The file with the name already exists.'
        '423':
          description: 'Locked: The input storage endpoints were not enabled through the application configuration.'
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/storage/input/{name}:
    get:
      summary: Storage Input (Info)
      description: Returns information about a file from the application's input storage.
      operationId: storageInputInfo
      parameters:
        - $ref: '#/components/parameters/storage-name'
        - name: renewExpirationTimestamp
          in: query
          description: Specifies whether the expiration timestamp should be renewed.
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/StorageFileInfoResponse'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '423':
          description: 'Locked: The input storage endpoints were not enabled through the application configuration.'
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/storage/input/{name}/delete:
    delete:
      summary: Storage Input (Delete)
      description: Deletes a file from the application's input storage.
      operationId: storageInputDelete
      parameters:
        - $ref: '#/components/parameters/storage-name'
      responses:
        '204':
          description: 'No Content: The file was deleted successfully.'
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '423':
          description: 'Locked: The input storage endpoints were not enabled through the application configuration.'
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/storage/output/{name}/download:
    get:
      summary: Storage Output (Info)
      description: Returns the contents of a file from the application's output storage.
      operationId: storageOutputDownload
      parameters:
        - $ref: '#/components/parameters/storage-name'
      responses:
        '200':
          description: OK
          content:
            'application/octet-stream':
              schema:
                type: binary
        '400':
          description: 'Bad Request: The parameters passed are not valid.'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '423':
          description: 'Locked: The output storage endpoints were not enabled through the application configuration.'
        '500':
          description: 'Internal Server Error: Unexpected processing error'

  /api/2.0/monitoring/server-info:
    get:
      summary: Server Info
      description: Provides various information about the operation of the application.
      operationId: monitoringServerInfo
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/MonitoringServerInfoResponse'
        '401':
          description: Unauthorized

  /api/2.0/admin/prepare-shutdown:
    get:
      summary: Prepare Shutdown
      description:
      operationId: adminPrepareShutdown
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/AdminPrepareShutdownResponse'
        '401':
          description: Unauthorized

  /api/2.0/admin/prepare-shutdown/change:
    get:
      summary: Prepare Shutdown (Change)
      description:
      operationId: adminPrepareShutdownChange
      requestBody:
        content:
          'application/json':
            schema:
              $ref: '#/components/schemas/AdminPrepareShutdownChangeRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            'application/json':
              schema:
                $ref: '#/components/schemas/AdminPrepareShutdownResponse'
        '401':
          description: Unauthorized

components:

  parameters:

    taskId:
      name: taskId
      in: path
      required: true
      description: The id of the task to retrieve.
      schema:
        type: string

    timeout:
      name: timeout
      in: query
      required: false
      description: The maximum time to wait for the task to finish in seconds (use the value 0 to get an immediate response)
      schema:
        type: integer

    nodeId:
      name: nodeId
      in: path
      required: true
      description: The id of the node to retrieve.
      schema:
        type: string

    paging-page:
      name: page
      in: query
      required: false
      description: The page to be returned.
      schema:
        type: integer

    paging-size:
      name: size
      in: query
      required: false
      description: The number of items to be returned.
      schema:
        type: integer

    storage-name:
      name: name
      in: path
      required: true
      description: The unique name of the file.
      schema:
        type: string

  schemas:

    HealthResponse:
      description: Model with the properties for the response of the health endpoint.
      type: object
      properties:
        status:
          description: The cumulative status of all components.
          type: string
          enum:
          - UP
          - DOWN
        components:
          description: A listing of all components that are included in the health status.
          $ref: '#/components/schemas/HealthComponents'

    HealthComponents:
      description: Model with the properties of all Health components.
      type: object
      properties:
        diskSpace:
          description: Information on checking for low disk space.
          $ref: '#/components/schemas/HealthDiskSpaceResponse'
        ping:
          description: Information about the availability of the application.
          $ref: '#/components/schemas/HealthPingResponse'

    HealthDiskSpaceResponse:
      description: Model with disk space check properties.
      type: object
      properties:
        status:
          description: The status of this component.
          type: string
          enum:
          - UP
          - DOWN
        details:
          description: Details about this component.
          $ref: '#/components/schemas/HealthDiskSpaceDetails'

    HealthDiskSpaceDetails:
      description: Model with the detailed properties to check for low disk space.
      type: object
      properties:
        total:
          description: Total available disk space in bytes.
          type: integer
          format: int64
        free:
          description: The free space on the disk in bytes.
          type: integer
          format: int64
        threshold:
          description: The difference between available and free disk space in bytes. With more than 10 megabytes of free hard disk space, the Statue UP.
          type: integer
          format: int64
        exists:
          description: Indicates whether the checked directory exists. By default, the installation directory is checked.
          type: boolean

    HealthPingResponse:
      description: Model with the properties for checking the availability of the application.
      type: object
      properties:
        status:
          description: The status of this component.
          type: string
          enum:
          - UP
          - DOWN

    InfoResponse:
      description: Model with the properties for the response of the info endpoint.
      type: object
      properties:
        application:
          description: Information about the application.
          $ref: '#/components/schemas/InfoApplication'

    InfoApplication:
      description: Information about the application.
      type: object
      properties:
        name:
          description: The name of the application.
          type: string
          example: FVA Simulation Hub
        version:
          description: The version of the application.
          type: string
          example: 1.0.0
        revision:
          description: The revision number of the application.
          type: string
          example: 57685
        buildDate:
          description: The build date of the application.
          type: string
          example: 2022-05-27T13:50:08.523+0100
        vendor:
          description: The vendor of the application.
          type: string
          example: FVA GmbH

    LoginRequest:
      description: Model with the properties for the login.
      type: object
      required:
      - username
      - password
      properties:
        username:
          description: The username of the user.
          example: user1
          type: string
          minLength: 1
          maxLength: 2147483647
        password:
          description: The password of the user.
          example: password1
          type: string
          minLength: 1
          maxLength: 2147483647

    LoginResponse:
      description: Model with the properties for the response of the login.
      type: object
      required:
      - accessToken
      properties:
        accessToken:
          description: The access token for further requests.
          example: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyMiIsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MC9hcGkvMS4wL2F1d'
          type: string
          minLength: 1
          maxLength: 2147483647

    UserResponse:
      description: Model with the properties for the response of the user endpoint.
      type: object
      required:
      - username
      properties:
        username:
          description: The username of the user.
          example: 'user1'
          type: string
          minLength: 1
          maxLength: 2147483647

    ExecuteBatchJobRequest:
      description: Model with the properties for the execution of a batch job.
      type: object
      required:
      - inputScripts
      properties:
        name:
          description: Name assigned to the request (to display in overviews).
          type: string
          minLength: 1
          maxLength: 2147483647
        classifiers:
          description: A list of classifiers for the request.
          $ref: '#/components/schemas/RequestClassifiers'
        additionalFiles:
          description: Additional files that can be referenced in the script files
          type: array
          items:
            $ref: '#/components/schemas/WorkbenchBatchAdditionalFile'
        inputModel:
          description: The model file for the batch job
          $ref: '#/components/schemas/WorkbenchModelFile'
        inputModelReference:
          description: The model file for the batch job as a reference
          $ref: '#/components/schemas/WorkbenchModelReference'
        inputScripts:
          description: The script files to be executed in the batch job
          type: array
          items:
            $ref: '#/components/schemas/WorkbenchScriptFile'
        variablesToInject:
          description: Freely definable variables that are provided in the script to be executed
          type: array
          items:
            $ref: '#/components/schemas/VariableToInject'
        jobTimeout:
          description: Delay in seconds before the job gets aborted by terminating the workbench instance.
          type: integer
          format: int64
          minimum: 1
          maximum: 1000
          exclusiveMinimum: false
          exclusiveMaximum: false

    ExecuteBatchJobResponse:
      description: Model with the properties for the response of a executed batch job.
      type: object
      properties:
        status:
          description: The execution status of the request.
          type: string
          enum:
          - WAITING
          - SCHEDULED
          - RUNNING
          - CANCELED
          - FINISHED
          - FAILED
        id:
          description: The identifier for later retrieval of the results
          type: string
          minLength: 1
          maxLength: 2147483647
        executingWorkbench:
          description: Information about the workbench that executed the task.
          $ref: '#/components/schemas/ExecutingWorkbench'
        outputFiles:
          description: The files that were generated when the Workbench Batch job was executed.
          type: array
          items:
            $ref: '#/components/schemas/WorkbenchBatchOutputFile'
        batchExecutionStatus:
          description: The result status of the batch execution.
          type: string
          enum:
          - OK
          - FAILED

    ExecutingWorkbench:
      description: Executing Workbench
      type: object
      required:
      - id
      - version
      properties:
        id:
          description: The identifier of the workbench.
          example: 'foo'
          type: string
          minLength: 1
          maxLength: 2147483647
        version:
          description: The version of the workbench.
          example: '7.0.0'
          type: string
          minLength: 1
          maxLength: 2147483647
        revision:
          description: The revision of the workbench.
          example: '12345'
          type: string
          minLength: 1
          maxLength: 2147483647

    RequestClassifiers:
      description: A list of classifiers for the request.
      type: array
      items:
       $ref: '#/components/schemas/RequestClassifier'

    RequestClassifier:
      description: Request classifier
      type: object
      required:
      - type
      - value
      properties:
        type:
          description: The type of the classifier
          type: string
          enum:
          - VERSION
          - PRIORITY
          - LABELS
        value:
          description: The value of the classifier
          type: string
          minLength: 1
          maxLength: 2147483647

    SimulateWorkRequest:
      description: Model with the properties for the execution of a simulated job.
      type: object
      required:
      - duration
      properties:
        name:
          description: Name assigned to the request (to display in overviews).
          type: string
          minLength: 1
          maxLength: 2147483647
        classifiers:
          description: A list of classifiers for the request.
          $ref: '#/components/schemas/RequestClassifiers'
        duration:
          description: Duration of the simulated job in seconds
          type: integer
          format: int64
          minimum: 1
          maximum: 1000
          exclusiveMinimum: false
          exclusiveMaximum: false

    SimulateWorkResponse:
      description: Model with the properties for the response after running a simulated job.
      type: object
      properties:
        status:
          description: The execution status of the request.
          type: string
          enum:
          - WAITING
          - SCHEDULED
          - RUNNING
          - CANCELED
          - FINISHED
          - FAILED
        id:
          description: The identifier for later retrieval of the results
          type: string
          minLength: 1
          maxLength: 2147483647
        executingWorkbench:
          description: Information about the workbench that executed the task.
          $ref: '#/components/schemas/ExecutingWorkbench'
        message:
          description: Information about the execution of the simulated job
          type: string

    VariableToInject:
      description: Freely definable variables that are provided in the script to be executed for the execution of a batch job.
      type: object
      required:
      - key
      - value
      properties:
        key:
          description: The name of the variable.
          type: string
          minLength: 1
          maxLength: 2147483647
          example: Torque
        value:
          description: The value of the variable.
          type: string
          minLength: 1
          maxLength: 2147483647
          example: 320

    WorkbenchBatchAdditionalFile:
      description: Additional file for batch jobs of various types
      type: object
      required:
      - content
      - filename
      properties:
        content:
          description: The content of the file encoded with Base64
          type: string
          minLength: 1
          maxLength: 2147483647
        filename:
          description: The name of the file for referencing in the script files
          type: string
          minLength: 1
          maxLength: 255
          example: reportTemplate.wbrep

    WorkbenchBatchOutputFile:
      description: A file that was generated during a workbench batch job.
      type: object
      required:
      - content
      - filename
      properties:
        content:
          description: The content of the file encoded with Base64
          type: string
        directory:
          description: The relative path to the directory of the file
          type: string
        filename:
          description: The name of the file
          type: string
          example: result_report.html

    WorkbenchModelFile:
      description: Workbench model file
      type: object
      required:
      - content
      - type
      properties:
        content:
          description: The content of the file encoded with Base64
          example: 'UEsDBAoAAAAAAOCItFQAAAAAAAAAAAAAAAAPACQAcmVzdWxGCKBLABJSlo773Se4TzZ8QhcIhIIZFJikOmJmrHpbvH+fR4eHu4eHu6//I/Py0S7JnkRZ+mvPxiP...'
          type: string
          minLength: 1
          maxLength: 2147483647
        type:
          description: The file type of the Workbench model
          type: string
          enum:
          - WBPZ
          - WBPX
          - WBPS
          - REXS
          - REXSZ
          - REXSJ

    WorkbenchModelReference:
      description: Workbench model reference
      type: object
      required:
      - type
      properties:
        type:
          description: The file type of the Workbench model reference
          type: string
          enum:
          - LOCAL_FILESYSTEM
          - STORAGE
        parameters:
          description: Parameters for the workbench model reference
          type: array
          items:
            $ref: '#/components/schemas/WorkbenchModelReferenceParameter'

    WorkbenchModelReferenceParameter:
      description: Workbench model reference parameter.
      type: object
      required:
      - key
      - value
      properties:
        key:
          description: The name of the variable.
          type: string
          minLength: 1
          maxLength: 2147483647
        value:
          description: The value of the variable.
          type: string
          minLength: 1
          maxLength: 2147483647

    WorkbenchScriptFile:
      description: Workbench script file
      type: object
      required:
      - content
      properties:
        content:
          description: The content of the file encoded with Base64
          type: string
          minLength: 1
          maxLength: 2147483647

    WorkbenchTask:
      description: Model containing the properties for the response to the task endpoint.
      type: object
      required:
      - id
      - type
      - priority
      - requestedDatetime
      - status
      properties:
        id:
          description: The identifier of the task.
          type: string
          minLength: 1
          maxLength: 2147483647
        type:
          description: The type of the task.
          type: string
          enum:
          - SIMULATE_WORK
          - EXECUTE_BATCH_JOB
          - AGENT_TAKEOVER
        name:
          description: The name of the task (only if it was specified with the request).
          type: string
          minLength: 1
          maxLength: 2147483647
        priority:
          description: The priority of the task.
          type: string
          enum:
          - HIGHEST
          - HIGH
          - NORMAL
          - LOW
          - LOWEST
        creator:
          description: The name of the creator of the task (only if security was enabled).
          type: string
          minLength: 1
          maxLength: 2147483647
        requestedDatetime:
          description: The time the request was received.
          type: string
          minLength: 1
          maxLength: 2147483647
        startedDatetime:
          description: The time at which processing of the task started.
          type: string
          minLength: 1
          maxLength: 2147483647
        endedDatetime:
          description: The time at which the processing of the task was completed.
          type: string
          minLength: 1
          maxLength: 2147483647
        status:
          description: The status of the task.
          type: string
          enum:
          - WAITING
          - SCHEDULED
          - RUNNING
          - CANCELED
          - FINISHED
          - FAILED

    WorkbenchTaskPage:
      description: Model containing the properties for a page to respond to the task list endpoint.
      type: object
      required:
      - content
      - pageSize
      - pageNumber
      - totalElements
      - totalPages
      - size
      - first
      - last
      properties:
        content:
          description: A list of the tasks on this page.
          type: array
          items:
            $ref: '#/components/schemas/WorkbenchTask'
        pageSize:
          description: The number of maximum items on the page.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        pageNumber:
          description: The current page number.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        totalElements:
          description: The count of all elements.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        totalPages:
          description: The number of all pages considering all elements and the page size.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        size:
          description: The number of items in this page.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        first:
          description: Indicates whether this is the first page of all items.
          type: boolean
        last:
          description: Indicates whether this is the last page of all items.
          type: boolean

    WorkbenchInstance:
      description: Model with the properties for Response to the node instance endpoint.
      type: object
      required:
      - id
      - version
      - status
      - working
      properties:
        id:
          description: The identifier of the instance.
          type: string
          minLength: 1
          maxLength: 2147483647
        version:
          description: The version of the instance.
          type: string
          minLength: 1
          maxLength: 2147483647
        revision:
          description: The revision of the instance.
          type: string
          minLength: 1
          maxLength: 2147483647
        labels:
          description: A list of associated labels.
          type: array
          items:
            type: string
        agentId:
          description: The identifier of the FVA simulation hub, in case the FVA-Workbench instance is connected via load balancing.
          type: string
          minLength: 1
          maxLength: 2147483647
        status:
          description: The status of the instance.
          type: string
          enum:
          - PENDING
          - ANALYSING
          - STARTING
          - STOPPING
          - UP
          - DOWN
          - CORRUPT
        startedDatetime:
          description: The time the instance was started.
          type: string
          minLength: 1
          maxLength: 2147483647
        working:
          description: Indicates whether the FVA-Workbench instance is currently processing a task.
          type: boolean

    WorkbenchInstancePage:
      description: Model containing the properties for a page to respond to the Node-Instance-List endpoint.
      type: object
      required:
      - content
      - pageSize
      - pageNumber
      - totalElements
      - totalPages
      - size
      - first
      - last
      properties:
        content:
          description: A list of the FVA-Workbench instances of this page.
          type: array
          items:
            $ref: '#/components/schemas/WorkbenchInstance'
        pageSize:
          description: The number of maximum items on the page.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        pageNumber:
          description: The current page number.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        totalElements:
          description: The count of all elements.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        totalPages:
          description: The number of all pages considering all elements and the page size.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        size:
          description: The number of items in this page.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        first:
          description: Indicates whether this is the first page of all items.
          type: boolean
        last:
          description: Indicates whether this is the last page of all items.
          type: boolean

    WorkbenchAgent:
      description: Model with the properties for Response to the node agent endpoint.
      type: object
      required:
      - id
      - version
      - status
      properties:
        id:
          description: The identifier of the FVA Simulation Hub.
          type: string
          minLength: 1
          maxLength: 2147483647
        version:
          description: The version of the FVA Simulation Hub.
          type: string
          minLength: 1
          maxLength: 2147483647
        revision:
          description: The revision of the FVA Simulation Hub.
          type: string
          minLength: 1
          maxLength: 2147483647
        instances:
          description: A list of related FVA-Workbench instances.
          type: array
          items:
            $ref: '#/components/schemas/WorkbenchInstance'
        status:
          description: The status of the FVA Simulation Hub.
          type: string
          enum:
          - PENDING
          - UP
          - DOWN
          - OFFLINE

    WorkbenchAgentPage:
      description: Model with the properties for a page to respond to the node agent list endpoint.
      type: object
      required:
      - content
      - pageSize
      - pageNumber
      - totalElements
      - totalPages
      - size
      - first
      - last
      properties:
        content:
          description: A list of the FVA Simulation Hub instances on this page.
          type: array
          items:
            $ref: '#/components/schemas/WorkbenchAgent'
        pageSize:
          description: The number of maximum items on the page.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        pageNumber:
          description: The current page number.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        totalElements:
          description: The count of all elements.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        totalPages:
          description: The number of all pages considering all elements and the page size.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        size:
          description: The number of items in this page.
          type: integer
          format: int64
          minimum: 0
          maximum: 2147483647
          exclusiveMinimum: false
          exclusiveMaximum: false
        first:
          description: Indicates whether this is the first page of all items.
          type: boolean
        last:
          description: Indicates whether this is the last page of all items.
          type: boolean

    StorageStatusResponse:
      description: Model with the properties for the response of the storage status.
      type: object
      properties:
        active:
          description: Indicates whether the storage is active.
          type: boolean

    StorageFileInfoResponse:
      description: Model with the properties for the response of a storage file.
      type: object
      properties:
        exists:
          description: Indicates whether the file exists.
          type: boolean

    MonitoringServerInfoResponse:
      description: Model with the properties for the response of the server info endpoint.
      type: object
      properties:
        systemInfo:
          description: Information about the application's system environment.
          $ref: '#/components/schemas/SystemInfo'
        memoryInfo:
          description: Information about the application's memory.
          $ref: '#/components/schemas/MemoryInfo'

    SystemInfo:
      description: This model represents informations about the application's system environment.
      type: object
      properties:
        version:
          description: The version of the application.
          type: string
          example: 1.0.0
        revision:
          description: The revision number of the application.
          type: string
          example: 57685
        buildDate:
          description: The build date of the application.
          type: string
          example: 2022-05-27T13:50:08.523+0100
        serverTime:
          description: Server Time
          type: string
          example: '2024-07-08T13:49:13.5729978'
        uptime:
          description: Server Uptime
          type: string
          example: 0 days, 0 hours, 5 minutes, 31 seconds
        javaVersion:
          description: Java Version
          type: string
          example: 21.0.2
        javaVendor:
          description: Java Vendor
          type: string
          example: Eclipse Adoptium
        javaVm:
          description: Java VM
          type: string
          example: OpenJDK 64-Bit Server VM
        javaVmVersion:
          description: Java VM Version
          type: string
          example: 21.0.2+13-LTS
        javaRuntime:
          description: Java Runtime
          type: string
          example: OpenJDK Runtime Environment
        javaHome:
          description: Java Home
          type: string
          example: C:\\develop\\lib\\jdk-21.0.2
        osName:
          description: Operating System
          type: string
          example: Windows 10
        osArchitecture:
          description: OS Architecture
          type: string
          example: amd64
        osVersion:
          description: Version of the Operating System
          type: string
          example: 10.0
        fileEncoding:
          description: System Encoding
          type: string
          example: UTF-8
        userName:
          description: User Name
          type: string
          example: KarstenRoethig
        userDir:
          description: Current Working Directory
          type: string
          example: C:\\develop\\workspaces\\simulation-hub-workspace\\simulation-hub\\service
        userTimezone:
          description: User Timezone
          type: string
          example: Europe/Berlin
        userLocale:
          description: User Locale
          type: string
          example: DE_de
        inputArguments:
          description: VM arguments
          type: array
          items:
            type: string

    MemoryInfo:
      description: This model represents informations about the application's memory.
      type: object
      properties:
        totalFormatted:
          description: Total Memory
          type: string
          example: 9,92 GB
        usedFormatted:
          description: Used Memory
          type: string
          example: 9,88 GB
        freePercentage:
          description: Free Memory Percentage
          type: string
          example: 0
        freeFormatted:
          description: Free Memory
          type: string
          example: 46,6 MB

    AdminPrepareShutdownResponse:
      description: Model with the properties for the prepare shutdown status.
      type: object
      properties:
        initiated:
          description: Indicates whether the shutdown was initiated.
          type: boolean
          example: true
        initiationTime:
          description: Time of initiation.
          type: string
          example: '2024-07-08T13:49:13.5729978'

    AdminPrepareShutdownChangeRequest:
      description: Model with the properties for the prepare shutdown status change.
      type: object
      properties:
        newState:
          description: The desired status.
          type: boolean
          example: true
