summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-api/static
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-07-07 20:45:06 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-07-08 10:53:25 +0200
commit5ec19973eb3d23046d874b097275857a58c23082 (patch)
treea601cd975f8917fb2d4af28e8a3fb228e0cb769e /opendc-web/opendc-web-api/static
parent02a2f0f89cb1f39a5f8856bca1971a4e1b12374f (diff)
api: Add endpoints for accessing project relations
This change adds additional endpoints to the REST API to access the project relations, the portfolios and topologies that belong to a project.
Diffstat (limited to 'opendc-web/opendc-web-api/static')
-rw-r--r--opendc-web/opendc-web-api/static/schema.yml182
1 files changed, 181 insertions, 1 deletions
diff --git a/opendc-web/opendc-web-api/static/schema.yml b/opendc-web/opendc-web-api/static/schema.yml
index 6a07ae52..56cf58e7 100644
--- a/opendc-web/opendc-web-api/static/schema.yml
+++ b/opendc-web/opendc-web-api/static/schema.yml
@@ -222,6 +222,49 @@ paths:
schema:
$ref: "#/components/schemas/NotFound"
"/projects/{projectId}/topologies":
+ get:
+ tags:
+ - projects
+ description: Get Project Topologies.
+ parameters:
+ - name: projectId
+ in: path
+ description: Project's ID.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Successfully retrieved Project Topologies.
+ content:
+ "application/json":
+ schema:
+ type: object
+ required:
+ - data
+ properties:
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/Topology"
+ "401":
+ description: Unauthorized.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/Unauthorized"
+ "403":
+ description: Forbidden from retrieving Project.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/Forbidden"
+ "404":
+ description: Project not found.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/NotFound"
post:
tags:
- projects
@@ -273,9 +316,52 @@ paths:
schema:
$ref: "#/components/schemas/NotFound"
"/projects/{projectId}/portfolios":
+ get:
+ tags:
+ - projects
+ description: Get Project Portfolios.
+ parameters:
+ - name: projectId
+ in: path
+ description: Project's ID.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Successfully retrieved Project Portfolios.
+ content:
+ "application/json":
+ schema:
+ type: object
+ required:
+ - data
+ properties:
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/Portfolio"
+ "401":
+ description: Unauthorized.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/Unauthorized"
+ "403":
+ description: Forbidden from retrieving Project.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/Forbidden"
+ "404":
+ description: Project not found.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/NotFound"
post:
tags:
- - portfolios
+ - projects
description: Add a Portfolio.
parameters:
- name: projectId
@@ -611,6 +697,100 @@ paths:
"application/json":
schema:
$ref: "#/components/schemas/NotFound"
+ "/portfolios/{portfolioId}/scenarios":
+ get:
+ tags:
+ - portfolios
+ description: Get Portfolio Scenarios.
+ parameters:
+ - name: portfolioId
+ in: path
+ description: Portfolio's ID.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: Successfully retrieved Portfolio Scenarios.
+ content:
+ "application/json":
+ schema:
+ type: object
+ required:
+ - data
+ properties:
+ data:
+ type: array
+ items:
+ $ref: "#/components/schemas/Scenario"
+ "401":
+ description: Unauthorized.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/Unauthorized"
+ "403":
+ description: Forbidden from retrieving Portfolio.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/Forbidden"
+ "404":
+ description: Portfolio not found.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/NotFound"
+ post:
+ tags:
+ - portfolios
+ description: Add a Scenario.
+ parameters:
+ - name: portfolioId
+ in: path
+ description: Portfolio's ID.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ properties:
+ topology:
+ $ref: "#/components/schemas/Scenario"
+ description: The new Scenario.
+ required: true
+ responses:
+ "200":
+ description: Successfully added Scenario.
+ content:
+ "application/json":
+ schema:
+ type: object
+ required:
+ - data
+ properties:
+ data:
+ $ref: "#/components/schemas/Scenario"
+ "400":
+ description: Missing or incorrectly typed parameter.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/Invalid"
+ "401":
+ description: Unauthorized.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/Unauthorized"
+ "404":
+ description: Portfolio not found.
+ content:
+ "application/json":
+ schema:
+ $ref: "#/components/schemas/NotFound"
"/scenarios/{scenarioId}":
get:
tags: