From 1fa7444c66d91bccd2d00fcb7258d412129d2085 Mon Sep 17 00:00:00 2001 From: Sonja Happ Date: Fri, 26 Jun 2020 09:44:25 +0200 Subject: [PATCH] Add height parameter to dashboard data model #36 --- database/models.go | 2 + doc/api/docs.go | 250 +++-------------------- doc/api/swagger.json | 226 +------------------- doc/api/swagger.yaml | 223 +------------------- routes/dashboard/dashboard_methods.go | 5 +- routes/dashboard/dashboard_test.go | 1 + routes/dashboard/dashboard_validators.go | 11 +- 7 files changed, 60 insertions(+), 658 deletions(-) diff --git a/database/models.go b/database/models.go index 96590ce..970f5c4 100644 --- a/database/models.go +++ b/database/models.go @@ -145,6 +145,8 @@ type Dashboard struct { Name string `json:"name" gorm:"not null"` // Grid of dashboard Grid int `json:"grid" gorm:"default:15"` + // Height of dashboard + Height int `json:"height"` // ID of scenario to which dashboard belongs ScenarioID uint `json:"scenarioID"` // Widgets that belong to dashboard diff --git a/doc/api/docs.go b/doc/api/docs.go index 6af0f5f..fea7323 100644 --- a/doc/api/docs.go +++ b/doc/api/docs.go @@ -1,12 +1,13 @@ // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag at -// 2020-05-26 11:22:58.121837163 +0200 CEST m=+0.130733859 +// 2020-06-26 09:42:08.437454207 +0200 CEST m=+0.080918529 package docs import ( "bytes" "encoding/json" + "strings" "github.com/alecthomas/template" "github.com/swaggo/swag" @@ -16,8 +17,8 @@ var doc = `{ "schemes": {{ marshal .Schemes }}, "swagger": "2.0", "info": { - "description": "This is the VILLASweb Backend API v2.0.\nParts of this API are still in development. Please check the [VILLASweb-backend-go repository](https://git.rwth-aachen.de/acs/public/villas/web-backend-go) for more information.\nThis documentation is auto-generated based on the API documentation in the code. The tool [swag](https://github.com/swaggo/swag) is used to auto-generate API docs for the [gin-gonic](https://github.com/gin-gonic/gin) framework.", - "title": "VILLASweb Backend API", + "description": "{{.Description}}", + "title": "{{.Title}}", "contact": { "name": "Sonja Happ", "email": "sonja.happ@eonerc.rwth-aachen.de" @@ -26,10 +27,10 @@ var doc = `{ "name": "GNU GPL 3.0", "url": "http://www.gnu.de/documents/gpl-3.0.en.html" }, - "version": "2.0" + "version": "{{.Version}}" }, "host": "{{.Host}}", - "basePath": "/api/v2", + "basePath": "{{.BasePath}}", "paths": { "/authenticate": { "post": { @@ -60,21 +61,18 @@ var doc = `{ "200": { "description": "JSON web token, success status, message and authenticated user object", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseAuthenticate" } }, "401": { "description": "Unauthorized", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error.", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -111,28 +109,24 @@ var doc = `{ "200": { "description": "Component configurations which belong to scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfigs" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -173,35 +167,30 @@ var doc = `{ "200": { "description": "Component configuration that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfig" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -238,35 +227,30 @@ var doc = `{ "200": { "description": "component configuration that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfig" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -314,35 +298,30 @@ var doc = `{ "200": { "description": "Component configuration that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfig" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -377,35 +356,30 @@ var doc = `{ "200": { "description": "component configuration that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfig" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -442,28 +416,24 @@ var doc = `{ "200": { "description": "Dashboards which belong to scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseDashboards" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -504,35 +474,30 @@ var doc = `{ "200": { "description": "Dashboard that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseDashboard" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -569,35 +534,30 @@ var doc = `{ "200": { "description": "Dashboard that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseDashboard" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -645,35 +605,30 @@ var doc = `{ "200": { "description": "Dashboard that was updated", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseDashboard" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -708,35 +663,30 @@ var doc = `{ "200": { "description": "Dashboard that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseDashboard" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -773,28 +723,24 @@ var doc = `{ "200": { "description": "Files which belong to scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseFiles" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -844,35 +790,30 @@ var doc = `{ "200": { "description": "File that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseFile" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -914,35 +855,30 @@ var doc = `{ "200": { "description": "File that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseFile" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -992,35 +928,30 @@ var doc = `{ "200": { "description": "File that was updated", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseFile" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1055,35 +986,30 @@ var doc = `{ "200": { "description": "File that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseFile" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1107,7 +1033,6 @@ var doc = `{ "500": { "description": "Backend is NOT healthy", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1137,28 +1062,24 @@ var doc = `{ "200": { "description": "ICs requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseICs" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1199,35 +1120,30 @@ var doc = `{ "200": { "description": "Infrastructure Component that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseIC" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1264,35 +1180,30 @@ var doc = `{ "200": { "description": "Infrastructure Component that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseIC" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1340,35 +1251,30 @@ var doc = `{ "200": { "description": "Infrastructure Component that was updated", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseIC" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1403,35 +1309,30 @@ var doc = `{ "200": { "description": "Infrastructure Component that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseIC" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1468,35 +1369,30 @@ var doc = `{ "200": { "description": "Action sent successfully", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1533,35 +1429,30 @@ var doc = `{ "200": { "description": "Configs requested by user", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfigs" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1608,28 +1499,24 @@ var doc = `{ "200": { "description": "Scenarios to which user has access", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseScenarios" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1670,35 +1557,30 @@ var doc = `{ "200": { "description": "scenario that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseScenario" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1735,28 +1617,24 @@ var doc = `{ "200": { "description": "Scenario requested by user", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseScenario" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1804,35 +1682,30 @@ var doc = `{ "200": { "description": "Updated scenario.", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseScenario" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1867,28 +1740,24 @@ var doc = `{ "200": { "description": "Deleted scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseScenario" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1932,28 +1801,24 @@ var doc = `{ "200": { "description": "User that was added to scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1995,28 +1860,24 @@ var doc = `{ "200": { "description": "User that was deleted from scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2053,28 +1914,24 @@ var doc = `{ "200": { "description": "Array of users that have access to the scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUsers" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2118,28 +1975,24 @@ var doc = `{ "200": { "description": "Signals which belong to component configuration", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseSignals" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2180,35 +2033,30 @@ var doc = `{ "200": { "description": "Signal that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseSignal" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2245,35 +2093,30 @@ var doc = `{ "200": { "description": "Signal that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseSignal" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2318,35 +2161,30 @@ var doc = `{ "200": { "description": "Signal that was updated", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseSignal" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2381,35 +2219,30 @@ var doc = `{ "200": { "description": "Signal that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseSignal" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2439,28 +2272,24 @@ var doc = `{ "200": { "description": "Array of users", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUsers" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2501,28 +2330,24 @@ var doc = `{ "200": { "description": "Contains added user object", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2559,35 +2384,30 @@ var doc = `{ "200": { "description": "requested user", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "403": { "description": "Access forbidden.", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2635,42 +2455,36 @@ var doc = `{ "200": { "description": "Contains updated user", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "400": { "description": "Bad request.", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "403": { "description": "Access forbidden.", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2705,28 +2519,24 @@ var doc = `{ "200": { "description": "deleted user", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2763,28 +2573,24 @@ var doc = `{ "200": { "description": "Widgets to which belong to dashboard", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseWidgets" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2825,35 +2631,30 @@ var doc = `{ "200": { "description": "Widget that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseWidget" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2890,35 +2691,30 @@ var doc = `{ "200": { "description": "Widget that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseWidget" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2966,35 +2762,30 @@ var doc = `{ "200": { "description": "Widget that was updated", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseWidget" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -3029,35 +2820,30 @@ var doc = `{ "200": { "description": "Widget that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseWidget" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -3156,6 +2942,9 @@ var doc = `{ "Grid": { "type": "integer" }, + "Height": { + "type": "integer" + }, "Name": { "type": "string" }, @@ -3170,6 +2959,9 @@ var doc = `{ "grid": { "type": "integer" }, + "height": { + "type": "integer" + }, "name": { "type": "string" } @@ -3218,6 +3010,10 @@ var doc = `{ "description": "Grid of dashboard", "type": "integer" }, + "height": { + "description": "Height of dashboard", + "type": "integer" + }, "id": { "type": "integer" }, @@ -4021,11 +3817,21 @@ type swaggerInfo struct { } // SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = swaggerInfo{Schemes: []string{}} +var SwaggerInfo = swaggerInfo{ + Version: "2.0", + Host: "", + BasePath: "/api/v2", + Schemes: []string{}, + Title: "VILLASweb Backend API", + Description: "This is the VILLASweb Backend API v2.0.\nParts of this API are still in development. Please check the [VILLASweb-backend-go repository](https://git.rwth-aachen.de/acs/public/villas/web-backend-go) for more information.\nThis documentation is auto-generated based on the API documentation in the code. The tool [swag](https://github.com/swaggo/swag) is used to auto-generate API docs for the [gin-gonic](https://github.com/gin-gonic/gin) framework.", +} type s struct{} func (s *s) ReadDoc() string { + sInfo := SwaggerInfo + sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) + t, err := template.New("swagger_info").Funcs(template.FuncMap{ "marshal": func(v interface{}) string { a, _ := json.Marshal(v) @@ -4037,7 +3843,7 @@ func (s *s) ReadDoc() string { } var tpl bytes.Buffer - if err := t.Execute(&tpl, SwaggerInfo); err != nil { + if err := t.Execute(&tpl, sInfo); err != nil { return doc } diff --git a/doc/api/swagger.json b/doc/api/swagger.json index 7901d8c..6129aae 100644 --- a/doc/api/swagger.json +++ b/doc/api/swagger.json @@ -13,7 +13,6 @@ }, "version": "2.0" }, - "host": "{{.Host}}", "basePath": "/api/v2", "paths": { "/authenticate": { @@ -45,21 +44,18 @@ "200": { "description": "JSON web token, success status, message and authenticated user object", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseAuthenticate" } }, "401": { "description": "Unauthorized", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error.", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -96,28 +92,24 @@ "200": { "description": "Component configurations which belong to scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfigs" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -158,35 +150,30 @@ "200": { "description": "Component configuration that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfig" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -223,35 +210,30 @@ "200": { "description": "component configuration that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfig" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -299,35 +281,30 @@ "200": { "description": "Component configuration that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfig" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -362,35 +339,30 @@ "200": { "description": "component configuration that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfig" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -427,28 +399,24 @@ "200": { "description": "Dashboards which belong to scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseDashboards" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -489,35 +457,30 @@ "200": { "description": "Dashboard that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseDashboard" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -554,35 +517,30 @@ "200": { "description": "Dashboard that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseDashboard" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -630,35 +588,30 @@ "200": { "description": "Dashboard that was updated", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseDashboard" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -693,35 +646,30 @@ "200": { "description": "Dashboard that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseDashboard" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -758,28 +706,24 @@ "200": { "description": "Files which belong to scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseFiles" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -829,35 +773,30 @@ "200": { "description": "File that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseFile" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -899,35 +838,30 @@ "200": { "description": "File that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseFile" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -977,35 +911,30 @@ "200": { "description": "File that was updated", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseFile" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1040,35 +969,30 @@ "200": { "description": "File that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseFile" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1092,7 +1016,6 @@ "500": { "description": "Backend is NOT healthy", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1122,28 +1045,24 @@ "200": { "description": "ICs requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseICs" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1184,35 +1103,30 @@ "200": { "description": "Infrastructure Component that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseIC" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1249,35 +1163,30 @@ "200": { "description": "Infrastructure Component that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseIC" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1325,35 +1234,30 @@ "200": { "description": "Infrastructure Component that was updated", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseIC" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1388,35 +1292,30 @@ "200": { "description": "Infrastructure Component that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseIC" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1453,35 +1352,30 @@ "200": { "description": "Action sent successfully", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1518,35 +1412,30 @@ "200": { "description": "Configs requested by user", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseConfigs" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1593,28 +1482,24 @@ "200": { "description": "Scenarios to which user has access", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseScenarios" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1655,35 +1540,30 @@ "200": { "description": "scenario that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseScenario" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1720,28 +1600,24 @@ "200": { "description": "Scenario requested by user", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseScenario" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1789,35 +1665,30 @@ "200": { "description": "Updated scenario.", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseScenario" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1852,28 +1723,24 @@ "200": { "description": "Deleted scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseScenario" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1917,28 +1784,24 @@ "200": { "description": "User that was added to scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -1980,28 +1843,24 @@ "200": { "description": "User that was deleted from scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2038,28 +1897,24 @@ "200": { "description": "Array of users that have access to the scenario", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUsers" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2103,28 +1958,24 @@ "200": { "description": "Signals which belong to component configuration", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseSignals" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2165,35 +2016,30 @@ "200": { "description": "Signal that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseSignal" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2230,35 +2076,30 @@ "200": { "description": "Signal that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseSignal" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2303,35 +2144,30 @@ "200": { "description": "Signal that was updated", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseSignal" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2366,35 +2202,30 @@ "200": { "description": "Signal that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseSignal" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2424,28 +2255,24 @@ "200": { "description": "Array of users", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUsers" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2486,28 +2313,24 @@ "200": { "description": "Contains added user object", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2544,35 +2367,30 @@ "200": { "description": "requested user", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "403": { "description": "Access forbidden.", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2620,42 +2438,36 @@ "200": { "description": "Contains updated user", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "400": { "description": "Bad request.", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "403": { "description": "Access forbidden.", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2690,28 +2502,24 @@ "200": { "description": "deleted user", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseUser" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2748,28 +2556,24 @@ "200": { "description": "Widgets to which belong to dashboard", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseWidgets" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2810,35 +2614,30 @@ "200": { "description": "Widget that was added", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseWidget" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2875,35 +2674,30 @@ "200": { "description": "Widget that was requested", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseWidget" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -2951,35 +2745,30 @@ "200": { "description": "Widget that was updated", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseWidget" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -3014,35 +2803,30 @@ "200": { "description": "Widget that was deleted", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseWidget" } }, "400": { "description": "Bad request", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "404": { "description": "Not found", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "422": { "description": "Unprocessable entity", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } }, "500": { "description": "Internal server error", "schema": { - "type": "object", "$ref": "#/definitions/docs.ResponseError" } } @@ -3141,6 +2925,9 @@ "Grid": { "type": "integer" }, + "Height": { + "type": "integer" + }, "Name": { "type": "string" }, @@ -3155,6 +2942,9 @@ "grid": { "type": "integer" }, + "height": { + "type": "integer" + }, "name": { "type": "string" } @@ -3203,6 +2993,10 @@ "description": "Grid of dashboard", "type": "integer" }, + "height": { + "description": "Height of dashboard", + "type": "integer" + }, "id": { "type": "integer" }, diff --git a/doc/api/swagger.yaml b/doc/api/swagger.yaml index 188eaf6..a715673 100644 --- a/doc/api/swagger.yaml +++ b/doc/api/swagger.yaml @@ -57,6 +57,8 @@ definitions: properties: Grid: type: integer + Height: + type: integer Name: type: string ScenarioID: @@ -70,6 +72,8 @@ definitions: properties: grid: type: integer + height: + type: integer name: type: string type: object @@ -104,6 +108,9 @@ definitions: grid: description: Grid of dashboard type: integer + height: + description: Height of dashboard + type: integer id: type: integer name: @@ -642,7 +649,6 @@ definitions: Z: type: integer type: object -host: '{{.Host}}' info: contact: email: sonja.happ@eonerc.rwth-aachen.de @@ -678,17 +684,14 @@ paths: object schema: $ref: '#/definitions/docs.ResponseAuthenticate' - type: object "401": description: Unauthorized schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error. schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Authentication for user tags: - authentication @@ -713,22 +716,18 @@ paths: description: Component configurations which belong to scenario schema: $ref: '#/definitions/docs.ResponseConfigs' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get all component configurations of scenario tags: - component-configurations @@ -757,27 +756,22 @@ paths: description: Component configuration that was added schema: $ref: '#/definitions/docs.ResponseConfig' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Add a component configuration to a scenario tags: - component-configurations @@ -802,27 +796,22 @@ paths: description: component configuration that was deleted schema: $ref: '#/definitions/docs.ResponseConfig' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Delete a component configuration tags: - component-configurations @@ -846,27 +835,22 @@ paths: description: component configuration that was requested schema: $ref: '#/definitions/docs.ResponseConfig' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get a component configuration tags: - component-configurations @@ -899,27 +883,22 @@ paths: description: Component configuration that was added schema: $ref: '#/definitions/docs.ResponseConfig' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Update a component configuration tags: - component-configurations @@ -944,22 +923,18 @@ paths: description: Dashboards which belong to scenario schema: $ref: '#/definitions/docs.ResponseDashboards' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get all dashboards of scenario tags: - dashboards @@ -987,27 +962,22 @@ paths: description: Dashboard that was added schema: $ref: '#/definitions/docs.ResponseDashboard' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Add a dashboard to a scenario tags: - dashboards @@ -1032,27 +1002,22 @@ paths: description: Dashboard that was deleted schema: $ref: '#/definitions/docs.ResponseDashboard' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Delete a dashboard tags: - dashboards @@ -1076,27 +1041,22 @@ paths: description: Dashboard that was requested schema: $ref: '#/definitions/docs.ResponseDashboard' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get a dashboard tags: - dashboards @@ -1129,27 +1089,22 @@ paths: description: Dashboard that was updated schema: $ref: '#/definitions/docs.ResponseDashboard' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Update a dashboard tags: - dashboards @@ -1174,22 +1129,18 @@ paths: description: Files which belong to scenario schema: $ref: '#/definitions/docs.ResponseFiles' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get all files of a specific scenario tags: - files @@ -1225,27 +1176,22 @@ paths: description: File that was added schema: $ref: '#/definitions/docs.ResponseFile' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Add a file to a specific scenario tags: - files @@ -1270,27 +1216,22 @@ paths: description: File that was deleted schema: $ref: '#/definitions/docs.ResponseFile' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Delete a file tags: - files @@ -1319,27 +1260,22 @@ paths: description: File that was requested schema: $ref: '#/definitions/docs.ResponseFile' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Download a file tags: - files @@ -1375,27 +1311,22 @@ paths: description: File that was updated schema: $ref: '#/definitions/docs.ResponseFile' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Update a file tags: - files @@ -1412,7 +1343,6 @@ paths: description: Backend is NOT healthy schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get health status of backend tags: - healthz @@ -1432,22 +1362,18 @@ paths: description: ICs requested schema: $ref: '#/definitions/docs.ResponseICs' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get all infrastructure components tags: - infrastructure-components @@ -1475,27 +1401,22 @@ paths: description: Infrastructure Component that was added schema: $ref: '#/definitions/docs.ResponseIC' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Add an infrastructure component tags: - infrastructure-components @@ -1520,27 +1441,22 @@ paths: description: Infrastructure Component that was deleted schema: $ref: '#/definitions/docs.ResponseIC' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Delete an infrastructure component tags: - infrastructure-components @@ -1564,27 +1480,22 @@ paths: description: Infrastructure Component that was requested schema: $ref: '#/definitions/docs.ResponseIC' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get infrastructure component tags: - infrastructure-components @@ -1617,27 +1528,22 @@ paths: description: Infrastructure Component that was updated schema: $ref: '#/definitions/docs.ResponseIC' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Update an infrastructure component tags: - infrastructure-components @@ -1662,27 +1568,22 @@ paths: description: Action sent successfully schema: $ref: '#/definitions/docs.ResponseError' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Send an action to IC (only available if backend server is started with -amqp parameter) tags: @@ -1708,27 +1609,22 @@ paths: description: Configs requested by user schema: $ref: '#/definitions/docs.ResponseConfigs' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get all configurations of the infrastructure component tags: - infrastructure-components @@ -1759,22 +1655,18 @@ paths: description: Scenarios to which user has access schema: $ref: '#/definitions/docs.ResponseScenarios' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get all scenarios of requesting user tags: - scenarios @@ -1802,27 +1694,22 @@ paths: description: scenario that was added schema: $ref: '#/definitions/docs.ResponseScenario' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Add a scenario tags: - scenarios @@ -1847,22 +1734,18 @@ paths: description: Deleted scenario schema: $ref: '#/definitions/docs.ResponseScenario' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Delete a scenario tags: - scenarios @@ -1886,22 +1769,18 @@ paths: description: Scenario requested by user schema: $ref: '#/definitions/docs.ResponseScenario' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get scenario tags: - scenarios @@ -1934,27 +1813,22 @@ paths: description: Updated scenario. schema: $ref: '#/definitions/docs.ResponseScenario' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Update a scenario tags: - scenarios @@ -1984,22 +1858,18 @@ paths: description: User that was deleted from scenario schema: $ref: '#/definitions/docs.ResponseUser' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Delete a user from a scenario tags: - scenarios @@ -2028,22 +1898,18 @@ paths: description: User that was added to scenario schema: $ref: '#/definitions/docs.ResponseUser' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Add a user to a a scenario tags: - scenarios @@ -2068,22 +1934,18 @@ paths: description: Array of users that have access to the scenario schema: $ref: '#/definitions/docs.ResponseUsers' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get users of a scenario tags: - scenarios @@ -2113,22 +1975,18 @@ paths: description: Signals which belong to component configuration schema: $ref: '#/definitions/docs.ResponseSignals' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get all signals of one direction tags: - signals @@ -2157,27 +2015,22 @@ paths: description: Signal that was added schema: $ref: '#/definitions/docs.ResponseSignal' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Add a signal to a signal mapping of a component configuration tags: - signals @@ -2202,27 +2055,22 @@ paths: description: Signal that was deleted schema: $ref: '#/definitions/docs.ResponseSignal' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Delete a signal tags: - signals @@ -2246,27 +2094,22 @@ paths: description: Signal that was requested schema: $ref: '#/definitions/docs.ResponseSignal' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get a signal tags: - signals @@ -2297,27 +2140,22 @@ paths: description: Signal that was updated schema: $ref: '#/definitions/docs.ResponseSignal' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Update a signal tags: - signals @@ -2337,22 +2175,18 @@ paths: description: Array of users schema: $ref: '#/definitions/docs.ResponseUsers' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get all users tags: - users @@ -2380,22 +2214,18 @@ paths: description: Contains added user object schema: $ref: '#/definitions/docs.ResponseUser' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Add a user tags: - users @@ -2420,22 +2250,18 @@ paths: description: deleted user schema: $ref: '#/definitions/docs.ResponseUser' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Delete a user tags: - users @@ -2459,27 +2285,22 @@ paths: description: requested user schema: $ref: '#/definitions/docs.ResponseUser' - type: object "403": description: Access forbidden. schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get user tags: - users @@ -2513,32 +2334,26 @@ paths: description: Contains updated user schema: $ref: '#/definitions/docs.ResponseUser' - type: object "400": description: Bad request. schema: $ref: '#/definitions/docs.ResponseError' - type: object "403": description: Access forbidden. schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Update a user tags: - users @@ -2563,22 +2378,18 @@ paths: description: Widgets to which belong to dashboard schema: $ref: '#/definitions/docs.ResponseWidgets' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get all widgets of dashboard tags: - widgets @@ -2606,27 +2417,22 @@ paths: description: Widget that was added schema: $ref: '#/definitions/docs.ResponseWidget' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Add a widget to a dashboard tags: - widgets @@ -2651,27 +2457,22 @@ paths: description: Widget that was deleted schema: $ref: '#/definitions/docs.ResponseWidget' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Delete a widget tags: - widgets @@ -2695,27 +2496,22 @@ paths: description: Widget that was requested schema: $ref: '#/definitions/docs.ResponseWidget' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Get a widget tags: - widgets @@ -2748,27 +2544,22 @@ paths: description: Widget that was updated schema: $ref: '#/definitions/docs.ResponseWidget' - type: object "400": description: Bad request schema: $ref: '#/definitions/docs.ResponseError' - type: object "404": description: Not found schema: $ref: '#/definitions/docs.ResponseError' - type: object "422": description: Unprocessable entity schema: $ref: '#/definitions/docs.ResponseError' - type: object "500": description: Internal server error schema: $ref: '#/definitions/docs.ResponseError' - type: object summary: Update a widget tags: - widgets diff --git a/routes/dashboard/dashboard_methods.go b/routes/dashboard/dashboard_methods.go index 8c0b7fc..561ab92 100644 --- a/routes/dashboard/dashboard_methods.go +++ b/routes/dashboard/dashboard_methods.go @@ -70,8 +70,9 @@ func (d *Dashboard) update(modifiedDab Dashboard) error { db := database.GetDB() err := db.Model(d).Updates(map[string]interface{}{ - "Name": modifiedDab.Name, - "Grid": modifiedDab.Grid, + "Name": modifiedDab.Name, + "Grid": modifiedDab.Grid, + "Height": modifiedDab.Height, }).Error return err diff --git a/routes/dashboard/dashboard_test.go b/routes/dashboard/dashboard_test.go index 83ce190..e472ec4 100644 --- a/routes/dashboard/dashboard_test.go +++ b/routes/dashboard/dashboard_test.go @@ -41,6 +41,7 @@ var router *gin.Engine type DashboardRequest struct { Name string `json:"name,omitempty"` Grid int `json:"grid,omitempty"` + Height int `json:"height,omitempty"` ScenarioID uint `json:"scenarioID,omitempty"` } diff --git a/routes/dashboard/dashboard_validators.go b/routes/dashboard/dashboard_validators.go index 1376d59..bdc0cf9 100644 --- a/routes/dashboard/dashboard_validators.go +++ b/routes/dashboard/dashboard_validators.go @@ -30,12 +30,14 @@ var validate *validator.Validate type validNewDashboard struct { Name string `form:"Name" validate:"required"` Grid int `form:"Grid" validate:"required"` + Height int `form:"Height" validate:"omitempty"` ScenarioID uint `form:"ScenarioID" validate:"required"` } type validUpdatedDashboard struct { - Name string `form:"Name" validate:"omitempty" json:"name"` - Grid int `form:"Grid" validate:"omitempty" json:"grid"` + Name string `form:"Name" validate:"omitempty" json:"name"` + Height int `form:"Height" validate:"omitempty" json:"height"` + Grid int `form:"Grid" validate:"omitempty" json:"grid"` } type addDashboardRequest struct { @@ -63,6 +65,7 @@ func (r *addDashboardRequest) createDashboard() Dashboard { s.Name = r.Dashboard.Name s.Grid = r.Dashboard.Grid + s.Height = r.Dashboard.Height s.ScenarioID = r.Dashboard.ScenarioID return s @@ -80,5 +83,9 @@ func (r *updateDashboardRequest) updatedDashboard(oldDashboard Dashboard) Dashbo s.Grid = r.Dashboard.Grid } + if r.Dashboard.Height > 0 { + s.Height = r.Dashboard.Height + } + return s }