OpenAPI Add token and version prefix.

This commit is contained in:
Maximilian Paß
2022-10-06 14:44:03 +01:00
committed by Sebastian Serth
parent ff267dbde0
commit a1d30f00c6

View File

@ -5,6 +5,9 @@ info:
This API is used by CodeOcean to run code in runners. This API is used by CodeOcean to run code in runners.
version: '0.2.2' version: '0.2.2'
servers:
- url: '/api/v1'
components: components:
schemas: schemas:
ExecutionEnvironment: ExecutionEnvironment:
@ -89,6 +92,13 @@ components:
- message - message
additionalProperties: false additionalProperties: false
securitySchemes:
poseidonAuthToken:
type: apiKey
in: header
name: Poseidon-Token
description: A security token that might be required depending on the Poseidon configuration.
responses: responses:
BadRequest: BadRequest:
description: Request is invalid. E.g. request body does not follow the json schema required by the given route or url parameters are invalid. description: Request is invalid. E.g. request body does not follow the json schema required by the given route or url parameters are invalid.
@ -173,6 +183,8 @@ paths:
description: Return Return the current availability and usage of runners. description: Return Return the current availability and usage of runners.
tags: tags:
- miscellaneous - miscellaneous
security:
- poseidonAuthToken: [ ]
responses: responses:
"200": "200":
description: Success. Returns all execution environments description: Success. Returns all execution environments
@ -218,6 +230,8 @@ paths:
description: Provide a runner with the requested execution environment to the client (CodeOcean). description: Provide a runner with the requested execution environment to the client (CodeOcean).
tags: tags:
- runner - runner
security:
- poseidonAuthToken: [ ]
requestBody: requestBody:
description: Runner attributes description: Runner attributes
required: true required: true
@ -282,6 +296,8 @@ paths:
description: The runner is no longer in use and should be destroyed. description: The runner is no longer in use and should be destroyed.
tags: tags:
- runner - runner
security:
- poseidonAuthToken: [ ]
parameters: parameters:
- name: runnerId - name: runnerId
in: path in: path
@ -314,6 +330,8 @@ paths:
description: List all files available in the runner. description: List all files available in the runner.
tags: tags:
- runner - runner
security:
- poseidonAuthToken: [ ]
parameters: parameters:
- name: recursive - name: recursive
in: query in: query
@ -362,6 +380,8 @@ paths:
description: Delete the files with the given paths from the file system of the specified runner. Afterwards, copy the enclosed files to the runner. Existing files get overwritten and results of previous file copy operations on the same runner are present when executing multiple requests. description: Delete the files with the given paths from the file system of the specified runner. Afterwards, copy the enclosed files to the runner. Existing files get overwritten and results of previous file copy operations on the same runner are present when executing multiple requests.
tags: tags:
- runner - runner
security:
- poseidonAuthToken: [ ]
requestBody: requestBody:
description: Files to copy or delete description: Files to copy or delete
required: true required: true
@ -413,6 +433,8 @@ paths:
description: Download the specified file from the selected runner. description: Download the specified file from the selected runner.
tags: tags:
- runner - runner
security:
- poseidonAuthToken: [ ]
parameters: parameters:
- name: runnerId - name: runnerId
description: Runner on which the command should be executed description: Runner on which the command should be executed
@ -456,6 +478,8 @@ paths:
description: Execute a command in the runner. Whether this starts the actual execution or only prepares a Websocket URL to start it depends on the implementation. description: Execute a command in the runner. Whether this starts the actual execution or only prepares a Websocket URL to start it depends on the implementation.
tags: tags:
- runner - runner
security:
- poseidonAuthToken: [ ]
parameters: parameters:
- name: runnerId - name: runnerId
description: Runner on which the command should be executed description: Runner on which the command should be executed
@ -524,6 +548,8 @@ paths:
description: The url including all parameters will be generated and returned by the `execute` route. This is a WebSocket endpoint. The schema for the WS communication is described in `websocket.schema.json`. description: The url including all parameters will be generated and returned by the `execute` route. This is a WebSocket endpoint. The schema for the WS communication is described in `websocket.schema.json`.
tags: tags:
- runner - runner
security:
- poseidonAuthToken: [ ]
parameters: parameters:
- name: runnerId - name: runnerId
description: Runner on which the execution is created. description: Runner on which the execution is created.
@ -557,6 +583,8 @@ paths:
description: List all execution environments the API is aware of. description: List all execution environments the API is aware of.
tags: tags:
- execution environment - execution environment
security:
- poseidonAuthToken: [ ]
parameters: parameters:
- name: fetch - name: fetch
in: query in: query
@ -594,6 +622,8 @@ paths:
description: Get a representation of the execution environment specified by the id. description: Get a representation of the execution environment specified by the id.
tags: tags:
- execution environment - execution environment
security:
- poseidonAuthToken: [ ]
parameters: parameters:
- name: fetch - name: fetch
in: query in: query
@ -620,6 +650,8 @@ paths:
description: This is used for keeping execution environments in sync between the client and the provider of this API. By sending a request with an id, the execution environment is created if it does not exist and updated otherwise. description: This is used for keeping execution environments in sync between the client and the provider of this API. By sending a request with an id, the execution environment is created if it does not exist and updated otherwise.
tags: tags:
- execution environment - execution environment
security:
- poseidonAuthToken: [ ]
requestBody: requestBody:
description: The new execution environment description: The new execution environment
required: true required: true
@ -641,6 +673,8 @@ paths:
description: Remove the specified execution environment from the API. description: Remove the specified execution environment from the API.
tags: tags:
- execution environment - execution environment
security:
- poseidonAuthToken: [ ]
responses: responses:
"204": "204":
description: The execution environment was deleted. description: The execution environment was deleted.