Update operation passthrough running - openapi 52/125552/6
authorniamhcore <niamh.core@est.tech>
Tue, 2 Nov 2021 14:08:16 +0000 (14:08 +0000)
committerniamhcore <niamh.core@est.tech>
Mon, 8 Nov 2021 09:55:19 +0000 (09:55 +0000)
Issue-ID: CPS-636
Signed-off-by: niamhcore <niamh.core@est.tech>
Change-Id: I16d7d84ae6897e3901f5f5a5a59dbc5deae7d4e8

cps-ncmp-rest/docs/openapi/ncmp.yml
cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy

index 9e3560a..611e84e 100755 (executable)
@@ -258,6 +258,37 @@ resourceDataForPassthroughRunning:
       404:
         $ref: 'components.yaml#/components/responses/NotFound'
 
+  put:
+    tags:
+      - network-cm-proxy
+    summary: Update resource data from pass-through running for a cm handle
+    description: Update resource data from pass-through running for the given cm handle
+    operationId: updateResourceDataRunningForCmHandle
+    parameters:
+      - $ref: 'components.yaml#/components/parameters/cmHandleInPath'
+      - $ref: 'components.yaml#/components/parameters/resourceIdentifierInQuery'
+      - $ref: 'components.yaml#/components/parameters/contentParamInHeader'
+    requestBody:
+      required: true
+      content:
+        application/json:
+          schema:
+            type: string
+        application/yang-data+json:
+          schema:
+            type: string
+    responses:
+      200:
+        $ref: 'components.yaml#/components/responses/Ok'
+      400:
+        $ref: 'components.yaml#/components/responses/BadRequest'
+      401:
+        $ref: 'components.yaml#/components/responses/Unauthorized'
+      403:
+        $ref: 'components.yaml#/components/responses/Forbidden'
+      404:
+        $ref: 'components.yaml#/components/responses/NotFound'
+
 fetchModuleReferencesByCmHandle:
   get:
     description: fetch all module references (name and revision) for a given cm handle
index ca661b8..19b9a09 100755 (executable)
@@ -132,6 +132,12 @@ public class NetworkCmProxyController implements NetworkCmProxyApi {
         return new ResponseEntity<>(HttpStatus.OK);
     }
 
+    @Override
+    public ResponseEntity<Object> updateResourceDataRunningForCmHandle(final String cmHandle,
+        final String resourceIdentifier, final String requestBody, final String contentType) {
+        return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+    }
+
     /**
      * Update Node Leaves.
      * @deprecated This Method is no longer used as part of NCMP.
index a609cfa..4066fd3 100644 (file)
@@ -281,5 +281,19 @@ class NetworkCmProxyControllerSpec extends Specification {
         then: 'an empty cm handle identifier is returned'
             response.contentAsString == '{"cmHandles":null}'
     }
+
+    def 'Update resource data in passthrough-running datastore.' () {
+        given: 'update resource data url'
+            def updateUrl = "$ncmpBasePathV1/ch/testCmHandle/data/ds/ncmp-datastore:passthrough-running" +
+                    "?resourceIdentifier=parent/child"
+        when: 'update data resource request is performed'
+            def response = mvc.perform(
+                    put(updateUrl)
+                            .contentType(MediaType.APPLICATION_JSON_VALUE)
+                            .accept(MediaType.APPLICATION_JSON_VALUE).content('some-request-body')
+            ).andReturn().response
+        then: 'the response status is not implemented'
+            response.status == HttpStatus.NOT_IMPLEMENTED.value()
+    }
 }