Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
handleDeregister(id)
OperationResult.Ok
}
} else {
} else if(instanceDao.getInstance(id).get.instanceState != InstanceState.Paused){
log.info(s"Handling /stop for instance with id $id...")

val instance = instanceDao.getInstance(id).get
Expand All @@ -531,6 +531,9 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
}

OperationResult.Ok
} else {
log.warning(s"Cannot stop paused docker container for instance with id $id")
OperationResult.InvalidStateForOperation
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ class Server (handler: RequestHandler) extends HttpApp
case handler.OperationResult.InvalidTypeForOperation =>
log.warning(s"Cannot stop id $id, this component type cannot be stopped.")
complete{HttpResponse(StatusCodes.BadRequest, entity = s"Cannot stop instance of this type.")}
case handler.OperationResult.InvalidStateForOperation =>
log.warning(s"Cannot stop id $id, the associated container is paused.")
complete{HttpResponse(StatusCodes.BadRequest, entity = s"Cannot stop instance while it is paused.")}
case handler.OperationResult.Ok =>
complete{HttpResponse(StatusCodes.Accepted, entity = "Operation accepted.")}
case r =>
Expand Down