@@ -58,16 +58,18 @@ class Server(handler: RequestHandler) extends HttpApp
58
58
network()
59
59
} ~
60
60
path(" deploy" ) {
61
- entity(as[JsValue ]) { json => deployContainer(json.asJsObject)}
61
+ entity(as[JsValue ]) { json => deployContainer(json.asJsObject) }
62
62
} ~
63
63
path(" count" ) {
64
64
numberOfInstances()
65
65
} ~
66
- path(LongNumber ) { Id => retrieveInstance(Id ) } ~
67
66
pathPrefix(LongNumber ) { Id =>
68
- path( " deregister " ) {
69
- deregister (Id )
67
+ pathEnd {
68
+ retrieveInstance (Id )
70
69
} ~
70
+ path(" deregister" ) {
71
+ deregister(Id )
72
+ } ~
71
73
path(" matchingInstance" ) {
72
74
matchingInstance(Id )
73
75
} ~
@@ -128,9 +130,9 @@ class Server(handler: RequestHandler) extends HttpApp
128
130
}
129
131
}
130
132
} ~
131
- path(" events" ) {
132
- streamEvents()
133
- }
133
+ path(" events" ) {
134
+ streamEvents()
135
+ }
134
136
135
137
136
138
/**
@@ -382,7 +384,9 @@ class Server(handler: RequestHandler) extends HttpApp
382
384
383
385
case Failure (ex) =>
384
386
log.warning(s " Failed to unmarshal parameters with message ${ex.getMessage}. Data: $json" )
385
- complete{HttpResponse (StatusCodes .BadRequest , entity = " Wrong data format supplied." )}
387
+ complete {
388
+ HttpResponse (StatusCodes .BadRequest , entity = " Wrong data format supplied." )
389
+ }
386
390
}
387
391
388
392
}
@@ -454,7 +458,9 @@ class Server(handler: RequestHandler) extends HttpApp
454
458
}
455
459
case Failure (ex) =>
456
460
log.warning(s " Failed to unmarshal parameters with message ${ex.getMessage}. Data: $json" )
457
- complete{HttpResponse (StatusCodes .BadRequest , entity = " Wrong data format supplied." )}
461
+ complete {
462
+ HttpResponse (StatusCodes .BadRequest , entity = " Wrong data format supplied." )
463
+ }
458
464
}
459
465
}
460
466
}
@@ -808,7 +814,9 @@ class Server(handler: RequestHandler) extends HttpApp
808
814
}
809
815
case Failure (ex) =>
810
816
log.warning(s " Failed to unmarshal parameters with message ${ex.getMessage}. Data: $json" )
811
- complete{HttpResponse (StatusCodes .BadRequest , entity = " Wrong data format supplied." )}
817
+ complete {
818
+ HttpResponse (StatusCodes .BadRequest , entity = " Wrong data format supplied." )
819
+ }
812
820
}
813
821
}
814
822
}
@@ -916,7 +924,9 @@ class Server(handler: RequestHandler) extends HttpApp
916
924
}
917
925
case Failure (ex) =>
918
926
log.warning(s " Failed to unmarshal parameters with message ${ex.getMessage}. Data: $json" )
919
- complete{HttpResponse (StatusCodes .BadRequest , entity = " Wrong data format supplied." )}
927
+ complete {
928
+ HttpResponse (StatusCodes .BadRequest , entity = " Wrong data format supplied." )
929
+ }
920
930
}
921
931
}
922
932
}
@@ -928,7 +938,7 @@ class Server(handler: RequestHandler) extends HttpApp
928
938
*
929
939
* @return Server route that either maps to 200 Ok or the respective error codes.
930
940
*/
931
- def runCommandInContainer (id: Long , json : JsObject ): server.Route = {
941
+ def runCommandInContainer (id : Long , json : JsObject ): server.Route = {
932
942
authenticateOAuth2[AccessToken ](" Secure Site" , AuthProvider .authenticateOAuthRequire(_, userType = UserType .Admin )) { token =>
933
943
post {
934
944
log.debug(s " POST /command has been called " )
@@ -967,7 +977,9 @@ class Server(handler: RequestHandler) extends HttpApp
967
977
}
968
978
case Failure (ex) =>
969
979
log.warning(s " Failed to unmarshal parameters with message ${ex.getMessage}. Data: $json" )
970
- complete{HttpResponse (StatusCodes .BadRequest , entity = " Wrong data format supplied." )}
980
+ complete {
981
+ HttpResponse (StatusCodes .BadRequest , entity = " Wrong data format supplied." )
982
+ }
971
983
}
972
984
}
973
985
}
0 commit comments