Updated demo scripts: the demo now outputs per-protocol information.
[affinity.git] / nfchain / api / src / main / yang / nfchain.yang
1 module nfchain { 
2     namespace "urn:opendaylight:affinity:nfchain";
3     prefix nfchain;
4
5     import ietf-inet-types { prefix inet; }
6     import ietf-yang-types { prefix yang; }
7     import yang-ext { prefix ext; }
8     import opendaylight-inventory {prefix inv;}
9     import opendaylight-l2-types { prefix l2types; }
10     import opendaylight-flow-types { prefix flow-types; }
11
12     revision "2013-10-20" {
13         description "Initial revision of affinity model to be reviewed";
14     }
15
16    //**************************************************
17     // Gateway hosting the network function. 
18     //**************************************************
19     grouping gateway {
20         leaf id {
21             type string;
22         }
23         // xxx address is an IP prefix.
24         leaf location {
25             description "Inet address";
26             type inet:ipv4-prefix;
27         }
28     }
29
30     // Each nf chain has an id, a flowspec and a list of gateways. 
31     grouping chain {
32         leaf name {
33             type string;
34         }
35
36         list flow {
37             uses flow-types:flow;
38         }
39         
40         list gateway {
41             key id;
42             ext:context-instance "gateway-context";
43             uses gateway;
44         }
45     }   
46
47     // Container for all nf_chain objects
48     container nfdb {
49         list chain {
50             key id;
51             ext:context-instance "chain-context";
52             uses chain;
53         }
54     }
55
56     identity gateway-context;
57
58     typedef gateway-ref {
59         type instance-identifier;
60     }
61
62     // nf chain reference.
63     typedef chain-ref {
64         type instance-identifier;
65     }
66     identity chain-context;
67
68     //**************************************************
69     // Add a chain to the service.
70     //**************************************************
71     rpc addchain {
72         input {
73               container chain {
74                   uses chain;
75               }
76         }
77     }
78
79     rpc enablechain {
80         input {
81             leaf chain {
82                 type chain-ref;
83             }
84         }
85     }
86     
87 }