Skip to content

Commit 18a534b

Browse files
Merge pull request #78 from delphi-hub/feature/documentationForCommandRoute
Added swagger documentation for command route
2 parents e0c9787 + 4afe440 commit 18a534b

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

OpenAPISpecification.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,36 @@ paths:
661661
description: One of the ids was not found on the server
662662
'500':
663663
description: Internal server error
664+
/command:
665+
post:
666+
tags:
667+
- Docker Operations
668+
summary: Runs a command into a docker container
669+
description: >-
670+
This command runs a specified command inside a docker container.
671+
operationId: command
672+
parameters:
673+
- in: query
674+
name: Id
675+
description: The ID of the instance that is a docker container
676+
required: true
677+
type: integer
678+
format: int64
679+
- in: query
680+
name: Command
681+
description: The Command thet will run inside a container
682+
required: true
683+
type: string
684+
responses:
685+
'200':
686+
description: 'OK'
687+
'400':
688+
description: >-
689+
Cannot run command, ID is no docker container.
690+
'404':
691+
description: Cannot run command, ID not found.
692+
'500':
693+
description: Internal server error, unknown operation result DESCRIPTION
664694
definitions:
665695
InstanceNetwork:
666696
type: object

src/main/scala/de/upb/cs/swt/delphi/instanceregistry/connection/Server.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ class Server (handler: RequestHandler) extends HttpApp
649649

650650
/**
651651
* Called to run a command in a docker container. The Id an Command is the required parameter there are other optional parameter can be passed
652-
* a query with required parameter Command and Id (so the resulting call is /delete?Id=42&Command=ls).
652+
* a query with required parameter Command and Id (so the resulting call is /command?Id=42&Command=ls).
653653
* @return Server route that either maps to 200 Ok or the respective error codes.
654654
*/
655655
def runCommandInContainer() : server.Route = parameters('Id.as[Long], 'Command.as[String],

0 commit comments

Comments
 (0)