mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
323 lines
6.5 KiB
YAML
323 lines
6.5 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: simulations
|
|
description: Manage Simulations
|
|
paths:
|
|
/simulations:
|
|
get:
|
|
tags:
|
|
- simulations
|
|
summary: Get all available simulations
|
|
description: Return a JSON representation of all simulations
|
|
operationId: getSimulations
|
|
responses:
|
|
400:
|
|
description: Unable to receive simulations
|
|
content: {}
|
|
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'
|
|
example:
|
|
name: Test
|
|
|
|
responses:
|
|
400:
|
|
description: Unable to find user or unable to create simulation
|
|
content: {}
|
|
500:
|
|
description: Unable to save user
|
|
content: {}
|
|
put:
|
|
tags:
|
|
- simulation
|
|
summary: Add simulation for user with ID userID
|
|
operationId: putSimulationForUser
|
|
parameters:
|
|
- name: userId
|
|
in: path
|
|
description: ID of the user to which the simulation shall be added
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
200:
|
|
description: Success
|
|
content: {}
|
|
500:
|
|
description: Internal server error
|
|
content: {}
|
|
|
|
|
|
components:
|
|
schemas:
|
|
Project:
|
|
required:
|
|
- Name
|
|
- SimulationID
|
|
- UserID
|
|
type: object
|
|
properties:
|
|
Name:
|
|
type: string
|
|
UserID:
|
|
type: integer
|
|
User:
|
|
type: object
|
|
properties: {}
|
|
SimulationID:
|
|
type: integer
|
|
Simulation:
|
|
type: object
|
|
properties: {}
|
|
Visualizations:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties: {}
|
|
Visualization:
|
|
required:
|
|
- Name
|
|
- Grid
|
|
- ProjectID
|
|
- UserID
|
|
type: object
|
|
properties:
|
|
Name:
|
|
type: string
|
|
Grid:
|
|
type: integer
|
|
UserID:
|
|
type: integer
|
|
User:
|
|
type: object
|
|
properties: {}
|
|
ProjectID:
|
|
type: integer
|
|
Project:
|
|
type: object
|
|
properties: {}
|
|
Widgets:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties: {}
|
|
User:
|
|
required:
|
|
- Username
|
|
- Password
|
|
- Role
|
|
- Mail
|
|
type: object
|
|
properties:
|
|
Username:
|
|
type: string
|
|
Password:
|
|
type: string
|
|
Role:
|
|
type: string
|
|
Mail:
|
|
type: string
|
|
Projects:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties: {}
|
|
Simulations:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties: {}
|
|
Files:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties: {}
|
|
Simulation:
|
|
required:
|
|
- Name
|
|
- UserID
|
|
type: object
|
|
properties:
|
|
Name:
|
|
type: string
|
|
Running:
|
|
type: boolean
|
|
Models:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties: {}
|
|
Projects:
|
|
type: array
|
|
items:
|
|
type: object
|
|
UserID:
|
|
type: integer
|
|
User:
|
|
type: object
|
|
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
|
|
User:
|
|
type: object
|
|
properties: {}
|
|
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
|
|
BelongsToSimulationID:
|
|
type: integer
|
|
Simulation:
|
|
type: object
|
|
properties: {}
|
|
BelongsToSimulatorID:
|
|
type: integer
|
|
Simulator:
|
|
type: object
|
|
properties: {}
|
|
StartParameters:
|
|
type: object
|
|
properties: {}
|
|
OutputMapping:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties: {}
|
|
InputMapping:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties: {}
|
|
Signal:
|
|
required:
|
|
- Name
|
|
- Unit
|
|
- SimulationModelID
|
|
type: objects
|
|
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: {}
|
|
|
|
|
|
|