Skip to content

Commit a532dbd

Browse files
Demo frontend follow-ups (#1926)
* Demo frontend follow-ups ### What's done: * Added backend endpoints that check permissions and forward them to save-demo (for /start and /stop) * Finished frontend menu * Tested locally on !kubernetes profile * Slightly refactored DemoManagerController (#1925)
1 parent 9b96941 commit a532dbd

5 files changed

Lines changed: 338 additions & 126 deletions

File tree

save-backend/backend-api-docs.json

Lines changed: 144 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,6 +2107,74 @@
21072107
]
21082108
}
21092109
},
2110+
"/api/v1/demo/{organizationName}/{projectName}/start": {
2111+
"post": {
2112+
"description": "Start demo container if possible, do nothing otherwise.",
2113+
"operationId": "startDemo",
2114+
"parameters": [
2115+
{
2116+
"description": "name of saveourtool organization",
2117+
"in": "path",
2118+
"name": "organizationName",
2119+
"required": true,
2120+
"schema": {
2121+
"type": "string"
2122+
}
2123+
},
2124+
{
2125+
"description": "name of saveourtool project",
2126+
"in": "path",
2127+
"name": "projectName",
2128+
"required": true,
2129+
"schema": {
2130+
"type": "string"
2131+
}
2132+
},
2133+
{
2134+
"example": "basic",
2135+
"in": "header",
2136+
"name": "X-Authorization-Source",
2137+
"required": true
2138+
}
2139+
],
2140+
"responses": {
2141+
"200": {
2142+
"content": {
2143+
"*/*": {
2144+
"schema": {
2145+
"type": "string"
2146+
}
2147+
}
2148+
},
2149+
"description": "Successfully started demo."
2150+
},
2151+
"403": {
2152+
"content": {
2153+
"*/*": {
2154+
"schema": {
2155+
"type": "string"
2156+
}
2157+
}
2158+
},
2159+
"description": "Not enough permission for demo management."
2160+
},
2161+
"404": {
2162+
"content": {
2163+
"*/*": {
2164+
"schema": {
2165+
"type": "string"
2166+
}
2167+
}
2168+
},
2169+
"description": "Could not find saveourtool project or demo of a project."
2170+
}
2171+
},
2172+
"summary": "Start demo container.",
2173+
"tags": [
2174+
"demo-manager-controller"
2175+
]
2176+
}
2177+
},
21102178
"/api/v1/demo/{organizationName}/{projectName}/status": {
21112179
"get": {
21122180
"description": "Get demo status.",
@@ -2148,7 +2216,8 @@
21482216
"NOT_CREATED",
21492217
"RUNNING",
21502218
"STARTING",
2151-
"STOPPED"
2219+
"STOPPED",
2220+
"STOPPING"
21522221
]
21532222
}
21542223
}
@@ -2165,7 +2234,8 @@
21652234
"NOT_CREATED",
21662235
"RUNNING",
21672236
"STARTING",
2168-
"STOPPED"
2237+
"STOPPED",
2238+
"STOPPING"
21692239
]
21702240
}
21712241
}
@@ -2182,7 +2252,8 @@
21822252
"NOT_CREATED",
21832253
"RUNNING",
21842254
"STARTING",
2185-
"STOPPED"
2255+
"STOPPED",
2256+
"STOPPING"
21862257
]
21872258
}
21882259
}
@@ -2196,6 +2267,74 @@
21962267
]
21972268
}
21982269
},
2270+
"/api/v1/demo/{organizationName}/{projectName}/stop": {
2271+
"post": {
2272+
"description": "Delete demo container if possible, do nothing otherwise.",
2273+
"operationId": "stopDemo",
2274+
"parameters": [
2275+
{
2276+
"description": "name of saveourtool organization",
2277+
"in": "path",
2278+
"name": "organizationName",
2279+
"required": true,
2280+
"schema": {
2281+
"type": "string"
2282+
}
2283+
},
2284+
{
2285+
"description": "name of saveourtool project",
2286+
"in": "path",
2287+
"name": "projectName",
2288+
"required": true,
2289+
"schema": {
2290+
"type": "string"
2291+
}
2292+
},
2293+
{
2294+
"example": "basic",
2295+
"in": "header",
2296+
"name": "X-Authorization-Source",
2297+
"required": true
2298+
}
2299+
],
2300+
"responses": {
2301+
"200": {
2302+
"content": {
2303+
"*/*": {
2304+
"schema": {
2305+
"type": "string"
2306+
}
2307+
}
2308+
},
2309+
"description": "Successfully stopped demo."
2310+
},
2311+
"403": {
2312+
"content": {
2313+
"*/*": {
2314+
"schema": {
2315+
"type": "string"
2316+
}
2317+
}
2318+
},
2319+
"description": "Not enough permission for demo management."
2320+
},
2321+
"404": {
2322+
"content": {
2323+
"*/*": {
2324+
"schema": {
2325+
"type": "string"
2326+
}
2327+
}
2328+
},
2329+
"description": "Could not find saveourtool project or demo of a project."
2330+
}
2331+
},
2332+
"summary": "Stop demo.",
2333+
"tags": [
2334+
"demo-manager-controller"
2335+
]
2336+
}
2337+
},
21992338
"/api/v1/demo/{organizationName}/{projectName}/upload-file": {
22002339
"post": {
22012340
"description": "Attach file to demo.",
@@ -8379,7 +8518,8 @@
83798518
"NOT_CREATED",
83808519
"RUNNING",
83818520
"STARTING",
8382-
"STOPPED"
8521+
"STOPPED",
8522+
"STOPPING"
83838523
]
83848524
}
83858525
}

0 commit comments

Comments
 (0)