diff options
author | lukegleeson <luke.gleeson@est.tech> | 2021-08-18 09:49:32 +0100 |
---|---|---|
committer | lukegleeson <luke.gleeson@est.tech> | 2021-08-18 19:10:52 +0100 |
commit | 05701dda6edf6b8e7c06699a7b44247359c46cfb (patch) | |
tree | 62aba10ce7d8721cdf1272e3514bf645c8d59da5 /cps-rest/src/main | |
parent | 24112c0a500e94dc6068be71105874f8d81678b7 (diff) |
Delete list-node p2 rest layer
Issue-ID: CPS-361
Signed-off-by: lukegleeson <luke.gleeson@est.tech>
Change-Id: I5fb8d202fc0a65679d10377cc2959a7f8f854ca7
Diffstat (limited to 'cps-rest/src/main')
-rwxr-xr-x | cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java | 7 | ||||
-rw-r--r-- | cps-rest/src/main/resources/static/cpsData.yml | 20 |
2 files changed, 27 insertions, 0 deletions
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java index bad66dd4e8..5c79472a4c 100755 --- a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java +++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java @@ -96,6 +96,13 @@ public class DataRestController implements CpsDataApi { return new ResponseEntity<>(HttpStatus.OK); } + @Override + public ResponseEntity<Void> deleteListNodeElements(final String dataspaceName, final String anchorName, + final String listNodeXpath) { + cpsDataService.deleteListNodeData(dataspaceName, anchorName, listNodeXpath); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + private static boolean isRootXpath(final String xpath) { return ROOT_XPATH.equals(xpath); } diff --git a/cps-rest/src/main/resources/static/cpsData.yml b/cps-rest/src/main/resources/static/cpsData.yml index 7e9f71d62b..9c4f3334e1 100644 --- a/cps-rest/src/main/resources/static/cpsData.yml +++ b/cps-rest/src/main/resources/static/cpsData.yml @@ -97,6 +97,26 @@ listNodeByDataspaceAndAnchor: '403': $ref: 'components.yml#/components/responses/Forbidden' + delete: + description: Delete list-node child elements under existing node for a given anchor and dataspace + tags: + - cps-data + summary: Delete list-node child element(s) under existing parent node + operationId: deleteListNodeElements + parameters: + - $ref: 'components.yml#/components/parameters/dataspaceNameInPath' + - $ref: 'components.yml#/components/parameters/anchorNameInPath' + - $ref: 'components.yml#/components/parameters/requiredXpathInQuery' + responses: + '204': + $ref: 'components.yml#/components/responses/NoContent' + '400': + $ref: 'components.yml#/components/responses/BadRequest' + '401': + $ref: 'components.yml#/components/responses/Unauthorized' + '403': + $ref: 'components.yml#/components/responses/Forbidden' + nodesByDataspaceAndAnchor: post: description: Create a node for a given anchor and dataspace |