VILLASweb API (1.0.0)

Download OpenAPI specification:Download

API for VILLASweb. Documentation in progress... please be patient

simulations

Manage Simulations

Get all available simulations

Return a JSON representation of all simulations

Responses

200

Simulations received successfully TODO CHECK CODE!

400

Unable to receive simulations

get /simulations
http://111.222.333.444:5555/api/v1/simulations

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add a new simulation to the database

Request Body schema: application/json

Simulation object to add to DB

Name
required
string
Running
boolean
Models
Array of object (SimulationModel)
Projects
Array of object (Project)
UserID
required
integer
User
object (User)
StartParameters
object

Responses

400

Unable to find user or unable to create simulation

500

Unable to save user

post /simulations
http://111.222.333.444:5555/api/v1/simulations

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "Running": true,
  • "Models":
    [
    ],
  • "Projects":
    [
    ],
  • "UserID": 0,
  • "User":
    {
    },
  • "StartParameters": { }
}

Update properties of simulation with ID SimulationID

path Parameters
SimulationID
required
integer

ID of a simulation

Request Body schema: application/json

Simulation object with new properties

Name
required
string
Running
boolean
Models
Array of object (SimulationModel)
Projects
Array of object (Project)
UserID
required
integer
User
object (User)
StartParameters
object

Responses

400

PUT Simulation Unknown for ID or unable to save simulation

500

Unable to find user or unable to save user or

put /simulations/{SimulationID}
http://111.222.333.444:5555/api/v1/simulations/{SimulationID}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "Running": true,
  • "Models":
    [
    ],
  • "Projects":
    [
    ],
  • "UserID": 0,
  • "User":
    {
    },
  • "StartParameters": { }
}

Get properties of simulation with ID SimulationID

path Parameters
SimulationID
required
integer

ID of a simulation

Responses

200

Simulation received successfully (TODO CHECK CODE)

get /simulations/{SimulationID}
http://111.222.333.444:5555/api/v1/simulations/{SimulationID}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "Running": true,
  • "Models":
    [
    ],
  • "Projects":
    [
    ],
  • "UserID": 0,
  • "User":
    {
    },
  • "StartParameters": { }
}

Delete simulation with ID SimulationID

path Parameters
SimulationID
required
integer

ID of a simulation

Responses

200

TODO RESPONSES!

delete /simulations/{SimulationID}
http://111.222.333.444:5555/api/v1/simulations/{SimulationID}

counts

Get counters for database elements

Get counters for all elements in the database

Responses

200

Counts successful (TODO CHECK IF CODE CORRECT!)

get /counts
http://111.222.333.444:5555/api/v1/counts

Response samples

application/json
Copy
Expand all Collapse all
{
  • "simulations": 0,
  • "users": 0,
  • "simulators": 0,
  • "projects": 0,
  • "visualizations": 0
}

files

Manage Files

Get files of user

Responses

200

Files obtained successfully (TODO CHECK CODE!)

500

Could not retrieve user's files

get /files
http://111.222.333.444:5555/api/v1/files

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get properties of file with ID FileID

path Parameters
FileID
required
integer

ID of a file

Responses

200

File received successfully (TODO CHECK CODE)

400

GET Unknown file for ID

get /files/{FileID}
http://111.222.333.444:5555/api/v1/files/{FileID}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "Path": "string",
  • "Type": "string",
  • "Size": 0,
  • "ImageHeight": 0,
  • "ImageWidth": 0,
  • "UserID": 0,
  • "User":
    {
    },
  • "Date": "string"
}

Delete file with ID FileID

path Parameters
FileID
required
integer

ID of a file

Responses

200

TODO RESPONSES!

400

DELETE unknown file for id

500

Unable to remove file

delete /files/{FileID}
http://111.222.333.444:5555/api/v1/files/{FileID}

projects

Manage Projects

Get projects of user

Responses

200

Projects received successfully TODO CHECK CODE!

400

Unable to receive projects

get /projects
http://111.222.333.444:5555/api/v1/projects

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add a new project to the database

Request Body schema: application/json

Project object to add to DB

Name
required
string
UserID
required
integer
User
object (User)
SimulationID
required
integer
Simulation
object (Simulation)
Visualizations
Array of object (Visualization)

Responses

400

Unable to find user or unable to save user or unknown project for id

500

Unable to create project or unable to save project

post /projects
http://111.222.333.444:5555/api/v1/projects

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "UserID": 0,
  • "User":
    {
    },
  • "SimulationID": 0,
  • "Simulation":
    {
    },
  • "Visualizations":
    [
    ]
}

Update properties of project with ID ProjectID

path Parameters
ProjectID
required
integer

ID of a project

Request Body schema: application/json

Project object with new properties

Name
required
string
UserID
required
integer
User
object (User)
SimulationID
required
integer
Simulation
object (Simulation)
Visualizations
Array of object (Visualization)

