Skip to content

Commit

Permalink
Merge pull request #11 from esl/openapi_server
Browse files Browse the repository at this point in the history
 Upgrade amoc_rest with new openapi gens and enforce OTP27
  • Loading branch information
JanuszJakubiec authored Nov 26, 2024
2 parents 1e41be5 + bc7b1c3 commit a1ea2bf
Show file tree
Hide file tree
Showing 18 changed files with 1,104 additions and 1,379 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
name: OTP ${{matrix.otp_vsn}}
strategy:
matrix:
otp_vsn: ['27', '26', '25']
rebar_vsn: ['3.23.0']
otp_vsn: ['27']
rebar_vsn: ['3.24.0']
runs-on: 'ubuntu-24.04'
env:
OTPVER: ${{ matrix.otp_vsn }}
Expand Down
1 change: 1 addition & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ OutputDir ?= tmp

define openapi-generator
docker run --rm -v "${PWD}:/local" -w "/local" \
openapitools/openapi-generator-cli:v4.3.1
openapitools/openapi-generator-cli:v7.9.0
endef

all: compile
Expand Down
45 changes: 32 additions & 13 deletions openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
openapi: 3.0.1
info:
title: API-DOCS
version: 1.0.0
title: AMOC API
version: 1.0.1
description: |
AMOC REST API
servers:
- url: /
paths:
/nodes:
get:
operationId: getClusteredNodes
tags:
- status
description: List all AMOC nodes in a cluster.
summary: List all AMOC nodes in a cluster.
responses:
'200':
description: response object
Expand All @@ -19,9 +22,10 @@ paths:
$ref: '#/components/schemas/NodesKV'
/scenarios:
get:
operationId: getAvailableScenarios
tags:
- scenarios
description: List all available scenarios
summary: List all available scenarios
responses:
'200':
description: response object
Expand All @@ -31,9 +35,10 @@ paths:
$ref: '#/components/schemas/ScenarioList'
'/scenarios/info/{id}':
get:
operationId: getScenarioDescription
tags:
- scenarios
description: Get scenario description
summary: Get scenario description
parameters:
- name: id
in: path
Expand All @@ -52,9 +57,10 @@ paths:
description: no scenario with such a name
'/scenarios/defaults/{id}':
get:
operationId: getScenarioSettings
tags:
- scenarios
description: Get scenario default settings
summary: Get scenario default settings
parameters:
- name: id
in: path
Expand All @@ -73,9 +79,10 @@ paths:
description: no scenario with such a name
/status:
get:
operationId: getAmocAppStatus
tags:
- status
description: Get AMOC app status
summary: Get AMOC app status
responses:
'200':
description: response object
Expand All @@ -85,9 +92,10 @@ paths:
$ref: '#/components/schemas/AmocStatus'
'/status/{node}':
get:
operationId: getAmocAppStatusOnNode
tags:
- status
description: Get AMOC app status on a remote node
summary: Get AMOC app status on a remote node
parameters:
- name: node
in: path
Expand All @@ -106,8 +114,10 @@ paths:
description: no node with such a name
/scenarios/upload:
put:
operationId: uploadNewScenario
tags:
- scenarios
summary: Upload a new scenario.
description: >-
Uploads new scenario, you can run the next command to upload a file
using curl utility
Expand Down Expand Up @@ -139,9 +149,10 @@ paths:
$ref: '#/components/schemas/Error'
/execution/start:
patch:
operationId: startScenario
tags:
- execution
description: Start scenario
summary: Start scenario
requestBody:
description: request body (as json)
content:
Expand All @@ -164,9 +175,14 @@ paths:
$ref: '#/components/schemas/Error'
/execution/stop:
patch:
operationId: stopScenario
tags:
- execution
description: Stop scenario
summary: Stop scenario
requestBody:
description: request body (as json)
content:
application/json: {}
responses:
'200':
description: execution stopped successfully
Expand All @@ -180,9 +196,10 @@ paths:
$ref: '#/components/schemas/Error'
/execution/add_users:
patch:
operationId: addUsers
tags:
- execution
description: add new users
summary: add new users
requestBody:
description: request body (as json)
content:
Expand All @@ -203,9 +220,10 @@ paths:
$ref: '#/components/schemas/Error'
/execution/remove_users:
patch:
operationId: removeUsers
tags:
- execution
description: stop users
summary: stop users
requestBody:
description: request body (as json)
content:
Expand All @@ -226,9 +244,10 @@ paths:
$ref: '#/components/schemas/Error'
/execution/update_settings:
patch:
operationId: updateSettings
tags:
- execution
description: update scenario settings
summary: update scenario settings
requestBody:
description: request body (as json)
content:
Expand Down
Loading

0 comments on commit a1ea2bf

Please sign in to comment.