Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

POST /dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes

Description

Get a node given an anchor for the given dataspace (return just one level with just xpath references to its children)

Request Body

{

    "xpath" : "/dataspace/anchors/nodes//module[@xmlns="urn:ietf:params:xml:ns:yang:yin:1"]/container[@name="bookstore"]@name"

}

Request Parameters:

NameDescriptionTypeData type
dataspace-nameThe name of the dataspacepathstringrequired
anchor-nameThe name of the anchorpathstringrequired


200 – OK – Everything is working

Example Response

Code Block
		list books[
  "container": {
		      key title;

			leaf title {
				type string;
			}
			leaf lang {
				type string;
			}
			leaf-list authors {
				type string;
			}
			leaf pub_year {
				type year;
			}
			leaf price {
				type uint64;
			}
		}"@name": "bookstore",
      "list": {
         "@name": "categories",
         "key": {
            "@value": "name"
         }
]



POST /dataspaces/{dataspace-id}/nodes

Description

Get a node (under any anchor) given a Xpath expression for the given dataspace

Get all the relevant nodes given a schema node identifier for the given dataspace

Request Body

{

    "xpath" : "/dataspace/anchor/nodes/module[@xmlns="urn:ietf:params:xml:ns:yang:yin:1"]//container[@name="bookstore"]@name"

}

Request Parameters:

NameDescriptionTypeData type
dataspace-nameThe name of the dataspacepathstringrequired


200 – OK – Everything is working

Example Response

Code Block
	"container": {
      "@name": "bookstore",
      "list": {
         "@name": "categories",
         "key": {
            "@value": "name"
         },
         "leaf": {
            "@name": "name",
            "type": {
               "@name": "string"
            }
         },
         "list": {
            "@name": "books",
            "key": {
               "@value": "title"
            },
            "leaf": [
               {
                  "@name": "title",
                  "type": {
                     "@name": "string"
                  }
               },
               {
                  "@name": "lang",
                  "type": {
                     "@name": "string"
                  }
               },
               {
                  "@name": "pub_year",
                  "type": {
                     "@name": "year"
                  }
               },
               {
                  "@name": "price",
                  "type": {
                     "@name": "uint64"
                  }
               }
            ],
            "leaf-list": {
               "@name": "authors",
               "type": {
                  "@name": "string"
               }
            }
         }
      }



Payload Data Structures

Code Block
module bookstore {
    yang-version 1.1;

    namespace "org:onap:ccsdk:sample";

    prefix book-store;

    revision "2020-09-15" {
        description
        "Sample Model";
    }

    typedef year {
    	type uint16 {
    		range "1000..9999";
    	}
    }

    container bookstore {

	list categories {

		key name;

		leaf name {
			type string;
		}

		list books {
		    key title;

			leaf title {
				type string;
			}
			leaf lang {
				type string;
			}
			leaf-list authors {
				type string;
			}
			leaf pub_year {
				type year;
			}
			leaf price {
				type uint64;
			}
		}
	}

...


	}
}


Schema definitions

TODO

dataspace : object

Description:

A dataspace is an object that contains yang modules.

...