Responses

400

PUT Simulation Unknown for ID

500

Unable to find user or unable to save user or unable to find simulation of project or unable to save simulation of project or unable to save project

put /projects/{ProjectID}
http://111.222.333.444:5555/api/v1/projects/{ProjectID}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "UserID": 0,
  • "User":
    {
    },
  • "SimulationID": 0,
  • "Simulation":
    {
    },
  • "Visualizations":
    [
    ]
}

Get properties of project with ID ProjectID

path Parameters
ProjectID
required
integer

ID of a project

Responses

200

Project received successfully (TODO CHECK CODE)

400

GET Unknown project for ID

get /projects/{ProjectID}
http://111.222.333.444:5555/api/v1/projects/{ProjectID}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "UserID": 0,
  • "User":
    {
    },
  • "SimulationID": 0,
  • "Simulation":
    {
    },
  • "Visualizations":
    [
    ]
}

Delete project with ID ProjectID

path Parameters
ProjectID
required
integer

ID of a project

Responses

400

DELETE Unknown project

500

Unable to find user or unable to save user or unable to remove project

delete /projects/{ProjectID}
http://111.222.333.444:5555/api/v1/projects/{ProjectID}

simulationmodels

Manage SimulationModels

Get simulation models of user

Responses

200

SimulationModel received successfully TODO CHECK CODE!

400

Unable to find SimulationModel

get /models
http://111.222.333.444:5555/api/v1/models

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add a new SimulationModel to the database

Request Body schema: application/json

SimulationModel object to add to DB

Name
required
string
OutputLength
required
integer
InputLength
required
integer
BelongsToSimulationID
required
integer
BelongsToSimulation
object (Simulation)
BelongsToSimulatorID
required
integer
BelongsToSimulator
object (Simulator)
StartParameters
object
OutputMapping
Array of object (Signal)
InputMapping
Array of object (Signal)

Responses

400

Unable to find Simulation

500

Unable to save simulation or unable to create simulation model

post /models
http://111.222.333.444:5555/api/v1/models

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "OutputLength": 0,
  • "InputLength": 0,
  • "BelongsToSimulationID": 0,
  • "BelongsToSimulation":
    {
    },
  • "BelongsToSimulatorID": 0,
  • "BelongsToSimulator":
    {
    },
  • "StartParameters": { },
  • "OutputMapping":
    [
    ],
  • "InputMapping":
    [
    ]
}

Update properties of SimulationModel with ID SimulationModelID

path Parameters
SimulationModelID
required
integer

ID of a SimulationModel

Request Body schema: application/json

SimulationModel object with new properties

Name
required
string
OutputLength
required
integer
InputLength
required
integer
BelongsToSimulationID
required
integer
BelongsToSimulation
object (Simulation)
BelongsToSimulatorID
required
integer
BelongsToSimulator
object (Simulator)
StartParameters
object
OutputMapping
Array of object (Signal)
InputMapping
Array of object (Signal)

Responses

400

Unable to find SimulationModel

500

Unable to save SimulationModel

put /models/{SimulationModelID}
http://111.222.333.444:5555/api/v1/models/{SimulationModelID}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "OutputLength": 0,
  • "InputLength": 0,
  • "BelongsToSimulationID": 0,
  • "BelongsToSimulation":
    {
    },
  • "BelongsToSimulatorID": 0,
  • "BelongsToSimulator":
    {
    },
  • "StartParameters": { },
  • "OutputMapping":
    [
    ],
  • "InputMapping":
    [
    ]
}

Get properties of SimulationModel with ID SimulationModelID

path Parameters
SimulationModelID
required
integer

ID of a SimulationModel

Responses

200

SimulationModel received successfully (TODO CHECK CODE)

400

GET Unknown SimulationModel for ID

get /models/{SimulationModelID}
http://111.222.333.444:5555/api/v1/models/{SimulationModelID}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "OutputLength": 0,
  • "InputLength": 0,
  • "BelongsToSimulationID": 0,
  • "BelongsToSimulation":
    {
    },
  • "BelongsToSimulatorID": 0,
  • "BelongsToSimulator":
    {
    },
  • "StartParameters": { },
  • "OutputMapping":
    [
    ],
  • "InputMapping":
    [
    ]
}

Delete SimulationModel with ID SimulationModelID

path Parameters
SimulationModelID
required
integer

ID of a SimulationModel

Responses

400

DELETE Unknown SimulationModel

500

Unable to find Simulation or unable to save changed simulation or unable to remove SimulationModel

delete /models/{SimulationModelID}
http://111.222.333.444:5555/api/v1/models/{SimulationModelID}

simulators

Manage Simulators

Get simulators

Responses

200

Simulators received successfully TODO CHECK CODE!

400

Unable to find Simulators

