Skip to main content

VILLASweb Backend API (2.0)

This is the VILLASweb Backend API v2.0. This documentation is auto-generated based on the API documentation in the code. The tool swag is used to auto-generate API docs for the gin-gonic framework. Authentication: Use the authenticate endpoint below to obtain a token for your user account, copy the token into to the value field of the dialog showing up for the green Authorize button below and confirm with Done.

Authentication

Bearer

Security Scheme Type API Key
Header parameter name: Authorization

authentication

Check if user is authenticated and provide details on how the user can authenticate

Responses

Response samples

Content type
application/json
{ }

Authentication for user

path Parameters
mechanism
required
string
Enum: "internal" "external"

Login mechanism

Request Body schema: application/json

loginRequest of user

Password
required
string
Username
required
string

Responses

Request samples

Content type
application/json
{
  • "Password": "string",
  • "Username": "string"
}

Response samples

Content type
application/json
{ }

config

Get config VILLASweb to be used by frontend

Responses

Response samples

Content type
application/json
{
  • "Providers": [
    ]
}

component-configurations

Get all component configurations of scenario

Authorizations:
query Parameters
scenarioID
required
integer

Scenario ID

Responses

Response samples

Content type
application/json
{ }

Add a component configuration to a scenario

Authorizations:
Request Body schema: application/json

component configuration to be added incl. IDs of scenario and IC

object (component_configuration.validNewConfig)

Responses

Request samples

Content type
application/json
{
  • "config": {
    }
}

Response samples

Content type
application/json
{ }

Get a component configuration

Authorizations:
path Parameters
configID
required
integer

Config ID

Responses

Response samples

Content type
application/json
{ }

Update a component configuration

Authorizations:
path Parameters
configID
required
integer

Config ID

Request Body schema: application/json

component configuration to be updated

object (component_configuration.validUpdatedConfig)

Responses

Request samples

Content type
application/json
{
  • "config": {
    }
}

Response samples

Content type
application/json
{ }

Delete a component configuration

Authorizations:
path Parameters
configID
required
integer

Config ID

Responses

Response samples

Content type
application/json
{ }

dashboards

Get all dashboards of scenario

Authorizations:
query Parameters
scenarioID
required
integer

Scenario ID

Responses

Response samples

Content type
application/json
{ }

Add a dashboard to a scenario

Authorizations:
Request Body schema: application/json

Dashboard to be added incl. ID of Scenario

object (dashboard.validNewDashboard)

Responses

Request samples

Content type
application/json
{
  • "dashboard": {
    }
}

Response samples

Content type
application/json
{ }

Get a dashboard

Authorizations:
path Parameters
dashboardID
required
integer

Dashboard ID

Responses

Response samples

Content type
application/json
{ }

Update a dashboard

Authorizations:
path Parameters
dashboardID
required
integer

Dashboard ID

Request Body schema: application/json

Dashboard to be updated

object (dashboard.validUpdatedDashboard)

Responses

Request samples

Content type
application/json
{
  • "dashboard": {
    }
}

Response samples

Content type
application/json
{ }

Delete a dashboard

Authorizations:
path Parameters
dashboardID
required
integer

Dashboard ID

Responses

Response samples

Content type
application/json
{ }

files

Get all files of a specific scenario

Authorizations:
query Parameters
scenarioID
required
integer

Scenario ID

Responses

Response samples

Content type
application/json
{ }

Add a file to a specific scenario

Authorizations:
query Parameters
scenarioID
required
integer

ID of scenario to which file shall be added

Request Body schema:
inputFile
required
string <binary>

File to be uploaded

Responses

Response samples

Content type
application/json
{ }

Download a file

Authorizations:
path Parameters
fileID
required
integer

ID of the file to download

Responses

Update a file

Authorizations:
path Parameters
fileID
required
integer

ID of the file to update

Request Body schema:
inputFile
required
string <binary>

File to be uploaded

Responses

Response samples

Content type
application/json
{ }

Delete a file

Authorizations:
path Parameters
fileID
required
integer

ID of the file to update

Responses

Response samples

Content type
application/json
{ }

healthz

Get health status of backend

Responses

Response samples

Content type
application/json
"string"

infrastructure-components

Get all infrastructure components

Authorizations:

Responses

Response samples

Content type
application/json
{ }

Add an infrastructure component

Authorizations:
Request Body schema: application/json

Infrastructure Component to be added

object (infrastructure_component.validNewIC)

Responses

Request samples

Content type
application/json
{
  • "ic": {
    }
}

Response samples

Content type
application/json
{ }

Get infrastructure component

Authorizations:
path Parameters
ICID
required
integer

Infrastructure Component ID

Responses

Response samples

Content type
application/json
{ }

Update an infrastructure component

Authorizations:
path Parameters
ICID
required
integer

InfrastructureComponent ID

Request Body schema: application/json

InfrastructureComponent to be updated

object (infrastructure_component.validUpdatedIC)

Responses

Request samples

Content type
application/json
{
  • "ic": {
    }
}

Response samples

Content type
application/json
{ }

Delete an infrastructure component

Authorizations:
path Parameters
ICID
required
integer

Infrastructure Component ID

Responses

Response samples

Content type
application/json
{ }

Send an action to IC (only available if backend server is started with -amqp parameter)

Authorizations:
path Parameters
ICID
required
integer

InfrastructureComponent ID

query Parameters
inputAction
required
string

Action for IC

Responses

Response samples

Content type
application/json
{ }

Get all configurations of the infrastructure component

Authorizations:
path Parameters
ICID
required
integer

Infrastructure Component ID

Responses

Response samples

Content type
application/json
{ }

metrics

Prometheus metrics endpoint

Responses

Response samples

Content type
application/json
"string"

openapi

Get OpenAPI 2.0 spec of API

