Persisting a list element to a parent list (ep2)
[cps.git] / integration-test / src / test / resources / data / bookstore / bookstore.yang
1 module stores {
2     yang-version 1.1;
3     namespace "org:onap:ccsdk:sample";
4
5     prefix book-store;
6
7     revision "2020-09-15" {
8         description
9         "Sample Model";
10     }
11
12     typedef year {
13         type uint16 {
14             range "1000..9999";
15         }
16     }
17
18     list invoice {
19         key "ProductID";
20         leaf ProductID {
21             type uint64;
22             mandatory "true";
23             description
24             "Unique product ID. Example: 001";
25         }
26         leaf ProductName {
27             type string;
28             mandatory "true";
29             description
30             "Name of the Product";
31         }
32         leaf price {
33             type uint64;
34             mandatory "true";
35             description
36             "Price of book";
37         }
38         leaf stock {
39             type boolean;
40             default "false";
41             description
42             "Book in stock or not. Example value: true";
43         }
44     }
45
46     container bookstore {
47
48         leaf bookstore-name {
49             type string;
50         }
51
52         container webinfo {
53             leaf domain-name {
54                 type string;
55             }
56             leaf contact-email {
57                 type string;
58             }
59         }
60
61         container container-without-leaves { }
62
63         container premises {
64             list addresses {
65                 key "house-number street";
66
67                 leaf house-number {
68                     type uint16;
69                 }
70                 leaf street {
71                     type string;
72                 }
73                 leaf town {
74                     type string;
75                 }
76                 leaf county {
77                     type string;
78                 }
79             }
80         }
81
82         list categories {
83
84             key "code";
85
86             leaf code {
87                 type string;
88             }
89
90             leaf name {
91                 type string;
92             }
93
94             list books {
95                 key title;
96
97                 leaf title {
98                     type string;
99                 }
100                 leaf lang {
101                     type string;
102                 }
103                 leaf-list authors {
104                     type string;
105                 }
106                 leaf-list editions {
107                     type year;
108                 }
109                 leaf price {
110                     type uint64;
111                 }
112             }
113         }
114     }
115 }