get /simulators
http://111.222.333.444:5555/api/v1/simulators

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add a new Simulator to the database

Request Body schema: application/json

Simulator object to add to DB

UUID
required
string
Host
required
string
ModelType
required
string
UpTime
integer
State
string
StateUpdateAt
string
Properties
object
RawProperties
object

Responses

500

Unable to create simulator

post /simulators
http://111.222.333.444:5555/api/v1/simulators

Request samples

application/json
Copy
Expand all Collapse all
{
  • "UUID": "string",
  • "Host": "string",
  • "ModelType": "string",
  • "UpTime": 0,
  • "State": "string",
  • "StateUpdateAt": "string",
  • "Properties": { },
  • "RawProperties": { }
}

Update properties of Simulator with ID SimulatorID

path Parameters
SimulatorID
required
integer

ID of a Simulator

Request Body schema: application/json

Simulator object with new properties

UUID
required
string
Host
required
string
ModelType
required
string
UpTime
integer
State
string
StateUpdateAt
string
Properties
object
RawProperties
object

Responses

400

PUT Unknown simulator

500

PUT ERROR finding simulator or Unable to save Simulator

put /simulators/{SimulatorID}
http://111.222.333.444:5555/api/v1/simulators/{SimulatorID}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "UUID": "string",
  • "Host": "string",
  • "ModelType": "string",
  • "UpTime": 0,
  • "State": "string",
  • "StateUpdateAt": "string",
  • "Properties": { },
  • "RawProperties": { }
}

Get properties of Simulator with ID SimulatorID

path Parameters
SimulatorID
required
integer

ID of a Simulator

Responses

200

Simulator received successfully (TODO CHECK CODE)

400

GET Unknown Simulator for ID

get /simulators/{SimulatorID}
http://111.222.333.444:5555/api/v1/simulators/{SimulatorID}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "UUID": "string",
  • "Host": "string",
  • "ModelType": "string",
  • "UpTime": 0,
  • "State": "string",
  • "StateUpdateAt": "string",
  • "Properties": { },
  • "RawProperties": { }
}

Delete Simulator with ID SimulatorID

path Parameters
SimulatorID
required
integer

ID of a Simulator

Responses

400

DELETE Unknown Simulator

500

Unable to remove Simulator

delete /simulators/{SimulatorID}
http://111.222.333.444:5555/api/v1/simulators/{SimulatorID}

Send actions to Simulator with ID SimulatorID

path Parameters
SimulatorID
required
integer

ID of a Simulator

Request Body schema: application/json

Array containing simulator actions

Array
string

Responses

400

POST unknown simulator

500

Unable to send actions to simulator

post /simulators/{SimulatorID}
http://111.222.333.444:5555/api/v1/simulators/{SimulatorID}

Request samples

application/json
Copy
Expand all Collapse all
[
  • "string"
]

uploads

Manage Uploads

Upload a new file to the database

Request Body schema: application/json

File object to upload TODO CHANGE TO FORM

Name
required
string
Path
required
string
Type
required
string
Size
required
integer
ImageHeight
integer
ImageWidth
integer
UserID
required
integer
User
object (User)
Date
required
string

Responses

400

File could not be uploaded because unable to process incoming form

500

File could not be uploaded and GET unable to find user or unable to save reference file or unable to save user or unable to create directory

post /uploads
http://111.222.333.444:5555/api/v1/uploads

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "Path": "string",
  • "Type": "string",
  • "Size": 0,
  • "ImageHeight": 0,
  • "ImageWidth": 0,
  • "UserID": 0,
  • "User":
    {
    },
  • "Date": "string"
}

users

Manage Users

Get users

Responses

200

Users received successfully TODO CHECK CODE!

400

Unable to receive Users

get /users
http://111.222.333.444:5555/api/v1/users

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add a new User to the database

Request Body schema: application/json

User object to add to DB

Username
required
string
Password
required
string
Role
required
string
Mail
required
string
Projects
Array of object (Project)
Simulations
Array of object (Simulation)
Files
Array of object (File)

Responses

400

Unable to create user with existing username, username is already taken

500

Unable to create user

post /users
http://111.222.333.444:5555/api/v1/users

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Username": "string",
  • "Password": "string",
  • "Role": "string",
  • "Mail": "string",
  • "Projects":
    [
    ],
  • "Simulations":
    [
    ],
  • "Files":
    [
    ]
}

Update properties of User with ID UserID

path Parameters
UserID
required
integer

ID of a User

Request Body schema: application/json

User object with new properties

Username
required
string
Password
required
string
Role
required
string
Mail
required
string
Projects
Array of object (Project)
Simulations
Array of object (Simulation)
Files
Array of object (File)

Responses

400

Username is already taken

403

Invalid authorization

404

Unable to find user

500

PUT Unknown user

