mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00

- adding response codes to each endpoint - removing recursion from component models - changing order of tags
1386 lines
37 KiB
YAML
1386 lines
37 KiB
YAML
openapi: 3.0.1
|
|
info:
|
|
title: VILLASweb API
|
|
description: API for VILLASweb. Documentation in progress... please be patient
|
|
version: 1.0.0
|
|
servers:
|
|
- url: http://111.222.333.444:5555/api/v1
|
|
tags:
|
|
- name: authentication
|
|
description: Manage user authentication
|
|
- name: counts
|
|
description: Get counters for database elements
|
|
- name: users
|
|
description: Manage Users
|
|
- name: files
|
|
description: Manage Files
|
|
- name: simulators
|
|
description: Manage Simulators
|
|
- name: projects
|
|
description: Manage Projects
|
|
- name: simulations
|
|
description: Manage Simulations
|
|
- name: simulationmodels
|
|
description: Manage SimulationModels
|
|
- name: visualizations
|
|
description: Manage Visualizations
|
|
- name: uploads
|
|
description: Manage Uploads (REMOVED, now in files)
|
|
|
|
paths:
|
|
/authenticate:
|
|
post:
|
|
tags:
|
|
- authentication
|
|
summary: Authenticate a user
|
|
operationId: authenticateUser
|
|
requestBody:
|
|
description: "User object to authenticate"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
Success:
|
|
type: boolean
|
|
message:
|
|
type: string
|
|
token:
|
|
type: object
|
|
properties: {}
|
|
400:
|
|
description: Bad request. Unable to create user with existing username, username is already taken
|
|
401:
|
|
description: Unauthorized access. Invalid or missing credentials.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. User not found.
|
|
500:
|
|
description: Internal server error. Unable to compare passwords.
|
|
/counts:
|
|
get:
|
|
tags:
|
|
- counts
|
|
summary: Get counters for all elements in the database
|
|
operationId: getCounts
|
|
responses:
|
|
200:
|
|
description: Counts successful (TODO CHECK IF CODE CORRECT!)
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
simulations:
|
|
type: integer
|
|
description: number of simulations
|
|
users:
|
|
type: integer
|
|
description: number of users
|
|
simulators:
|
|
type: integer
|
|
description: number of simulators
|
|
projects:
|
|
type: integer
|
|
description: number of projects
|
|
visualizations:
|
|
type: integer
|
|
description: number of visualizations
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Unable to find at least one of the count targets.
|
|
500:
|
|
description: Internal server error.
|
|
/simulations:
|
|
get:
|
|
tags:
|
|
- simulations
|
|
summary: Get all available simulations
|
|
description: Return a JSON representation of all simulations
|
|
operationId: getSimulations
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Simulation'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. No simulations found.
|
|
500:
|
|
description: Internal server error.
|
|
post:
|
|
tags:
|
|
- simulations
|
|
summary: Add a new simulation to the database
|
|
operationId: addSimulation
|
|
requestBody:
|
|
description: "Simulation object to add to DB"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Simulation'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
500:
|
|
description: Internal server error.
|
|
/simulations/{SimulationID}:
|
|
put:
|
|
tags:
|
|
- simulations
|
|
summary: Update properties of simulation with ID SimulationID
|
|
operationId: updateSimulationProperties
|
|
parameters:
|
|
- in: path
|
|
name: SimulationID
|
|
description: ID of a simulation
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
description: "Simulation object with new properties"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Simulation'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Unable to find simulation or user.
|
|
500:
|
|
description: Internal server error. Unable to save user.
|
|
get:
|
|
tags:
|
|
- simulations
|
|
summary: Get properties of simulation with ID SimulationID
|
|
operationId: getSimulationProperties
|
|
parameters:
|
|
- in: path
|
|
name: SimulationID
|
|
description: ID of a simulation
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Simulation'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Unable to find simulation.
|
|
500:
|
|
description: Internal server error.
|
|
delete:
|
|
tags:
|
|
- simulations
|
|
summary: Delete simulation with ID SimulationID
|
|
operationId: deleteSimulation
|
|
parameters:
|
|
- in: path
|
|
name: SimulationID
|
|
description: ID of a simulation
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Unable to find simulation.
|
|
500:
|
|
description: Internal server error.
|
|
/files:
|
|
get:
|
|
tags:
|
|
- files
|
|
summary: Get files of user
|
|
operationId: getFilesOfUser
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/File'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. No files found.
|
|
500:
|
|
description: Internal server error. Could not retrieve user's files.
|
|
post:
|
|
tags:
|
|
- files
|
|
summary: Add a new file to the database (NEW, was /uploads before))
|
|
operationId: addFile
|
|
requestBody:
|
|
description: "File object to be added"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/File'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. File could not be uploaded because unable to process incoming form.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. User not found.
|
|
500:
|
|
description: Internal server error. Unable to save reference file or user OR unable to create directory.
|
|
/files/{FileID}:
|
|
get:
|
|
tags:
|
|
- files
|
|
summary: Get properties of file with ID FileID
|
|
operationId: getFileProperties
|
|
parameters:
|
|
- in: path
|
|
name: FileID
|
|
description: ID of a file
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
- in: header
|
|
name: X-Request-FileDesc
|
|
description: Set false if file itself, true if file description shall be returned
|
|
required: true
|
|
schema:
|
|
type: boolean
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/File'
|
|
model/x-cim.zip:
|
|
schema:
|
|
type: string
|
|
format: byte
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. File not found.
|
|
500:
|
|
description: Internal server error.
|
|
put:
|
|
tags:
|
|
- files
|
|
summary: Update properties of file with ID FileID (NEW)
|
|
operationId: updateFileProperties
|
|
requestBody:
|
|
description: "File object to be updated"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/File'
|
|
parameters:
|
|
- in: path
|
|
name: FileID
|
|
description: ID of a file
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. File could not be uploaded because unable to process incoming form.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. File not found.
|
|
500:
|
|
description: Internal server error. Unable to save reference file or user OR unable to create directory.
|
|
delete:
|
|
tags:
|
|
- files
|
|
summary: Delete file with ID FileID
|
|
operationId: deleteFile
|
|
parameters:
|
|
- in: path
|
|
name: FileID
|
|
description: ID of a file
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. File not found.
|
|
500:
|
|
description: Internal server error. Unable to remove file.
|
|
/projects:
|
|
get:
|
|
tags:
|
|
- projects
|
|
summary: Get projects of user
|
|
operationId: getProjects
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Project'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. No projects found.
|
|
500:
|
|
description: Internal server error.
|
|
post:
|
|
tags:
|
|
- projects
|
|
summary: Add a new project to the database
|
|
operationId: addProject
|
|
requestBody:
|
|
description: "Project object to add to DB"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Project'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Unknown user.
|
|
500:
|
|
description: Internal server error. Unable to save user or project.
|
|
/projects/{ProjectID}:
|
|
put:
|
|
tags:
|
|
- projects
|
|
summary: Update properties of project with ID ProjectID
|
|
operationId: updateProjectProperties
|
|
parameters:
|
|
- in: path
|
|
name: ProjectID
|
|
description: ID of a project
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
description: "Project object with new properties"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Project'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. Unable to process incoming form.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Project not found.
|
|
500:
|
|
description: Internal server error. Unable to save project or user.
|
|
get:
|
|
tags:
|
|
- projects
|
|
summary: Get properties of project with ID ProjectID
|
|
operationId: getProjectProperties
|
|
parameters:
|
|
- in: path
|
|
name: ProjectID
|
|
description: ID of a project
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Project'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Project not found.
|
|
500:
|
|
description: Internal server error.
|
|
delete:
|
|
tags:
|
|
- projects
|
|
summary: Delete project with ID ProjectID
|
|
operationId: deleteProject
|
|
parameters:
|
|
- in: path
|
|
name: ProjectID
|
|
description: ID of a project
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Project not found.
|
|
500:
|
|
description: Internal server error. Unable to remove project.
|
|
/models:
|
|
get:
|
|
tags:
|
|
- simulationmodels
|
|
summary: Get simulation models of user
|
|
operationId: getSimulationModels
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/SimulationModel'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. No simulation models found.
|
|
500:
|
|
description: Internal server error.
|
|
post:
|
|
tags:
|
|
- simulationmodels
|
|
summary: Add a new SimulationModel to the database
|
|
operationId: addSimulationModel
|
|
requestBody:
|
|
description: "SimulationModel object to add to DB"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SimulationModel'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. Unable to process incoming form.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
500:
|
|
description: Internal server error. Unable to save simulation or simulation model.
|
|
/models/{SimulationModelID}:
|
|
put:
|
|
tags:
|
|
- simulationmodels
|
|
summary: Update properties of SimulationModel with ID SimulationModelID
|
|
operationId: updateSimulationModelProperties
|
|
parameters:
|
|
- in: path
|
|
name: SimulationModelID
|
|
description: ID of a SimulationModel
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
description: "SimulationModel object with new properties"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SimulationModel'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. Unable to process incoming form.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Simulation model not found.
|
|
500:
|
|
description: Internal server error. Unable to save simulation model.
|
|
get:
|
|
tags:
|
|
- simulationmodels
|
|
summary: Get properties of SimulationModel with ID SimulationModelID
|
|
operationId: getSimulationModelProperties
|
|
parameters:
|
|
- in: path
|
|
name: SimulationModelID
|
|
description: ID of a SimulationModel
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SimulationModel'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Simulation model not found.
|
|
500:
|
|
description: Internal server error.
|
|
delete:
|
|
tags:
|
|
- simulationmodels
|
|
summary: Delete SimulationModel with ID SimulationModelID
|
|
operationId: deleteSimulationModel
|
|
parameters:
|
|
- in: path
|
|
name: SimulationModelID
|
|
description: ID of a SimulationModel
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Simulation or simulation model not found.
|
|
500:
|
|
description: Internal server error. Unable to save changed simulation or to remove simulation model.
|
|
/models/{SimulationModelID}/file:
|
|
get:
|
|
tags:
|
|
- simulationmodels
|
|
summary: Get file from SimulationModel with ID SimulationModelID (NEW)
|
|
operationId: getFileFromSimulationModel
|
|
parameters:
|
|
- in: path
|
|
name: SimulationModelID
|
|
description: ID of a SimulationModel
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
description: "Info about file to download"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
required:
|
|
- NumberOfFiles
|
|
- MIMEType
|
|
type: object
|
|
properties:
|
|
NumberOfFiles:
|
|
type: integer
|
|
MIMEType:
|
|
type: string
|
|
examples:
|
|
cim:
|
|
summary: "An example for CIM file"
|
|
value:
|
|
NumberOfFiles: 1
|
|
MIMEType: "model/x-cim.zip"
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
model/x-cim.zip:
|
|
schema:
|
|
type: string
|
|
format: byte
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Simulation model not found.
|
|
500:
|
|
description: Internal server error.
|
|
put:
|
|
tags:
|
|
- simulationmodels
|
|
summary: Update (Overwrite) file of SimulationModel with ID SimulationModelID, File object has to be in database (NEW)
|
|
operationId: updateFileForSimulationModel
|
|
parameters:
|
|
- in: path
|
|
name: SimulationModelID
|
|
description: ID of a SimulationModel
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
description: "File to be updated for simulation model"
|
|
required: true
|
|
content:
|
|
model/x-cim.zip:
|
|
schema:
|
|
type: string
|
|
format: byte
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Simulation model not found.
|
|
500:
|
|
description: Internal server error. Unable to save simulation model.
|
|
/simulators:
|
|
get:
|
|
tags:
|
|
- simulators
|
|
summary: Get simulators
|
|
operationId: getSimulators
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Simulator'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. No simulators found.
|
|
500:
|
|
description: Internal server error.
|
|
post:
|
|
tags:
|
|
- simulators
|
|
summary: Add a new Simulator to the database
|
|
operationId: addSimulator
|
|
requestBody:
|
|
description: "Simulator object to add to DB"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Simulator'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. Unable to process incoming form.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
500:
|
|
description: Internal server error. Unable to save simulator.
|
|
/simulators/{SimulatorID}:
|
|
put:
|
|
tags:
|
|
- simulators
|
|
summary: Update properties of Simulator with ID SimulatorID
|
|
operationId: updateSimulatorProperties
|
|
parameters:
|
|
- in: path
|
|
name: SimulatorID
|
|
description: ID of a Simulator
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
description: "Simulator object with new properties"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Simulator'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Simulator not found.
|
|
500:
|
|
description: Internal server error. Unable to save simulator.
|
|
get:
|
|
tags:
|
|
- simulators
|
|
summary: Get properties of Simulator with ID SimulatorID
|
|
operationId: getSimulatorProperties
|
|
parameters:
|
|
- in: path
|
|
name: SimulatorID
|
|
description: ID of a Simulator
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Simulator'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Simulator not found.
|
|
500:
|
|
description: Internal server error.
|
|
delete:
|
|
tags:
|
|
- simulators
|
|
summary: Delete Simulator with ID SimulatorID
|
|
operationId: deleteSimulator
|
|
parameters:
|
|
- in: path
|
|
name: SimulatorID
|
|
description: ID of a Simulator
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Simulator not found.
|
|
500:
|
|
description: Internal server error. Unable to remove simulator.
|
|
post:
|
|
tags:
|
|
- simulators
|
|
summary: Send actions to Simulator with ID SimulatorID
|
|
operationId: sendActionsToSimulator
|
|
parameters:
|
|
- in: path
|
|
name: SimulatorID
|
|
description: ID of a Simulator
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
description: "Array containing simulator actions"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
type: string
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. Unable to process incoming form.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Simulator not found.
|
|
500:
|
|
description: Internal server error. Unable to send actions to simulator.
|
|
/users:
|
|
get:
|
|
tags:
|
|
- users
|
|
summary: Get users
|
|
operationId: getUsers
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/User'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. No users found.
|
|
500:
|
|
description: Internal server error.
|
|
post:
|
|
tags:
|
|
- users
|
|
summary: Add a new User to the database
|
|
operationId: addUser
|
|
requestBody:
|
|
description: "User object to add to DB"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. Unable to process incoming form. Username is already taken
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
500:
|
|
description: Internal server error. Unable to save user.
|
|
/users/{UserID}:
|
|
put:
|
|
tags:
|
|
- users
|
|
summary: Update properties of User with ID UserID
|
|
operationId: updateUserProperties
|
|
parameters:
|
|
- in: path
|
|
name: UserID
|
|
description: ID of a User
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
description: "User object with new properties"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. Username is already taken.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. User not found.
|
|
500:
|
|
description: Internal server error.
|
|
get:
|
|
tags:
|
|
- users
|
|
summary: Get properties of User with ID UserID
|
|
operationId: getUserProperties
|
|
parameters:
|
|
- in: path
|
|
name: UserID
|
|
description: ID of a User
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. User not found.
|
|
500:
|
|
description: Internal server error.
|
|
delete:
|
|
tags:
|
|
- users
|
|
summary: Delete User with ID UserID
|
|
operationId: deleteUser
|
|
parameters:
|
|
- in: path
|
|
name: UserID
|
|
description: ID of a User
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. User not found.
|
|
500:
|
|
description: Internal server error. Unable to remove user.
|
|
/users/me:
|
|
get:
|
|
tags:
|
|
- users
|
|
summary: Get properties of user that issues the request (REMOVED)
|
|
operationId: getUserPropertiesCurrent
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/User'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. User not found.
|
|
500:
|
|
description: Internal server error.
|
|
/visualizations:
|
|
get:
|
|
tags:
|
|
- visualizations
|
|
summary: Get all available visualizations
|
|
description: Return a JSON representation of all visualizations
|
|
operationId: getVisualizations
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Visualization'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. No visualizations found.
|
|
500:
|
|
description: Internal server error.
|
|
post:
|
|
tags:
|
|
- visualizations
|
|
summary: Add a new visualization to the database
|
|
operationId: addVisualization
|
|
requestBody:
|
|
description: "Visualization object to add to DB"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Visualization'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. Unable to process incoming form.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Project of visualization not found.
|
|
500:
|
|
description: Internal server error. Unable to save project or visualization.
|
|
/visualization/{VisualizationID}:
|
|
put:
|
|
tags:
|
|
- visualizations
|
|
summary: Update properties of Visualization with ID VisualizationID
|
|
operationId: updateVisualizationrProperties
|
|
parameters:
|
|
- in: path
|
|
name: VisualizationID
|
|
description: ID of a Visualization
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
description: "Visualization object with new properties"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Visualization'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. Unable to process incoming form.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Visualization not found.
|
|
500:
|
|
description: Internal server error. Unable to save Visualization.
|
|
get:
|
|
tags:
|
|
- visualizations
|
|
summary: Get properties of Visualization with ID VisualizationID
|
|
operationId: getVisualizationProperties
|
|
parameters:
|
|
- in: path
|
|
name: VisualizationID
|
|
description: ID of a Visualization
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Visualization'
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Visualization not found.
|
|
500:
|
|
description: Internal server error.
|
|
delete:
|
|
tags:
|
|
- visualizations
|
|
summary: Delete Visualization with ID VisualizationID
|
|
operationId: deleteVisualization
|
|
parameters:
|
|
- in: path
|
|
name: VisualizationID
|
|
description: ID of a Visualization
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. Visualization or project of visualization not found.
|
|
500:
|
|
description: Internal server error. Unable to remove visualization or to save changed project.
|
|
/uploads:
|
|
post:
|
|
tags:
|
|
- uploads
|
|
summary: Upload a new file to the database (REMOVED)
|
|
operationId: uploadFile
|
|
requestBody:
|
|
description: "File object to upload TODO CHANGE TO FORM"
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/File'
|
|
responses:
|
|
200:
|
|
description: OK.
|
|
400:
|
|
description: Bad request. Unable to process incoming form.
|
|
401:
|
|
description: Unauthorized access.
|
|
403:
|
|
description: Access forbidden.
|
|
404:
|
|
description: Not found. User or reference file not found.
|
|
500:
|
|
description: Internal server error. Unable to save user or reference file OR unable to create directory.
|
|
|
|
|
|
components:
|
|
schemas:
|
|
Project:
|
|
required:
|
|
- Name
|
|
- SimulationID
|
|
- UserID
|
|
type: object
|
|
properties:
|
|
Name:
|
|
type: string
|
|
UserID:
|
|
type: integer
|
|
SimulationID:
|
|
type: integer
|
|
Visualization:
|
|
required:
|
|
- Name
|
|
- Grid
|
|
- ProjectID
|
|
- UserID
|
|
type: object
|
|
properties:
|
|
Name:
|
|
type: string
|
|
Grid:
|
|
type: integer
|
|
UserID:
|
|
type: integer
|
|
ProjectID:
|
|
type: integer
|
|
User:
|
|
required:
|
|
- Username
|
|
- Password
|
|
- Role
|
|
- Mail
|
|
type: object
|
|
properties:
|
|
Username:
|
|
type: string
|
|
Password:
|
|
type: string
|
|
Role:
|
|
type: string
|
|
Mail:
|
|
type: string
|
|
Simulation:
|
|
required:
|
|
- ID
|
|
- Name
|
|
- UserID
|
|
type: object
|
|
properties:
|
|
ID:
|
|
type: integer
|
|
Name:
|
|
type: string
|
|
Running:
|
|
type: boolean
|
|
UserID:
|
|
type: integer
|
|
StartParameters:
|
|
type: object
|
|
properties: {}
|
|
File:
|
|
required:
|
|
- Name
|
|
- Path
|
|
- Type
|
|
- Size
|
|
- Date
|
|
- UserID
|
|
type: object
|
|
properties:
|
|
Name:
|
|
type: string
|
|
Path:
|
|
type: string
|
|
Type:
|
|
type: string
|
|
Size:
|
|
type: integer
|
|
ImageHeight:
|
|
type: integer
|
|
ImageWidth:
|
|
type: integer
|
|
UserID:
|
|
type: integer
|
|
SimulationModelID:
|
|
type: integer
|
|
Date:
|
|
type: string
|
|
Simulator:
|
|
required:
|
|
- UUID
|
|
- Host
|
|
- ModelType
|
|
type: object
|
|
properties:
|
|
UUID:
|
|
type: string
|
|
Host:
|
|
type: string
|
|
ModelType:
|
|
type: string
|
|
UpTime:
|
|
type: integer
|
|
State:
|
|
type: string
|
|
StateUpdateAt:
|
|
type: string
|
|
Properties:
|
|
type: object
|
|
properties: {}
|
|
RawProperties:
|
|
type: object
|
|
properties: {}
|
|
SimulationModel:
|
|
required:
|
|
- Name
|
|
- OutputLength
|
|
- InputLength
|
|
- BelongsToSimulationID
|
|
- BelongsToSimulatorID
|
|
type: object
|
|
properties:
|
|
Name:
|
|
type: string
|
|
OutputLength:
|
|
type: integer
|
|
InputLength:
|
|
type: integer
|
|
SimulationID:
|
|
type: integer
|
|
SimulatorID:
|
|
type: integer
|
|
StartParameters:
|
|
type: object
|
|
properties: {}
|
|
OutputMapping:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Signal'
|
|
InputMapping:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Signal'
|
|
Signal:
|
|
required:
|
|
- Name
|
|
- Unit
|
|
- SimulationModelID
|
|
type: object
|
|
properties:
|
|
Name:
|
|
type: string
|
|
Unit:
|
|
type: string
|
|
SimulationModelID:
|
|
type: integer
|
|
Widget:
|
|
required:
|
|
- Name
|
|
- Type
|
|
- Width
|
|
- Height
|
|
- MinWidth
|
|
- MinHeight
|
|
- X
|
|
- Y
|
|
- Z
|
|
- IsLocked
|
|
- VisualizationID
|
|
type: object
|
|
properties:
|
|
Name:
|
|
type: string
|
|
Type:
|
|
type: string
|
|
Width:
|
|
type: integer
|
|
Height:
|
|
type: integer
|
|
MinWidth:
|
|
type: integer
|
|
MinHeight:
|
|
type: integer
|
|
X:
|
|
type: integer
|
|
Y:
|
|
type: integer
|
|
Z:
|
|
type: integer
|
|
IsLocked:
|
|
type: boolean
|
|
VisualizationID:
|
|
type: integer
|
|
CustomProperties:
|
|
type: object
|
|
properties: {}
|
|
|
|
|
|
|