Implementing Create NS
[so.git] / so-etsi-nfvo / so-etsi-nfvo-ns-lcm / so-etsi-nfvo-ns-lcm-service / src / main / java / org / onap / so / etsi / nfvo / ns / lcm / rest / NsLcmOperationOccurrencesController.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2020 Nordix Foundation.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20 package org.onap.so.etsi.nfvo.ns.lcm.rest;
21
22 import static org.onap.so.etsi.nfvo.ns.lcm.Constants.NS_LIFE_CYCLE_MANAGEMENT_BASE_URL;
23 import static org.slf4j.LoggerFactory.getLogger;
24 import javax.ws.rs.core.MediaType;
25 import org.onap.so.etsi.nfvo.ns.lcm.model.NsLcmOpOccsNsLcmOpOcc;
26 import org.slf4j.Logger;
27 import org.springframework.http.HttpStatus;
28 import org.springframework.http.ResponseEntity;
29 import org.springframework.stereotype.Controller;
30 import org.springframework.web.bind.annotation.GetMapping;
31 import org.springframework.web.bind.annotation.PathVariable;
32 import org.springframework.web.bind.annotation.RequestMapping;
33
34 /**
35  * Controller for handling NS lifecycle management operation occurrence requests see clause 6.4.9 and 6.4.10 in
36  * https://www.etsi.org/deliver/etsi_gs/NFV-SOL/001_099/005/02.07.01_60/gs_NFV-SOL005v020701p.pdf
37  * 
38  * @author Waqas Ikram (waqas.ikram@est.tech)
39  *
40  */
41 @Controller
42 @RequestMapping(value = NS_LIFE_CYCLE_MANAGEMENT_BASE_URL)
43 public class NsLcmOperationOccurrencesController {
44     private static final Logger logger = getLogger(NsLcmOperationOccurrencesController.class);
45
46
47     /**
48      * The GET method to retrieve status information about a NS lifecycle management operation occurrence by reading an
49      * individual "NS LCM operation occurrence" resource.
50      * 
51      * @param nsLcmOpOccId Identifier of a NS lifecycle management operation occurrence
52      * @return "200 OK" with {@link NsLcmOpOccsNsLcmOpOcc NsLcmOpOcc} Information about a NS LCM operation occurrence
53      *         was queried successfully. The response body shall contain status information about a NS lifecycle
54      *         management operation occurrence (see clause 6.5.2.3).
55      */
56     @GetMapping(value = "/ns_lcm_op_occs/{nsLcmOpOccId}",
57             produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
58     public ResponseEntity<?> getOperationStatus(@PathVariable("nsLcmOpOccId") final String nsLcmOpOccId) {
59         logger.info("Received request to retrieve operation status for nsLcmOpOccId: {}", nsLcmOpOccId);
60         return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).body("Operation is not supported yet");
61     }
62
63 }