Responses

Response samples

Content type
application/json
"string"

results

Get all results of scenario

Authorizations:
query Parameters
scenarioID
required
integer

Scenario ID

Responses

Response samples

Content type
application/json
{ }

Add a result to a scenario

Authorizations:
Request Body schema: application/json

Result to be added incl. ID of Scenario

object (result.validNewResult)

Responses

Request samples

Content type
application/json
{
  • "result": {
    }
}

Response samples

Content type
application/json
{ }

Get a Result

Authorizations:
path Parameters
resultID
required
integer

Result ID

Responses

Response samples

Content type
application/json
{ }

Update a result

Authorizations:
path Parameters
resultID
required
integer

Result ID

Request Body schema: application/json

Result to be updated

object (result.validUpdatedResult)

Responses

Request samples

Content type
application/json
{
  • "result": {
    }
}

Response samples

Content type
application/json
{ }

Delete a Result incl. all result files

Authorizations:
path Parameters
resultID
required
integer

Result ID

Responses

Response samples

Content type
application/json
{ }

Upload a result file to the DB and associate it with scenario and result

Authorizations:
path Parameters
resultID
required
integer

Result ID

Request Body schema:
inputFile
required
string <binary>

File to be uploaded

Responses

Response samples

Content type
application/json
{ }

Delete a result file

Authorizations:
path Parameters
resultID
required
integer

Result ID

fileID
required
integer

ID of the file to delete

Responses

Response samples

Content type
application/json
{ }

scenarios

Get all scenarios of requesting user

Authorizations:

Responses

Response samples

Content type
application/json
{ }

Add a scenario

Authorizations:
Request Body schema: application/json

Scenario to be added

object (scenario.validNewScenario)

Responses

Request samples

Content type
application/json
{
  • "scenario": {
    }
}

Response samples

Content type
application/json
{ }

Get scenario

Authorizations:
path Parameters
scenarioID
required
integer

Scenario ID

Responses

Response samples

Content type
application/json
{ }

Update a scenario

Authorizations:
path Parameters
scenarioID
required
integer

Scenario ID

Request Body schema: application/json

Scenario to be updated

object (scenario.validUpdatedScenario)

Responses

Request samples

Content type
application/json
{
  • "scenario": {
    }
}

Response samples

Content type
application/json
{ }

Delete a scenario

Authorizations:
path Parameters
scenarioID
required
integer

Scenario ID

Responses

Response samples

Content type
application/json
{ }

Add a user to a a scenario

Authorizations:
path Parameters
scenarioID
required
integer

Scenario ID

query Parameters
username
required
string

User name

Responses

Response samples

Content type
application/json
{ }

Delete a user from a scenario

Authorizations:
path Parameters
scenarioID
required
integer

Scenario ID

query Parameters
username
required
string

User name

Responses

Response samples

Content type
application/json
{ }

Get users of a scenario

Authorizations:
path Parameters
scenarioID
required
integer

Scenario ID

Responses

Response samples

Content type
application/json
{ }

signals

Get all signals of one direction

Authorizations:
query Parameters
direction
required
string

Direction of signal (in or out)

configID
required
string

Config ID of signals to be obtained

Responses

Response samples

Content type
application/json
{ }

Add a signal to a signal mapping of a component configuration

Authorizations:
Request Body schema: application/json

A signal to be added to the component configuration incl. direction and config ID to which signal shall be added

object (signal.validNewSignal)

Responses

Request samples

Content type
application/json
{
  • "signal": {
    }
}

Response samples

Content type
application/json
{ }

Get a signal

Authorizations:
path Parameters
signalID
required
integer

ID of signal to be obtained

Responses

Response samples

Content type
application/json
{ }

Update a signal

Authorizations:
path Parameters
signalID
required
integer

ID of signal to be updated

Request Body schema: */*

A signal to be updated

object (signal.validUpdatedSignal)

Responses

Response samples

Content type
application/json
{ }

Delete a signal

Authorizations:
path Parameters
signalID
required
integer

ID of signal to be deleted

Responses

Response samples

Content type
application/json
{ }

users

Get all users

Authorizations:

Responses

Response samples

Content type
application/json
{ }

Add a user

Authorizations:
Request Body schema: application/json

User to be added

object (user.validNewUser)

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{ }

Get user

Authorizations:
path Parameters
userID
required
integer

User ID

Responses

Response samples

Content type
application/json
{ }

Update a user

Authorizations:
path Parameters
userID
required
integer

User ID

Request Body schema: application/json

User to be updated (anything except for ID can be changed, role can only be change by admin)

object (user.validUpdatedRequest)

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{ }

Delete a user

Authorizations:
path Parameters
userID
required
integer

User ID

Responses

Response samples

Content type
application/json
{ }

widgets

Get all widgets of dashboard

Authorizations:
query Parameters
dashboardID
required
integer

Dashboard ID

Responses

Response samples

Content type
application/json
{ }

Add a widget to a dashboard

Authorizations:
Request Body schema: application/json

Widget to be added incl. ID of dashboard

object (widget.validNewWidget)

Responses

Request samples

Content type
application/json
{
  • "widget": {
    }
}

Response samples

Content type
application/json
{ }

Get a widget

Authorizations:
path Parameters
widgetID
required
integer

Widget ID

Responses

Response samples

Content type
application/json
{ }

Update a widget

Authorizations:
path Parameters
widgetID
required
integer

Widget ID

Request Body schema: application/json

Widget to be updated

object (widget.validUpdatedWidget)

Responses

Request samples

Content type
application/json
{
  • "widget": {
    }
}

Response samples

Content type
application/json
{ }

Delete a widget

Authorizations:
path Parameters
widgetID
required
integer

Widget ID

Responses

Response samples

Content type
application/json
{ }