You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 5
Next »
Requirement :
we need to search over data across multiple anchors for a given dataspace. for this requirement below changes are proposed
New endpoint : GET http://localhost:8883/cps/api/v2/dataspaces/{dataspace-name}/nodes/query
parameters:
parameter name | in | isRequired |
---|
dataspace-name | path | yes |
cps-path | query | yes |
response :
[
{
"test:bookstore": {
"bookstore-name": "Chapters",
"categories": [
{
"code": 1,
"name": "SciFi"
},
{
"code": 2,
"name": "kids"
}
]
}
},
{"test:bookstore2": {
"bookstore-name": "Chapters2",
"categories": [
{
"code": 1,
"name": "SciFi"
}
]
}
}
]
code changes as below:
file |
|
---|
openapi.yml | add new endpoint: /{version:v[1-2]}/dataspaces/{dataspace-name}/nodes/query: $ref: 'cpsQuery.yml#/nodesByDataspaceAndCpsPath' |
cpsQuery.yml | nodesByDataspaceAndCpsPath: get: description: Query data nodes for all anchors of a given dataspace using CPS path tags: - cps-query summary: Query data nodes across all anchors operationId: getNodesByDataspaceAndCpsPath parameters: - $ref: 'components.yml#/components/parameters/dataspaceNameInPath' - $ref: 'components.yml#/components/parameters/cpsPathInQuery' - $ref: 'components.yml#/components/parameters/includeDescendantsOptionInQuery' responses: '200': description: OK content: application/json: schema: type: array examples: dataSample: $ref: 'components.yml#/components/examples/dataSample' '400': $ref: 'components.yml#/components/responses/BadRequest' '401': $ref: 'components.yml#/components/responses/Unauthorized' '403': $ref: 'components.yml#/components/responses/Forbidden' '500': $ref: 'components.yml#/components/responses/InternalServerError' x-codegen-request-body-name: xpath |
|
|
|
|