- Changed the list-node interface to be consistent with datanode api
Issue-ID: CPS-598
Signed-off-by: Renu Kumari <renu.kumari@bell.ca>
Change-Id: Ic99828f1463e9a724244c05166e477581756f602
'403':
$ref: 'components.yml#/components/responses/Forbidden'
'403':
$ref: 'components.yml#/components/responses/Forbidden'
description: Replace list-node child elements under existing node for a given anchor and dataspace
tags:
- cps-data
description: Replace list-node child elements under existing node for a given anchor and dataspace
tags:
- cps-data
/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes:
$ref: 'cpsData.yml#/nodesByDataspaceAndAnchor'
/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes:
$ref: 'cpsData.yml#/nodesByDataspaceAndAnchor'
- /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-node:
+ /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes:
$ref: 'cpsData.yml#/listNodeByDataspaceAndAnchor'
/v1/dataspaces/{dataspace-name}/nodes:
$ref: 'cpsData.yml#/listNodeByDataspaceAndAnchor'
/v1/dataspaces/{dataspace-name}/nodes:
def parentNodeXpath = 'parent node xpath'
def jsonData = 'json data'
when: 'post is invoked list-node endpoint'
def parentNodeXpath = 'parent node xpath'
def jsonData = 'json data'
when: 'post is invoked list-node endpoint'
- def postRequestBuilder = post("$dataNodeBaseEndpoint/anchors/$anchorName/list-node")
+ def postRequestBuilder = post("$dataNodeBaseEndpoint/anchors/$anchorName/list-nodes")
.contentType(MediaType.APPLICATION_JSON)
.param('xpath', parentNodeXpath)
.content(jsonData)
.contentType(MediaType.APPLICATION_JSON)
.param('xpath', parentNodeXpath)
.content(jsonData)
given: 'parent node xpath and json data inputs'
def parentNodeXpath = 'parent node xpath'
def jsonData = 'json data'
given: 'parent node xpath and json data inputs'
def parentNodeXpath = 'parent node xpath'
def jsonData = 'json data'
- when: 'patch is invoked list-node endpoint'
- def patchRequestBuilder = patch("$dataNodeBaseEndpoint/anchors/$anchorName/list-node")
+ when: 'put is invoked list-node endpoint'
+ def putRequestBuilder = put("$dataNodeBaseEndpoint/anchors/$anchorName/list-nodes")
.contentType(MediaType.APPLICATION_JSON)
.param('xpath', parentNodeXpath)
.content(jsonData)
if (observedTimestamp != null)
.contentType(MediaType.APPLICATION_JSON)
.param('xpath', parentNodeXpath)
.content(jsonData)
if (observedTimestamp != null)
- patchRequestBuilder.param('observed-timestamp', observedTimestamp)
- def response = mvc.perform(patchRequestBuilder).andReturn().response
+ putRequestBuilder.param('observed-timestamp', observedTimestamp)
+ def response = mvc.perform(putRequestBuilder).andReturn().response
then: 'a success response is returned'
response.status == expectedHttpStatus.value()
and: 'the java API was called with the correct parameters'
then: 'a success response is returned'
response.status == expectedHttpStatus.value()
and: 'the java API was called with the correct parameters'
given: 'list node xpath'
def listNodeXpath = 'list node xpath'
when: 'delete is invoked list-node endpoint'
given: 'list node xpath'
def listNodeXpath = 'list node xpath'
when: 'delete is invoked list-node endpoint'
- def deleteRequestBuilder = delete("$dataNodeBaseEndpoint/anchors/$anchorName/list-node")
+ def deleteRequestBuilder = delete("$dataNodeBaseEndpoint/anchors/$anchorName/list-nodes")
.param('xpath', listNodeXpath)
if (observedTimestamp != null)
deleteRequestBuilder.param('observed-timestamp', observedTimestamp)
.param('xpath', listNodeXpath)
if (observedTimestamp != null)
deleteRequestBuilder.param('observed-timestamp', observedTimestamp)