Rest & Java API layer - Query Datanodes using cpsPath that contains contains a leaf name and a leaf value
Issue-ID: CPS-231
Signed-off-by: niamhcore <niamh.core@est.tech>
Change-Id: I3bf2a9946746ad06ddb4bc832206a36b78ff2175
diff --git a/cps-rest/docs/api/swagger/components.yml b/cps-rest/docs/api/swagger/components.yml
index 3694f36..bb1f120 100755
--- a/cps-rest/docs/api/swagger/components.yml
+++ b/cps-rest/docs/api/swagger/components.yml
@@ -75,6 +75,14 @@
schema:
type: string
default: /
+ cpsPathInQuery:
+ name: cps-path
+ in: query
+ description: cps-path
+ required: false
+ schema:
+ type: string
+ default: /
includeDescendantsOptionInQuery:
name: include-descendants
in: query
diff --git a/cps-rest/docs/api/swagger/cpsQuery.yml b/cps-rest/docs/api/swagger/cpsQuery.yml
new file mode 100644
index 0000000..91a4bdb
--- /dev/null
+++ b/cps-rest/docs/api/swagger/cpsQuery.yml
@@ -0,0 +1,23 @@
+nodesByDataspaceAndAnchorAndCpsPath:
+ get:
+ description: Query data nodes for the given dataspace and anchor using CPS path
+ tags:
+ - cps-query
+ summary: Query data nodes
+ operationId: getNodesByDataspaceAndAnchorAndCpsPath
+ parameters:
+ - $ref: 'components.yml#/components/parameters/dataspaceNameInPath'
+ - $ref: 'components.yml#/components/parameters/anchorNameInPath'
+ - $ref: 'components.yml#/components/parameters/cpsPathInQuery'
+ responses:
+ '200':
+ $ref: 'components.yml#/components/responses/Ok'
+ '400':
+ $ref: 'components.yml#/components/responses/BadRequest'
+ '401':
+ $ref: 'components.yml#/components/responses/Unauthorized'
+ '403':
+ $ref: 'components.yml#/components/responses/Forbidden'
+ '404':
+ $ref: 'components.yml#/components/responses/NotFound'
+ x-codegen-request-body-name: xpath
\ No newline at end of file
diff --git a/cps-rest/docs/api/swagger/openapi.yml b/cps-rest/docs/api/swagger/openapi.yml
index 2ead202..38fbebe 100755
--- a/cps-rest/docs/api/swagger/openapi.yml
+++ b/cps-rest/docs/api/swagger/openapi.yml
@@ -50,3 +50,6 @@
/v1/dataspaces/{dataspace-name}/nodes:
$ref: 'cpsData.yml#/nodesByDataspace'
+
+ /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query:
+ $ref: 'cpsQuery.yml#/nodesByDataspaceAndAnchorAndCpsPath'
\ No newline at end of file