Fixing issues with idmanager
[vpnservice.git] / interfacemgr / interfacemgr-api / src / main / yang / odl-interface-rpc.yang
1 module odl-interface-rpc {
2     namespace "urn:opendaylight:vpnservice:interfacemgr:rpcs";
3     prefix "odlifrpc";
4
5     import ietf-inet-types {
6         prefix inet;
7     }
8
9     import odl-interface {
10         prefix odlif; revision-date 2015-03-31;
11     }
12
13     import opendaylight-inventory {
14         prefix inv; revision-date 2013-08-19;
15     }
16
17     import ietf-interfaces {
18         prefix if; revision-date 2014-05-08;
19     }
20
21     import opendaylight-action-types {prefix action;}
22     import opendaylight-flow-types {prefix offlow;revision-date "2013-10-26";}
23
24     revision "2015-10-03" {
25         description "ODL Specific Interface Manager Rpcs Module";
26     }
27
28     /* RPCs */
29
30     rpc get-dpid-from-interface {
31         description "used to retrieve dpid from interface name";
32         input {
33             leaf intf-name {
34                 type string;
35             }
36         }
37         output {
38             leaf dpid {
39                 type uint64;
40             }
41         }
42     }
43
44     rpc get-port-from-interface {
45         description "used to retrieve dpid from interface name";
46         input {
47             leaf intf-name {
48                 type string;
49             }
50         }
51         output {
52             leaf dpid {
53                 type uint64;
54             }
55             leaf portno {
56                 type uint32;
57             }
58             leaf portname {
59                 type string;
60             }
61         }
62     }
63
64     rpc get-egress-actions-for-interface {
65         description "used to retrieve group actions to use from interface name";
66         input {
67             leaf intf-name {
68                 type string;
69             }
70         }
71         output {
72             uses action:action-list;
73         }
74     }
75
76     rpc get-egress-instructions-for-interface {
77         description "used to retrieve flow instructions to use from interface name";
78         input {
79             leaf intf-name {
80                 type string;
81             }
82         }
83         output {
84             uses offlow:instruction-list;
85         }
86     }
87
88     rpc get-endpoint-ip-for-dpn {
89         description "to get the local ip of the tunnel/trunk interface";
90         input {
91             leaf dpid {
92                 type uint64;
93             }
94         }
95         output {
96             leaf-list local-ips {
97                 type inet:ip-address;
98             }
99         }
100     }
101
102     rpc get-interface-type {
103     description "to get the type of the interface(vlan/vxlan or gre)";
104         input {
105             leaf intf-name {
106                 type string;
107             }
108         }
109         output {
110             leaf interface-type {
111                 type identityref {
112                     base if:interface-type;
113                 }
114             }
115         }
116     }
117
118     rpc get-nodeconnector-id-from-interface {
119     description "to get nodeconnector id associated with an interface";
120         input {
121             leaf intf-name {
122                 type string;
123             }
124         }
125         output {
126             leaf nodeconnector-id {
127                 type inv:node-connector-id;
128             }
129         }
130     }
131
132     rpc get-interface-from-if-index {
133         description "to get interface associated with an if-index";
134             input {
135                 leaf if-index {
136                     type int32;
137                 }
138             }
139             output {
140                 leaf interface-name {
141                     type string;
142                 }
143             }
144         }
145 }