put /users/{UserID}
http://111.222.333.444:5555/api/v1/users/{UserID}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Username": "string",
  • "Password": "string",
  • "Role": "string",
  • "Mail": "string",
  • "Projects":
    [
    ],
  • "Simulations":
    [
    ],
  • "Files":
    [
    ]
}

Get properties of User with ID UserID

path Parameters
UserID
required
integer

ID of a User

Responses

200

User received successfully (TODO CHECK CODE)

400

GET Unknown User for ID

get /users/{UserID}
http://111.222.333.444:5555/api/v1/users/{UserID}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "Username": "string",
  • "Password": "string",
  • "Role": "string",
  • "Mail": "string",
  • "Projects":
    [
    ],
  • "Simulations":
    [
    ],
  • "Files":
    [
    ]
}

Delete User with ID UserID

path Parameters
UserID
required
integer

ID of a User

Responses

400

DELETE Unknown User

500

Unable to remove User

delete /users/{UserID}
http://111.222.333.444:5555/api/v1/users/{UserID}

Get properties of user that issues the request

Responses

200

User received successfully (TODO CHECK CODE)

400

GET Unknown User for ID (TODO CHECK CODE)

get /users/me
http://111.222.333.444:5555/api/v1/users/me

Response samples

application/json
Copy
Expand all Collapse all
{
  • "Username": "string",
  • "Password": "string",
  • "Role": "string",
  • "Mail": "string",
  • "Projects":
    [
    ],
  • "Simulations":
    [
    ],
  • "Files":
    [
    ]
}

Authenticate a user

Request Body schema: application/json

User object to authenticate

Username
required
string
Password
required
string
Role
required
string
Mail
required
string
Projects
Array of object (Project)
Simulations
Array of object (Simulation)
Files
Array of object (File)

Responses

200

Authentication successful (TODO CHECK CODE and TOKEN)

400

Unable to create user with existing username, username is already taken

401

Invalid or missing credentials, unkown username or wrong password

500

Unable to compare passwords, internal server error

post /authenticate
http://111.222.333.444:5555/api/v1/authenticate

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Username": "string",
  • "Password": "string",
  • "Role": "string",
  • "Mail": "string",
  • "Projects":
    [
    ],
  • "Simulations":
    [
    ],
  • "Files":
    [
    ]
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "Success": true,
  • "message": "string",
  • "token": { }
}

visualizations

Manage Visualizations

Get all available visualizations

Return a JSON representation of all visualizations

Responses

200

Visualizations received successfully TODO CHECK CODE!

400

Unable to receive visualizations

get /visualizations
http://111.222.333.444:5555/api/v1/visualizations

Response samples

application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add a new visualization to the database

Request Body schema: application/json

Visualization object to add to DB

Name
required
string
Grid
required
integer
UserID
required
integer
User
object (User)
ProjectID
required
integer
Project
object (Project)
Widgets
Array of object (Widget)

Responses

400

Unable to find project

500

Unable to save project or unable to create visualization

post /visualizations
http://111.222.333.444:5555/api/v1/visualizations

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "Grid": 0,
  • "UserID": 0,
  • "User":
    {
    },
  • "ProjectID": 0,
  • "Project":
    {
    },
  • "Widgets":
    [
    ]
}

Update properties of Visualization with ID VisualizationID

path Parameters
VisualizationID
required
integer

ID of a Visualization

Request Body schema: application/json

Visualization object with new properties

Name
required
string
Grid
required
integer
UserID
required
integer
User
object (User)
ProjectID
required
integer
Project
object (Project)
Widgets
Array of object (Widget)

Responses

400

PUT Unknown Visualization

500

Unable to save Visualization

put /visualization/{VisualizationID}
http://111.222.333.444:5555/api/v1/visualization/{VisualizationID}

Request samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "Grid": 0,
  • "UserID": 0,
  • "User":
    {
    },
  • "ProjectID": 0,
  • "Project":
    {
    },
  • "Widgets":
    [
    ]
}

Get properties of Visualization with ID VisualizationID

path Parameters
VisualizationID
required
integer

ID of a Visualization

Responses

200

Visualization received successfully (TODO CHECK CODE)

400

GET Unknown Visualization

get /visualization/{VisualizationID}
http://111.222.333.444:5555/api/v1/visualization/{VisualizationID}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "Name": "string",
  • "Grid": 0,
  • "UserID": 0,
  • "User":
    {
    },
  • "ProjectID": 0,
  • "Project":
    {
    },
  • "Widgets":
    [
    ]
}

Delete Visualization with ID VisualizationID

path Parameters
VisualizationID
required
integer

ID of a Visualization

Responses

400

DELETE Unknown Visualization or unable to find project

500

Unable to remove Visualization or Unable to save project

delete /visualization/{VisualizationID}
http://111.222.333.444:5555/api/v1/visualization/{VisualizationID}