VILLASweb Backend API (2.0)
Download OpenAPI specification:Download
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 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
- Payload
{- "Password": "string",
- "Username": "string"
}
Response samples
- 200
- 401
- 500
{ }
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
- Payload
{- "config": {
- "FileIDs": [
- 0
], - "ICID": 0,
- "Name": "string",
- "ScenarioID": 0,
- "StartParameters": {
- "json.RawMessage": [
- 0
]
}
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
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
- Payload
{- "config": {
- "FileIDs": [
- 0
], - "ICID": 0,
- "Name": "string",
- "StartParameters": {
- "json.RawMessage": [
- 0
]
}
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
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
- Payload
{- "dashboard": {
- "Grid": 0,
- "Height": 0,
- "Name": "string",
- "ScenarioID": 0
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
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
- Payload
{- "dashboard": {
- "grid": 0,
- "height": 0,
- "name": "string"
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
Add an infrastructure component
Authorizations:
Request Body schema: application/json
Infrastructure Component to be added
object (infrastructure_component.validNewIC) | |||||||||||||||||||||||||||||||
|
Responses
Request samples
- Payload
{- "ic": {
- "APIURL": "string",
- "Category": "string",
- "CreateParameterSchema": {
- "json.RawMessage": [
- 0
]
}, - "Description": "string",
- "Location": "string",
- "ManagedExternally": true,
- "Manager": "string",
- "Name": "string",
- "StartParameterSchema": {
- "json.RawMessage": [
- 0
]
}, - "State": "string",
- "StatusUpdateRaw": {
- "json.RawMessage": [
- 0
]
}, - "Type": "string",
- "UUID": "string",
- "Uptime": 0,
- "WebsocketURL": "string"
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
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
- Payload
{- "ic": {
- "APIURL": "string",
- "Category": "string",
- "CreateParameterSchema": {
- "json.RawMessage": [
- 0
]
}, - "Description": "string",
- "Location": "string",
- "Manager": "string",
- "Name": "string",
- "StartParameterSchema": {
- "json.RawMessage": [
- 0
]
}, - "State": "string",
- "StatusUpdateRaw": {
- "json.RawMessage": [
- 0
]
}, - "Type": "string",
- "UUID": "string",
- "Uptime": 0,
- "WebsocketURL": "string"
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
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
- 200
- 400
- 404
- 422
- 500
{ }
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
- Payload
{- "result": {
- "ConfigSnapshots": {
- "json.RawMessage": [
- 0
]
}, - "Description": "string",
- "ResultFileIDs": [
- 0
], - "ScenarioID": 0
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
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
- Payload
{- "result": {
- "configSnapshots": {
- "json.RawMessage": [
- 0
]
}, - "description": "string",
- "resultFileIDs": [
- 0
]
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
Add a scenario
Authorizations:
Request Body schema: application/json
Scenario to be added
object (scenario.validNewScenario) | |||||
|
Responses
Request samples
- Payload
{- "scenario": {
- "Name": "string",
- "StartParameters": {
- "json.RawMessage": [
- 0
]
}
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
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
- Payload
{- "scenario": {
- "IsLocked": true,
- "Name": "string",
- "StartParameters": {
- "json.RawMessage": [
- 0
]
}
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
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
- Payload
{- "signal": {
- "ConfigID": 0,
- "Direction": "string",
- "Index": 0,
- "Name": "string",
- "ScalingFactor": 0,
- "Unit": "string"
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
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
- 200
- 400
- 404
- 422
- 500
{ }
Add a user
Authorizations:
Request Body schema: application/json
User to be added
object (user.validNewUser) | |||||||||
|
Responses
Request samples
- Payload
{- "user": {
- "Mail": "string",
- "Password": "string",
- "Role": "string",
- "Username": "string"
}
}
Response samples
- 200
- 400
- 422
- 500
{ }
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
- Payload
{- "user": {
- "Active": "string",
- "Mail": "string",
- "OldPassword": "string",
- "Password": "string",
- "Role": "string",
- "Username": "string"
}
}
Response samples
- 200
- 400
- 403
- 404
- 422
- 500
{ }
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
- Payload
{- "widget": {
- "CustomProperties": {
- "json.RawMessage": [
- 0
]
}, - "DashboardID": 0,
- "Height": 0,
- "IsLocked": true,
- "MinHeight": 0,
- "MinWidth": 0,
- "Name": "string",
- "SignalIDs": [
- 0
], - "Type": "string",
- "Width": 0,
- "X": 0,
- "Y": 0,
- "Z": 0
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }
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
- Payload
{- "widget": {
- "CustomProperties": {
- "json.RawMessage": [
- 0
]
}, - "Height": 0,
- "IsLocked": true,
- "MinHeight": 0,
- "MinWidth": 0,
- "Name": "string",
- "SignalIDs": [
- 0
], - "Type": "string",
- "Width": 0,
- "X": 0,
- "Y": 0,
- "Z": 0
}
}
Response samples
- 200
- 400
- 404
- 422
- 500
{ }