@@ -65,7 +65,6 @@ class InstanceRegistryController @Inject()(implicit system: ActorSystem, mat: Ma
65
65
// val token = request.headers.get(HeaderNames.AUTHORIZATION)
66
66
67
67
68
-
69
68
/** This method maps list of instances with specific componentType.
70
69
*
71
70
* @param componentType
@@ -149,7 +148,8 @@ class InstanceRegistryController @Inject()(implicit system: ActorSystem, mat: Ma
149
148
}
150
149
151
150
/**
152
- * This method is called to assign a new instance to the instance with specified ID.
151
+ * This method is called to assign a new instance to the instance with specified ID.
152
+ *
153
153
* @param from
154
154
* @param to
155
155
* @return
@@ -226,36 +226,38 @@ class InstanceRegistryController @Inject()(implicit system: ActorSystem, mat: Ma
226
226
new Status (response.status)
227
227
}
228
228
}
229
- }.getOrElse{ Future (BadRequest (" Invalid body" ))}
229
+ }.getOrElse {
230
+ Future (BadRequest (" Invalid body" ))
231
+ }
230
232
231
- }
233
+ }
232
234
233
235
/**
234
236
* This function is used to add a label to specific instance.
237
+ *
235
238
* @param instanceID ID of the instance on which label is to be added
236
239
* @param label
237
240
* @return
238
241
*/
239
242
240
- def labelInstance (instanceID : String , label : String ): Action [AnyContent ] = authAction.async
241
- {
243
+ def labelInstance (instanceID : String , label : String ): Action [AnyContent ] = authAction.async {
242
244
request =>
243
- ws.url(instanceRegistryUri + " /instances/" + instanceID + " /label" )
244
- .withHttpHeaders((" Authorization" , s " Bearer ${AuthProvider .generateJwt()}" ))
245
- .post(Json .obj(" Label" -> label))
246
- .map { response =>
247
- response.status match {
248
- // scalastyle:off magic.number
249
- case 202 =>
250
- // scalastyle:on magic.number
251
- Ok (response.body)
252
- case x : Any =>
253
- new Status (x)
254
- }
255
- }(myExecutionContext)
245
+ ws.url(instanceRegistryUri + " /instances/" + instanceID + " /label" )
246
+ .withHttpHeaders((" Authorization" , s " Bearer ${AuthProvider .generateJwt()}" ))
247
+ .post(Json .obj(" Label" -> label))
248
+ .map { response =>
249
+ response.status match {
250
+ // scalastyle:off magic.number
251
+ case 202 =>
252
+ // scalastyle:on magic.number
253
+ Ok (response.body)
254
+ case x : Any =>
255
+ new Status (x)
256
+ }
257
+ }(myExecutionContext)
256
258
}
257
259
258
- def refreshToken (token : String ): Action [AnyContent ] = authAction.async
260
+ def refreshToken (): Action [AnyContent ] = authAction.async
259
261
{
260
262
request =>
261
263
ws.url(instanceRegistryUri + " /users" + " /refreshToken" )
@@ -270,4 +272,4 @@ class InstanceRegistryController @Inject()(implicit system: ActorSystem, mat: Ma
270
272
}
271
273
}(myExecutionContext)
272
274
}
273
- }
275
+ }
0 commit comments