2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2021 Bell Canada
4 * Modifications Copyright (C) 2022 Nordix Foundation
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
22 package org.onap.cps.ncmp.rest.controller;
24 import javax.validation.Valid;
25 import lombok.RequiredArgsConstructor;
26 import org.onap.cps.ncmp.api.NetworkCmProxyDataService;
27 import org.onap.cps.ncmp.rest.api.NetworkCmProxyInventoryApi;
28 import org.onap.cps.ncmp.rest.model.RestDmiPluginRegistration;
29 import org.springframework.http.HttpStatus;
30 import org.springframework.http.ResponseEntity;
31 import org.springframework.web.bind.annotation.RequestMapping;
32 import org.springframework.web.bind.annotation.RestController;
35 @RequestMapping("${rest.api.ncmp-inventory-base-path}")
36 @RequiredArgsConstructor
37 public class NetworkCmProxyInventoryController implements NetworkCmProxyInventoryApi {
39 private final NetworkCmProxyDataService networkCmProxyDataService;
40 private final RestInputMapper restInputMapper;
43 * Update DMI Plugin Registration (used for first registration also).
44 * @param restDmiPluginRegistration the registration data
47 public ResponseEntity<Void> updateDmiPluginRegistration(
48 final @Valid RestDmiPluginRegistration restDmiPluginRegistration) {
49 networkCmProxyDataService.updateDmiRegistrationAndSyncModule(
50 restInputMapper.toDmiPluginRegistration(restDmiPluginRegistration));
51 return new ResponseEntity<>(HttpStatus.NO_CONTENT);