S.no | API | Xpath | Expected Output |
---|
1. | Get a node : GET /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/node | / |
Code Block |
---|
language | xml |
---|
theme | Confluence |
---|
title | Output Response |
---|
collapse | true |
---|
| <?xml version='1.0' encoding='UTF-8'?>
<bookstore xmlns="org:onap:ccsdk:sample">
<bookstore-name>Chapters</bookstore-name>
<categories>
<code>1</code>
<name>SciFi</name>
<books>
<title> A Space Odyssey</title>
<lang>en</lang>
<authors>
Iain M. Banks
</authors>
<pub_year>1994</pub_year>
<price>895</price>
</books>
</categories>
</bookstore> |
|
2. | Update node leaves : PATCH /{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes Endpoint will remains same , ContentType header is added. This API accepts XML data and performs update operation | /bookstore/bookstore/categories[@code=1] |
Code Block |
---|
language | xml |
---|
theme | Confluence |
---|
title | Output Response |
---|
collapse | true |
---|
| <?xml version='1.0' encoding='UTF-8'?>
<bookstore xmlns="org:onap:ccsdk:sample">
<code>1</code>
<name>some-name</name>
</bookstore> |
|
3. | Replace a node with descendants: PUT /{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes | /bookstore/categories[@code=1] | Here node will be replaced by child nodes |
4. | Add list element(s): POST /{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes | /bookstore/categories[@code=1] |
Code Block |
---|
language | xml |
---|
theme | Confluence |
---|
title | Output Response |
---|
collapse | true |
---|
| <?xml version='1.0' encoding='UTF-8'?>
<bookstore xmlns="org:onap:ccsdk:sample">
<bookstore-name>Chapters</bookstore-name>
<categories>
<code>1</code>
<name>SciFi</name>
<books>
<title>A Space Odyssey</title>
<lang>en</lang>
<authors>
Iain M. Banks
</authors>
<pub_year>1994</pub_year>
<price>895</price>
<title>unknown</title>
<lang>english</lang>
<authors>
Maxwell
</authors>
<pub_year>1998</pub_year>
<price>1000</price>
</books>
</categories>
|
|
5. | Replace list content: PUT /{apiVersion}/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes | /bookstore/categories[@code=1] |
Code Block |
---|
language | xml |
---|
theme | Confluence |
---|
title | Output Response |
---|
collapse | true |
---|
| <?xml version='1.0' encoding='UTF-8'?>
<bookstore xmlns="org:onap:ccsdk:sample">
<bookstore-name>Chapters</bookstore-name>
<categories>
<code>1</code>
<name>SciFi</name>
<books>
<title> A Space Odyssey</title>
<lang>Economics</lang>
<authors>
John smith
</authors>
<pub_year>1997</pub_year>
<price>995</price>
</books>
</categories>
</bookstore>
|
|
6. | Query data nodes: GET /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query | //books[@title=" A Space Odyssey"] |
Code Block |
---|
language | xml |
---|
theme | Confluence |
---|
title | Output Response |
---|
collapse | true |
---|
| <?xml version='1.0' encoding='UTF-8'?>
<bookstore xmlns="org:onap:ccsdk:sample">
<books>
<title> A Space Odyssey</title>
<lang>en</lang>
<authors>
Iain M. Banks
</authors>
<pub_year>1994</pub_year>
<price>895</price>
</books>
</bookstore>
|
|
7. | Query data nodes across anchors: GET /v2/dataspaces/{dataspace-name}/nodes/query | //books[@title=" A Space Odyssey"] |
Code Block |
---|
language | xml |
---|
theme | Confluence |
---|
title | Output Response |
---|
collapse | true |
---|
| <?xml version='1.0' encoding='UTF-8'?>
<bookstore xmlns="org:onap:ccsdk:sample">
<books>
<title> A Space Odyssey</title>
<lang>en</lang>
<authors>
Iain M. Banks
</authors>
<pub_year>1994</pub_year>
<price>895</price>
</books>
</bookstore> |
|