91958f97a05fc14a5cb9e9fdc633210ef820cd70
[policy/clamp.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2021 Nordix Foundation.
4  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.clamp.controlloop.runtime.main.rest;
23
24 import io.swagger.annotations.ApiOperation;
25 import io.swagger.annotations.ApiParam;
26 import io.swagger.annotations.ApiResponse;
27 import io.swagger.annotations.ApiResponses;
28 import io.swagger.annotations.Authorization;
29 import io.swagger.annotations.Extension;
30 import io.swagger.annotations.ExtensionProperty;
31 import io.swagger.annotations.ResponseHeader;
32 import java.util.UUID;
33 import lombok.RequiredArgsConstructor;
34 import org.onap.policy.clamp.controlloop.common.exception.ControlLoopException;
35 import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoops;
36 import org.onap.policy.clamp.controlloop.models.messages.rest.instantiation.ControlLoopOrderStateResponse;
37 import org.onap.policy.clamp.controlloop.models.messages.rest.instantiation.InstancePropertiesResponse;
38 import org.onap.policy.clamp.controlloop.models.messages.rest.instantiation.InstantiationCommand;
39 import org.onap.policy.clamp.controlloop.models.messages.rest.instantiation.InstantiationResponse;
40 import org.onap.policy.clamp.controlloop.runtime.instantiation.ControlLoopInstantiationProvider;
41 import org.onap.policy.clamp.controlloop.runtime.main.web.AbstractRestController;
42 import org.onap.policy.models.base.PfModelException;
43 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
44 import org.springframework.http.MediaType;
45 import org.springframework.http.ResponseEntity;
46 import org.springframework.web.bind.annotation.DeleteMapping;
47 import org.springframework.web.bind.annotation.GetMapping;
48 import org.springframework.web.bind.annotation.PostMapping;
49 import org.springframework.web.bind.annotation.PutMapping;
50 import org.springframework.web.bind.annotation.RequestBody;
51 import org.springframework.web.bind.annotation.RequestHeader;
52 import org.springframework.web.bind.annotation.RequestParam;
53 import org.springframework.web.bind.annotation.RestController;
54
55 /**
56  * Class to provide REST end points for creating, deleting, query and commanding a control loop definition.
57  */
58 @RestController
59 @RequiredArgsConstructor
60 public class InstantiationController extends AbstractRestController {
61
62     private static final String TAGS = "Clamp Control Loop Instantiation API";
63
64     // The CL provider for instantiation requests
65     private final ControlLoopInstantiationProvider provider;
66
67     /**
68      * Creates a control loop.
69      *
70      * @param requestId request ID used in ONAP logging
71      * @param controlLoops the control loops
72      * @return a response
73      * @throws PfModelException on errors creating a control loop
74      */
75     // @formatter:off
76     @PostMapping(value = "/instantiation",
77             produces = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML},
78             consumes = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML})
79     @ApiOperation(
80             value = "Commissions control loop definitions",
81             notes = "Commissions control loop definitions, returning the control loop IDs",
82             response = InstantiationResponse.class,
83             tags = {TAGS},
84             authorizations = @Authorization(value = AUTHORIZATION_TYPE),
85             responseHeaders = {
86                 @ResponseHeader(
87                     name = VERSION_MINOR_NAME,
88                     description = VERSION_MINOR_DESCRIPTION,
89                     response = String.class),
90                 @ResponseHeader(
91                     name = VERSION_PATCH_NAME,
92                     description = VERSION_PATCH_DESCRIPTION,
93                     response = String.class),
94                 @ResponseHeader(
95                     name = VERSION_LATEST_NAME,
96                     description = VERSION_LATEST_DESCRIPTION,
97                     response = String.class),
98                 @ResponseHeader(
99                     name = REQUEST_ID_NAME,
100                     description = REQUEST_ID_HDR_DESCRIPTION,
101                     response = UUID.class)
102                 },
103             extensions = {
104                 @Extension
105                     (
106                         name = EXTENSION_NAME,
107                         properties = {
108                             @ExtensionProperty(name = API_VERSION_NAME, value = API_VERSION),
109                             @ExtensionProperty(name = LAST_MOD_NAME, value = LAST_MOD_RELEASE)
110                         }
111                     )
112             }
113         )
114     @ApiResponses(
115             value = {
116                 @ApiResponse(code = AUTHENTICATION_ERROR_CODE, message = AUTHENTICATION_ERROR_MESSAGE),
117                 @ApiResponse(code = AUTHORIZATION_ERROR_CODE, message = AUTHORIZATION_ERROR_MESSAGE),
118                 @ApiResponse(code = SERVER_ERROR_CODE, message = SERVER_ERROR_MESSAGE)
119             }
120         )
121     // @formatter:on
122     public ResponseEntity<InstantiationResponse> create(
123             @RequestHeader(
124                     name = REQUEST_ID_NAME,
125                     required = false) @ApiParam(REQUEST_ID_PARAM_DESCRIPTION) UUID requestId,
126             @ApiParam(value = "Entity Body of Control Loop", required = true) @RequestBody ControlLoops controlLoops)
127             throws PfModelException {
128
129         return ResponseEntity.ok().body(provider.createControlLoops(controlLoops));
130     }
131
132     /**
133      * Saves instance properties.
134      *
135      * @param requestId request ID used in ONAP logging
136      * @param body the body of control loop following TOSCA definition
137      * @return a response
138      */
139     // @formatter:off
140     @PostMapping(value = "/instanceProperties",
141         consumes = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML},
142         produces = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML})
143     @ApiOperation(
144         value = "Saves instance properties",
145         notes = "Saves instance properties, returning the saved instances properties and it's version",
146         response = InstancePropertiesResponse.class,
147         tags = {TAGS},
148         authorizations = @Authorization(value = AUTHORIZATION_TYPE),
149         responseHeaders = {
150             @ResponseHeader(
151                 name = VERSION_MINOR_NAME,
152                 description = VERSION_MINOR_DESCRIPTION,
153                 response = String.class),
154             @ResponseHeader(
155                 name = VERSION_PATCH_NAME,
156                 description = VERSION_PATCH_DESCRIPTION,
157                 response = String.class),
158             @ResponseHeader(
159                 name = VERSION_LATEST_NAME,
160                 description = VERSION_LATEST_DESCRIPTION,
161                 response = String.class),
162             @ResponseHeader(
163                 name = REQUEST_ID_NAME,
164                 description = REQUEST_ID_HDR_DESCRIPTION,
165                 response = UUID.class)
166         },
167         extensions = {
168             @Extension
169                 (
170                     name = EXTENSION_NAME,
171                     properties = {
172                         @ExtensionProperty(name = API_VERSION_NAME, value = API_VERSION),
173                         @ExtensionProperty(name = LAST_MOD_NAME, value = LAST_MOD_RELEASE)
174                     }
175                 )
176         }
177     )
178     @ApiResponses(
179         value = {
180             @ApiResponse(code = AUTHENTICATION_ERROR_CODE, message = AUTHENTICATION_ERROR_MESSAGE),
181             @ApiResponse(code = AUTHORIZATION_ERROR_CODE, message = AUTHORIZATION_ERROR_MESSAGE),
182             @ApiResponse(code = SERVER_ERROR_CODE, message = SERVER_ERROR_MESSAGE)
183         }
184     )
185     // @formatter:on
186     public ResponseEntity<InstancePropertiesResponse> createInstanceProperties(
187             @RequestHeader(
188                 name = REQUEST_ID_NAME,
189                 required = false) @ApiParam(REQUEST_ID_PARAM_DESCRIPTION) UUID requestId,
190             @ApiParam(value = "Body of instance properties", required = true) @RequestBody ToscaServiceTemplate body)
191         throws PfModelException {
192
193         return ResponseEntity.ok().body(provider.createInstanceProperties(body));
194     }
195
196     /**
197      * Deletes a control loop definition and instance properties.
198      *
199      * @param requestId request ID used in ONAP logging
200      * @param name the name of the control loop to delete
201      * @param version the version of the control loop to delete
202      * @return a response
203      * @throws PfModelException on errors deleting of control loop and instance properties
204      */
205     // @formatter:off
206     @DeleteMapping(value = "/instanceProperties",
207         produces = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML})
208     @ApiOperation(value = "Delete a control loop and instance properties",
209         notes = "Deletes a control loop and instance properties, returning optional error details",
210         response = InstantiationResponse.class,
211         tags = {TAGS},
212         authorizations = @Authorization(value = AUTHORIZATION_TYPE),
213         responseHeaders = {
214             @ResponseHeader(
215                 name = VERSION_MINOR_NAME,
216                 description = VERSION_MINOR_DESCRIPTION,
217                 response = String.class),
218             @ResponseHeader(
219                 name = VERSION_PATCH_NAME,
220                 description = VERSION_PATCH_DESCRIPTION,
221                 response = String.class),
222             @ResponseHeader(
223                 name = VERSION_LATEST_NAME,
224                 description = VERSION_LATEST_DESCRIPTION,
225                 response = String.class),
226             @ResponseHeader(
227                 name = REQUEST_ID_NAME,
228                 description = REQUEST_ID_HDR_DESCRIPTION,
229                 response = UUID.class)},
230         extensions = {
231             @Extension
232                 (
233                     name = EXTENSION_NAME,
234                     properties = {
235                         @ExtensionProperty(name = API_VERSION_NAME, value = API_VERSION),
236                         @ExtensionProperty(name = LAST_MOD_NAME, value = LAST_MOD_RELEASE)
237                     }
238                 )
239         }
240     )
241     @ApiResponses(
242         value = {
243             @ApiResponse(code = AUTHENTICATION_ERROR_CODE, message = AUTHENTICATION_ERROR_MESSAGE),
244             @ApiResponse(code = AUTHORIZATION_ERROR_CODE, message = AUTHORIZATION_ERROR_MESSAGE),
245             @ApiResponse(code = SERVER_ERROR_CODE, message = SERVER_ERROR_MESSAGE)
246         }
247     )
248     // @formatter:on
249
250     public ResponseEntity<InstantiationResponse> deleteInstanceProperties(
251         @RequestHeader(
252             name = REQUEST_ID_NAME,
253             required = false) @ApiParam(REQUEST_ID_PARAM_DESCRIPTION) UUID requestId,
254         @ApiParam(value = "Control Loop definition name", required = true) @RequestParam("name") String name,
255         @ApiParam(value = "Control Loop definition version") @RequestParam(
256             value = "version",
257             required = true) String version) throws PfModelException {
258
259         return ResponseEntity.ok().body(provider.deleteInstanceProperties(name, version));
260     }
261
262     /**
263      * Queries details of all control loops.
264      *
265      * @param requestId request ID used in ONAP logging
266      * @param name the name of the control loop to get, null for all control loops
267      * @param version the version of the control loop to get, null for all control loops
268      * @return the control loops
269      * @throws PfModelException on errors getting commissioning of control loop
270      */
271     // @formatter:off
272     @GetMapping(value = "/instantiation",
273             produces = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML})
274     @ApiOperation(value = "Query details of the requested control loops",
275             notes = "Queries details of the requested control loops, returning all control loop details",
276             response = ControlLoops.class,
277             tags = {TAGS},
278             authorizations = @Authorization(value = AUTHORIZATION_TYPE),
279             responseHeaders = {
280                 @ResponseHeader(
281                     name = VERSION_MINOR_NAME, description = VERSION_MINOR_DESCRIPTION,
282                     response = String.class),
283                 @ResponseHeader(name = VERSION_PATCH_NAME, description = VERSION_PATCH_DESCRIPTION,
284                     response = String.class),
285                 @ResponseHeader(name = VERSION_LATEST_NAME, description = VERSION_LATEST_DESCRIPTION,
286                     response = String.class),
287                 @ResponseHeader(name = REQUEST_ID_NAME, description = REQUEST_ID_HDR_DESCRIPTION,
288                     response = UUID.class)},
289             extensions = {
290                 @Extension
291                      (
292                          name = EXTENSION_NAME,
293                          properties = {
294                              @ExtensionProperty(name = API_VERSION_NAME, value = API_VERSION),
295                              @ExtensionProperty(name = LAST_MOD_NAME, value = LAST_MOD_RELEASE)
296                          }
297                     )
298                 }
299         )
300     @ApiResponses(
301             value = {
302                 @ApiResponse(code = AUTHENTICATION_ERROR_CODE, message = AUTHENTICATION_ERROR_MESSAGE),
303                 @ApiResponse(code = AUTHORIZATION_ERROR_CODE, message = AUTHORIZATION_ERROR_MESSAGE),
304                 @ApiResponse(code = SERVER_ERROR_CODE, message = SERVER_ERROR_MESSAGE)
305             }
306         )
307     // @formatter:on
308     public ResponseEntity<ControlLoops> query(
309             @RequestHeader(
310                     name = REQUEST_ID_NAME,
311                     required = false) @ApiParam(REQUEST_ID_PARAM_DESCRIPTION) UUID requestId,
312             @ApiParam(value = "Control Loop definition name", required = false) @RequestParam(
313                     value = "name",
314                     required = false) String name,
315             @ApiParam(value = "Control Loop definition version", required = false) @RequestParam(
316                     value = "version",
317                     required = false) String version)
318             throws PfModelException {
319
320         return ResponseEntity.ok().body(provider.getControlLoops(name, version));
321     }
322
323     /**
324      * Updates a control loop.
325      *
326      * @param requestId request ID used in ONAP logging
327      * @param controlLoops the control loops
328      * @return a response
329      * @throws PfModelException on errors updating of control loops
330      */
331     // @formatter:off
332     @PutMapping(value = "/instantiation",
333             produces = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML},
334             consumes = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML})
335     @ApiOperation(
336             value = "Updates control loop definitions",
337             notes = "Updates control loop definitions, returning the updated control loop definition IDs",
338             response = InstantiationResponse.class,
339             tags = {TAGS},
340             authorizations = @Authorization(value = AUTHORIZATION_TYPE),
341             responseHeaders = {
342                 @ResponseHeader(
343                     name = VERSION_MINOR_NAME,
344                     description = VERSION_MINOR_DESCRIPTION,
345                     response = String.class),
346                 @ResponseHeader(
347                     name = VERSION_PATCH_NAME,
348                     description = VERSION_PATCH_DESCRIPTION,
349                     response = String.class),
350                 @ResponseHeader(
351                     name = VERSION_LATEST_NAME,
352                     description = VERSION_LATEST_DESCRIPTION,
353                     response = String.class),
354                 @ResponseHeader(
355                     name = REQUEST_ID_NAME,
356                     description = REQUEST_ID_HDR_DESCRIPTION,
357                     response = UUID.class)
358             },
359             extensions = {
360                 @Extension
361                     (
362                         name = EXTENSION_NAME,
363                         properties = {
364                             @ExtensionProperty(name = API_VERSION_NAME, value = API_VERSION),
365                             @ExtensionProperty(name = LAST_MOD_NAME, value = LAST_MOD_RELEASE)
366                         }
367                     )
368             }
369         )
370     @ApiResponses(
371             value = {
372                 @ApiResponse(code = AUTHENTICATION_ERROR_CODE, message = AUTHENTICATION_ERROR_MESSAGE),
373                 @ApiResponse(code = AUTHORIZATION_ERROR_CODE, message = AUTHORIZATION_ERROR_MESSAGE),
374                 @ApiResponse(code = SERVER_ERROR_CODE, message = SERVER_ERROR_MESSAGE)
375             }
376         )
377     // @formatter:on
378     public ResponseEntity<InstantiationResponse> update(
379             @RequestHeader(
380                     name = REQUEST_ID_NAME,
381                     required = false) @ApiParam(REQUEST_ID_PARAM_DESCRIPTION) UUID requestId,
382             @ApiParam(value = "Entity Body of Control Loop", required = true) @RequestBody ControlLoops controlLoops)
383             throws PfModelException {
384
385         return ResponseEntity.ok().body(provider.updateControlLoops(controlLoops));
386     }
387
388     /**
389      * Deletes a control loop definition.
390      *
391      * @param requestId request ID used in ONAP logging
392      * @param name the name of the control loop to delete
393      * @param version the version of the control loop to delete
394      * @return a response
395      * @throws PfModelException on errors deleting of control loop
396      */
397     // @formatter:off
398     @DeleteMapping(value = "/instantiation",
399             produces = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML})
400     @ApiOperation(value = "Delete a control loop",
401             notes = "Deletes a control loop, returning optional error details",
402             response = InstantiationResponse.class,
403             tags = {TAGS},
404             authorizations = @Authorization(value = AUTHORIZATION_TYPE),
405             responseHeaders = {
406                 @ResponseHeader(
407                     name = VERSION_MINOR_NAME,
408                     description = VERSION_MINOR_DESCRIPTION,
409                     response = String.class),
410                 @ResponseHeader(
411                     name = VERSION_PATCH_NAME,
412                     description = VERSION_PATCH_DESCRIPTION,
413                     response = String.class),
414                 @ResponseHeader(
415                     name = VERSION_LATEST_NAME,
416                     description = VERSION_LATEST_DESCRIPTION,
417                     response = String.class),
418                 @ResponseHeader(
419                     name = REQUEST_ID_NAME,
420                     description = REQUEST_ID_HDR_DESCRIPTION,
421                     response = UUID.class)},
422             extensions = {
423                 @Extension
424                     (
425                         name = EXTENSION_NAME,
426                         properties = {
427                             @ExtensionProperty(name = API_VERSION_NAME, value = API_VERSION),
428                             @ExtensionProperty(name = LAST_MOD_NAME, value = LAST_MOD_RELEASE)
429                         }
430                     )
431                 }
432         )
433     @ApiResponses(
434         value = {
435             @ApiResponse(code = AUTHENTICATION_ERROR_CODE, message = AUTHENTICATION_ERROR_MESSAGE),
436             @ApiResponse(code = AUTHORIZATION_ERROR_CODE, message = AUTHORIZATION_ERROR_MESSAGE),
437             @ApiResponse(code = SERVER_ERROR_CODE, message = SERVER_ERROR_MESSAGE)
438         }
439     )
440     // @formatter:on
441
442     public ResponseEntity<InstantiationResponse> delete(
443             @RequestHeader(
444                     name = REQUEST_ID_NAME,
445                     required = false) @ApiParam(REQUEST_ID_PARAM_DESCRIPTION) UUID requestId,
446             @ApiParam(value = "Control Loop definition name", required = true) @RequestParam("name") String name,
447             @ApiParam(value = "Control Loop definition version") @RequestParam(
448                     value = "version",
449                     required = false) String version)
450             throws PfModelException {
451
452         return ResponseEntity.ok().body(provider.deleteControlLoop(name, version));
453     }
454
455     /**
456      * Issues control loop commands to control loops.
457      *
458      * @param requestId request ID used in ONAP logging
459      * @param command the command to issue to control loops
460      * @return the control loop definitions
461      * @throws PfModelException on errors issuing a command
462      * @throws ControlLoopException on errors issuing a command
463      */
464     // @formatter:off
465     @PutMapping(value = "/instantiation/command",
466             produces = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML},
467             consumes = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML})
468     @ApiOperation(value = "Issue a command to the requested control loops",
469             notes = "Issues a command to a control loop, ordering a state change on the control loop",
470             response = InstantiationResponse.class,
471             tags = {TAGS},
472             authorizations = @Authorization(value = AUTHORIZATION_TYPE),
473             responseHeaders = {
474                 @ResponseHeader(
475                     name = VERSION_MINOR_NAME, description = VERSION_MINOR_DESCRIPTION,
476                     response = String.class),
477                 @ResponseHeader(name = VERSION_PATCH_NAME, description = VERSION_PATCH_DESCRIPTION,
478                     response = String.class),
479                 @ResponseHeader(name = VERSION_LATEST_NAME, description = VERSION_LATEST_DESCRIPTION,
480                     response = String.class),
481                 @ResponseHeader(name = REQUEST_ID_NAME, description = REQUEST_ID_HDR_DESCRIPTION,
482                     response = UUID.class)},
483             extensions = {
484                 @Extension
485                     (
486                         name = EXTENSION_NAME,
487                         properties = {
488                             @ExtensionProperty(name = API_VERSION_NAME, value = API_VERSION),
489                             @ExtensionProperty(name = LAST_MOD_NAME, value = LAST_MOD_RELEASE)
490                         }
491                     )
492                 }
493         )
494     @ApiResponses(
495             value = {
496                 @ApiResponse(code = AUTHENTICATION_ERROR_CODE, message = AUTHENTICATION_ERROR_MESSAGE),
497                 @ApiResponse(code = AUTHORIZATION_ERROR_CODE, message = AUTHORIZATION_ERROR_MESSAGE),
498                 @ApiResponse(code = SERVER_ERROR_CODE, message = SERVER_ERROR_MESSAGE)
499             }
500         )
501     // @formatter:on
502     public ResponseEntity<InstantiationResponse> issueControlLoopCommand(
503             @RequestHeader(
504                     name = REQUEST_ID_NAME,
505                     required = false) @ApiParam(REQUEST_ID_PARAM_DESCRIPTION) UUID requestId,
506             @ApiParam(
507                     value = "Entity Body of control loop command",
508                     required = true) @RequestBody InstantiationCommand command)
509             throws ControlLoopException, PfModelException {
510
511         return ResponseEntity.accepted().body(provider.issueControlLoopCommand(command));
512     }
513
514     /**
515      * Queries details of all control loops.
516      *
517      * @param requestId request ID used in ONAP logging
518      * @param name the name of the control loop to get, null for all control loops
519      * @param version the version of the control loop to get, null for all control loops
520      * @return the control loops
521      * @throws PfModelException on errors getting commissioning of control loop
522      */
523     // @formatter:off
524     @GetMapping(value = "/instantiationState",
525         produces = {MediaType.APPLICATION_JSON_VALUE, APPLICATION_YAML})
526     @ApiOperation(value = "Query details of the requested control loops",
527         notes = "Queries details of the requested control loops, returning all control loop details",
528         response = ControlLoops.class,
529         tags = {TAGS},
530         authorizations = @Authorization(value = AUTHORIZATION_TYPE),
531         responseHeaders = {
532             @ResponseHeader(
533                 name = VERSION_MINOR_NAME, description = VERSION_MINOR_DESCRIPTION,
534                 response = String.class),
535             @ResponseHeader(name = VERSION_PATCH_NAME, description = VERSION_PATCH_DESCRIPTION,
536                 response = String.class),
537             @ResponseHeader(name = VERSION_LATEST_NAME, description = VERSION_LATEST_DESCRIPTION,
538                 response = String.class),
539             @ResponseHeader(name = REQUEST_ID_NAME, description = REQUEST_ID_HDR_DESCRIPTION,
540                 response = UUID.class)},
541         extensions = {
542             @Extension
543                 (
544                     name = EXTENSION_NAME,
545                     properties = {
546                         @ExtensionProperty(name = API_VERSION_NAME, value = API_VERSION),
547                         @ExtensionProperty(name = LAST_MOD_NAME, value = LAST_MOD_RELEASE)
548                     }
549                 )
550         }
551     )
552     @ApiResponses(
553         value = {
554             @ApiResponse(code = AUTHENTICATION_ERROR_CODE, message = AUTHENTICATION_ERROR_MESSAGE),
555             @ApiResponse(code = AUTHORIZATION_ERROR_CODE, message = AUTHORIZATION_ERROR_MESSAGE),
556             @ApiResponse(code = SERVER_ERROR_CODE, message = SERVER_ERROR_MESSAGE)
557         }
558     )
559     // @formatter:on
560     public ResponseEntity<ControlLoopOrderStateResponse> getInstantiationOrderState(
561         @RequestHeader(
562             name = REQUEST_ID_NAME,
563             required = false) @ApiParam(REQUEST_ID_PARAM_DESCRIPTION) UUID requestId,
564         @ApiParam(value = "Control Loop name", required = false) @RequestParam(
565             value = "name",
566             required = false) String name,
567         @ApiParam(value = "Control Loop version", required = false) @RequestParam(
568             value = "version",
569             required = false) String version)
570         throws PfModelException {
571
572         return ResponseEntity.ok().body(provider.getInstantiationOrderState(name, version));
573     }
574 }