BUG-5574: sal-flows-batch proposal
[openflowplugin.git] / model / model-flow-service / src / main / yang / sal-flows-batch.yang
1 module sal-flows-batch {
2     namespace "urn:opendaylight:flows:service";
3     prefix flows;
4
5     import barrier-common {prefix bc;revision-date "2016-03-15";}
6     import batch-common {prefix batch;revision-date "2016-03-22";}
7     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
8     import opendaylight-flow-types {prefix types;revision-date "2013-10-26";}
9     import flow-node-inventory {prefix flow-inv; revision-date "2013-08-19";}
10
11     description "Openflow batch flow management.";
12
13     revision "2016-03-14" {
14         description "Initial revision of batch flow service";
15     }
16
17     grouping batch-flow-id-grouping {
18         description "General flow-id leaf.";
19
20         leaf flow-id {
21             type flow-inv:flow-id;
22         }
23     }
24
25     grouping batch-flow-input-grouping {
26         description "Openflow flow structure suitable for batch rpc input.";
27
28         uses batch-flow-id-grouping;
29         uses types:flow;
30     }
31
32     grouping batch-flow-input-update-grouping {
33         description "Openflow flow structure suitable for batch rpc input.";
34
35         uses batch-flow-id-grouping;
36         container original-batched-flow {
37             uses types:flow;
38         }
39         container updated-batched-flow {
40             uses types:flow;
41         }
42     }
43
44     grouping batch-flow-output-list-grouping {
45         description "Openflow flow list suitable for batch rpc output.";
46
47          list batch-failed-flows-output {
48             key batch-order;
49
50             uses batch:batch-order-grouping;
51             uses batch-flow-id-grouping;
52          }
53     }
54
55
56     rpc add-flows-batch {
57         description "Batch adding flows to openflow device.";
58         input {
59             uses "inv:node-context-ref";
60
61             list batch-add-flows {
62                 key flow-id;
63                 uses batch-flow-input-grouping;
64             }
65             uses bc:barrier-suffix;
66         }
67         output {
68             uses batch-flow-output-list-grouping;
69         }
70     }
71
72     rpc remove-flows-batch {
73         description "Batch removing flows from openflow device.";
74         input {
75             uses "inv:node-context-ref";
76
77             list batch-remove-flows {
78                 key flow-id;
79                 uses batch-flow-input-grouping;
80             }
81             uses bc:barrier-suffix;
82         }
83         output {
84             uses batch-flow-output-list-grouping;
85         }
86     }
87
88     rpc update-flows-batch {
89         description "Batch updating flows on openflow device.";
90         input {
91             uses "inv:node-context-ref";
92
93             list batch-update-flows {
94                 key flow-id;
95                 uses batch-flow-input-update-grouping;
96             }
97             uses bc:barrier-suffix;
98         }
99         output {
100             uses batch-flow-output-list-grouping;
101         }
102     }
103 }