cps-base-path: /cps/api
ncmp-base-path: /ncmp
ncmp-inventory-base-path: /ncmpInventory
+ provmns-base-path: /ProvMnS
spring:
main:
cps-base-path: /cps/api
ncmp-base-path: /ncmp
ncmp-inventory-base-path: /ncmpInventory
+ provmns-base-path: /ProvMnS
spring:
main:
target/generated-sources/openapi/src/gen/java/org/onap/cps/ncmp/rest/provmns/model/*.java
# Allow generation of the below model for ProvMns
-!target/generated-sources/openapi/src/gen/java/org/onap/cps/ncmp/rest/provmns/model/ClassNameIdGetDataNodeSelectorParameter.java
!target/generated-sources/openapi/src/gen/java/org/onap/cps/ncmp/rest/provmns/model/ClassNameIdPatchDefaultResponse.java
!target/generated-sources/openapi/src/gen/java/org/onap/cps/ncmp/rest/provmns/model/ErrorResponseDefault.java
!target/generated-sources/openapi/src/gen/java/org/onap/cps/ncmp/rest/provmns/model/ErrorResponseDefaultOtherProblemsInner.java
</configOptions>
<importMappings>
<importMapping>Resource=org.onap.cps.ncmp.rest.provmns.model.Resource</importMapping>
+ <importMapping>ClassNameIdGetDataNodeSelectorParameter=org.onap.cps.ncmp.rest.provmns.model.ClassNameIdGetDataNodeSelectorParameter</importMapping>
</importMappings>
<ignoreFileOverride>${project.basedir}/.openapi-generator-ignore-provmns</ignoreFileOverride>
</configuration>
--- /dev/null
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2025 OpenInfra Foundation Europe
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.cps.ncmp.rest.controller;
+
+
+import java.util.List;
+import lombok.RequiredArgsConstructor;
+import org.onap.cps.ncmp.rest.provmns.api.DefaultApi;
+import org.onap.cps.ncmp.rest.provmns.model.ClassNameIdGetDataNodeSelectorParameter;
+import org.onap.cps.ncmp.rest.provmns.model.Resource;
+import org.onap.cps.ncmp.rest.provmns.model.Scope;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("${rest.api.provmns-base-path}")
+@RequiredArgsConstructor
+public class ProvMnsController implements DefaultApi {
+
+ /**
+ * Replaces a complete single resource or creates it if it does not exist.
+ *
+ * @param className Class name of the targeted resource
+ * @param id Identifier of the targeted resource
+ * @param resource Resource representation of the resource to be created or replaced
+ * @return {@code ResponseEntity} The representation of the updated resource is returned in the response
+ * message body.
+ */
+ @Override
+ public ResponseEntity<Resource> classNameidPut(final String className, final String id, final Resource resource) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ /**
+ * Reads one or multiple resources.
+ *
+ * @param className Class name of the targeted resource
+ * @param id Identifier of the targeted resource
+ * @param scope Extends the set of targeted resources beyond the base
+ * resource identified with the authority and path component of
+ * the URI.
+ * @param filter Reduces the targeted set of resources by applying a filter to
+ * the scoped set of resource representations. Only resources
+ * representations for which the filter construct evaluates to
+ * "true" are targeted.
+ * @param attributes Attributes of the scoped resources to be returned. The
+ * value is a comma-separated list of attribute names.
+ * @param fields Attribute fields of the scoped resources to be returned. The
+ * value is a comma-separated list of JSON pointers to the
+ * attribute fields.
+ * @param dataNodeSelector dataNodeSelector object
+ * @return {@code ResponseEntity} The resources identified in the request for retrieval are returned
+ * in the response message body.
+ */
+ @Override
+ public ResponseEntity<Resource> classNameidGet(final String className, final String id, final Scope scope,
+ final String filter, final List<String> attributes,
+ final List<String> fields,
+ final ClassNameIdGetDataNodeSelectorParameter dataNodeSelector) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ /**
+ * Patches (Create, Update or Delete) one or multiple resources.
+ *
+ * @param className Class name of the targeted resource
+ * @param id Identifier of the targeted resource
+ * @param resource Resource representation of the resource to be created or replaced
+ * @return {@code ResponseEntity} The updated resource representations are returned in the response message body.
+ */
+ @Override
+ public ResponseEntity<Resource> classNameidPatch(final String className, final String id, final Resource resource) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
+ /**
+ * Delete one or multiple resources.
+ *
+ * @param className Class name of the targeted resource
+ * @param id Identifier of the targeted resource
+ * @return {@code ResponseEntity} The response body is empty, HTTP status returned.
+ */
+ @Override
+ public ResponseEntity<Void> classNameidDelete(final String className, final String id) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+}
--- /dev/null
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2025 OpenInfra Foundation Europe
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.cps.ncmp.rest.provmns.model;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * This class serves as a replacement for the generated ClassNameIdGetDataNodeSelector class which contains dependencies
+ * that cause code generation issues.
+ */
+@Getter
+@Setter
+public class ClassNameIdGetDataNodeSelectorParameter {
+
+ private String dataNodeSelector;
+
+}
package org.onap.cps.ncmp.rest.provmns.model;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
/**
* This interface serves as a replacement for the generated Resource class, which has dependencies on the NRM-related
* models that we want to avoid for our implementation of Provisioning and Management Services (ProvMnS) API.
*/
+@JsonSerialize(as = ResourceOneOf.class)
+@JsonDeserialize(as = ResourceOneOf.class)
public interface Resource { }
--- /dev/null
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.cps.ncmp.rest.controller
+
+import com.fasterxml.jackson.databind.ObjectMapper
+import org.onap.cps.ncmp.rest.provmns.model.ResourceOneOf
+import org.onap.cps.utils.JsonObjectMapper
+import org.spockframework.spring.SpringBean
+import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.beans.factory.annotation.Value
+import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest
+import org.springframework.http.HttpStatus
+import org.springframework.http.MediaType
+import org.springframework.test.web.servlet.MockMvc
+import spock.lang.Specification
+
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put
+
+@WebMvcTest(ProvMnsController)
+class ProvMnsControllerSpec extends Specification {
+
+ @Autowired
+ MockMvc mvc
+
+ def jsonObjectMapper = new JsonObjectMapper(new ObjectMapper())
+
+ @Value('${rest.api.provmns-base-path}')
+ def provMnSBasePath
+
+ def 'Get Resource Data from provmns interface.'() {
+ given: 'resource data url'
+ def getUrl = "$provMnSBasePath/test=another"
+ when: 'get data resource request is performed'
+ def response = mvc.perform(get(getUrl).contentType(MediaType.APPLICATION_JSON)).andReturn().response
+ then: 'response status is Not Implemented (501)'
+ assert response.status == HttpStatus.NOT_IMPLEMENTED.value()
+ }
+
+ def 'Put Resource Data from provmns interface.'() {
+ given: 'resource data url'
+ def putUrl = "$provMnSBasePath/test=another"
+ and: 'an example resource json object'
+ def jsonBody = jsonObjectMapper.asJsonString(new ResourceOneOf('test'))
+ when: 'put data resource request is performed'
+ def response = mvc.perform(put(putUrl)
+ .contentType(MediaType.APPLICATION_JSON)
+ .content(jsonBody))
+ .andReturn().response
+ then: 'response status is Not Implemented (501)'
+ assert response.status == HttpStatus.NOT_IMPLEMENTED.value()
+ }
+
+ def 'Patch Resource Data from provmns interface.'() {
+ given: 'resource data url'
+ def patchUrl = "$provMnSBasePath/test=another"
+ and: 'an example resource json object'
+ def jsonBody = jsonObjectMapper.asJsonString(new ResourceOneOf('test'))
+ when: 'patch data resource request is performed'
+ def response = mvc.perform(patch(patchUrl)
+ .contentType(new MediaType('application', 'json-patch+json'))
+ .content(jsonBody))
+ .andReturn().response
+ then: 'response status is Not Implemented (501)'
+ assert response.status == HttpStatus.NOT_IMPLEMENTED.value()
+ }
+
+ def 'Delete Resource Data from provmns interface.'() {
+ given: 'resource data url'
+ def deleteUrl = "$provMnSBasePath/test=another"
+ when: 'delete data resource request is performed'
+ def response = mvc.perform(delete(deleteUrl)).andReturn().response
+ then: 'response status is Not Implemented (501)'
+ assert response.status == HttpStatus.NOT_IMPLEMENTED.value()
+ }
+
+}
api:
ncmp-base-path: /ncmp
ncmp-inventory-base-path: /ncmpInventory
+ provmns-base-path: /ProvMnS
notification:
enabled: true
--- /dev/null
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.cps.integration.functional.ncmp.provmns
+
+import org.onap.cps.integration.base.CpsIntegrationSpecBase
+import org.onap.cps.ncmp.rest.provmns.model.ResourceOneOf
+import org.springframework.http.MediaType
+
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
+
+class ProvMnSRestApiSpec extends CpsIntegrationSpecBase{
+
+ def 'Get Resource Data from provmns interface.'() {
+ expect: 'not implemented response on GET endpoint'
+ mvc.perform(get("/ProvMnS/SampleClassName=SampleId"))
+ .andExpect(status().isNotImplemented())
+ }
+
+ def 'Put Resource Data from provmns interface.'() {
+ given: 'an example resource json body'
+ def jsonBody = jsonObjectMapper.asJsonString(new ResourceOneOf('test'))
+ expect: 'not implemented response on PUT endpoint'
+ mvc.perform(put("/ProvMnS/SampleClassName=SampleId")
+ .contentType(MediaType.APPLICATION_JSON)
+ .content(jsonBody))
+ .andExpect(status().isNotImplemented())
+ }
+
+ def 'Patch Resource Data from provmns interface.'() {
+ given: 'an example resource json body'
+ def jsonBody = jsonObjectMapper.asJsonString(new ResourceOneOf('test'))
+ expect: 'not implemented response on PATCH endpoint'
+ mvc.perform(patch("/ProvMnS/SampleClassName=SampleId")
+ .contentType(new MediaType('application', 'json-patch+json'))
+ .content(jsonBody))
+ .andExpect(status().isNotImplemented())
+ }
+
+ def 'Delete Resource Data from provmns interface.'() {
+ expect: 'not implemented response on DELETE endpoint'
+ mvc.perform(delete("/ProvMnS/SampleClassName=SampleId"))
+ .andExpect(status().isNotImplemented())
+ }
+}
cps-base-path: /cps/api
ncmp-base-path: /ncmp
ncmp-inventory-base-path: /ncmpInventory
+ provmns-base-path: /ProvMnS
spring:
main:
{
"info": {
- "_postman_id": "972d83a9-62bc-4cdb-aa41-9c6e17cb9846",
+ "_postman_id": "1a955ed1-f754-4206-a3dd-b2b975b3098f",
"name": "CPS",
"description": "<img src=\"https://content.pstmn.io/bfbd86c2-7aa4-4afd-bd4a-207de1305bb7/Q1BTTG9nby5wbmc=\">\n\n# [CPS ONAP Documentation](https://docs.onap.org/projects/onap-cps/en/latest/index.html)\n\n# [DMI ONAP Documentation](https://docs.onap.org/projects/onap-cps-ncmp-dmi-plugin/en/latest/index.html)\n\n### How-to\n\nBuild CPS docker images with maven:\n\n`mvn clean install`\n\nor\n\n`mvn clean install -DskipTests`\n\nNavigate to docker-compose folder:\n\n`cd .\\docker-compose\\`\n\nBring up docker containers using commands found in docker-compose.yaml or run CPS services including dmi plugin\n\n`docker-compose --profile dmi-service up -d`\n\n### CPS-Enviroment\n\nTo enable the CPS enviroment, go to the top right of the screen in Postman and click envrioments. Import the CPS-envrioment file from the Postman Collections file in CPS.\n\n**To utilise NCMP-DMI-Stub endpoints begin the docker containers with:**\n\n`docker-compose --profile dmi-stub --profile monitoring up -d`\n\n# CPS Core Example\n\n- Create dataspace\n \n- Verify dataspace exists\n \n- etc...\n \n\n# CPS-NCMP Example\n\n- Create CM handles\n \n- Verify CM handles exist\n \n- etc...",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
- "_exporter_id": "16927565",
- "_collection_link": "https://cps555.postman.co/workspace/CPS-Workspace~388a7e32-81fe-4932-8636-02ccf8b51aca/collection/16927565-972d83a9-62bc-4cdb-aa41-9c6e17cb9846?action=share&source=collection_link&creator=16927565"
+ "_exporter_id": "26733783"
},
"item": [
{
{
"name": "Northbound (rApps)",
"item": [
+ {
+ "name": "ProvMnS",
+ "item": [
+ {
+ "name": "Get Resource Data",
+ "protocolProfileBehavior": {
+ "disableBodyPruning": true
+ },
+ "request": {
+ "method": "GET",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": ""
+ },
+ "url": {
+ "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ProvMnS/test=another",
+ "protocol": "http",
+ "host": [
+ "{{CPS_HOST}}"
+ ],
+ "port": "{{CPS_PORT}}",
+ "path": [
+ "ProvMnS",
+ "test=another"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Patch Resource Data",
+ "protocolProfileBehavior": {
+ "disabledSystemHeaders": {
+ "content-type": true
+ }
+ },
+ "request": {
+ "method": "PATCH",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json-patch+json",
+ "type": "text"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"id\": \"test\"\r\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ProvMnS/test=another",
+ "protocol": "http",
+ "host": [
+ "{{CPS_HOST}}"
+ ],
+ "port": "{{CPS_PORT}}",
+ "path": [
+ "ProvMnS",
+ "test=another"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Put Resource Data",
+ "protocolProfileBehavior": {
+ "disabledSystemHeaders": {}
+ },
+ "request": {
+ "method": "PUT",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"id\": \"test\"\r\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ProvMnS/test=another",
+ "protocol": "http",
+ "host": [
+ "{{CPS_HOST}}"
+ ],
+ "port": "{{CPS_PORT}}",
+ "path": [
+ "ProvMnS",
+ "test=another"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Delete Resource Data",
+ "request": {
+ "method": "DELETE",
+ "header": [],
+ "url": {
+ "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ProvMnS/test=another",
+ "protocol": "http",
+ "host": [
+ "{{CPS_HOST}}"
+ ],
+ "port": "{{CPS_PORT}}",
+ "path": [
+ "ProvMnS",
+ "test=another"
+ ]
+ }
+ },
+ "response": []
+ }
+ ]
+ },
{
"name": "Get module references",
"protocolProfileBehavior": {