From 53f07ac2f4b3699b685b8d009c8949e81fa154a6 Mon Sep 17 00:00:00 2001 From: niamhcore Date: Fri, 19 Feb 2021 13:14:40 +0000 Subject: 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 Change-Id: I3bf2a9946746ad06ddb4bc832206a36b78ff2175 --- cps-rest/docs/api/swagger/components.yml | 8 ++++++++ cps-rest/docs/api/swagger/cpsQuery.yml | 23 +++++++++++++++++++++++ cps-rest/docs/api/swagger/openapi.yml | 3 +++ 3 files changed, 34 insertions(+) create mode 100644 cps-rest/docs/api/swagger/cpsQuery.yml (limited to 'cps-rest/docs/api') diff --git a/cps-rest/docs/api/swagger/components.yml b/cps-rest/docs/api/swagger/components.yml index 3694f36cd3..bb1f120022 100755 --- a/cps-rest/docs/api/swagger/components.yml +++ b/cps-rest/docs/api/swagger/components.yml @@ -75,6 +75,14 @@ components: 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 0000000000..91a4bdbfa1 --- /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 2ead202398..38fbebe67b 100755 --- a/cps-rest/docs/api/swagger/openapi.yml +++ b/cps-rest/docs/api/swagger/openapi.yml @@ -50,3 +50,6 @@ paths: /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 -- cgit 1.2.3-korg