blob: f81ddaef9156e7e1b405bfd6c8cbb7af32a8a407 [file] [log] [blame]
sanghoshin94872a12015-10-16 18:04:34 +09001/*
Daniel Park3a06c522016-01-28 20:51:12 +09002 * Copyright 2015-2016 Open Networking Laboratory
sanghoshin94872a12015-10-16 18:04:34 +09003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.openstackswitching;
17
sanghoshinf25d2e02015-11-11 23:07:17 +090018import org.onosproject.net.Port;
Daniel Park3a06c522016-01-28 20:51:12 +090019import org.onosproject.openstackrouting.OpenstackRouter;
20import org.onosproject.openstackrouting.OpenstackRouterInterface;
sanghoshinf25d2e02015-11-11 23:07:17 +090021
sanghoshin46297d22015-11-03 17:51:24 +090022import java.util.Collection;
23
sanghoshin94872a12015-10-16 18:04:34 +090024/**
sanghoshin46297d22015-11-03 17:51:24 +090025 * Handles port management REST API from Openstack for VMs.
sanghoshin94872a12015-10-16 18:04:34 +090026 */
27public interface OpenstackSwitchingService {
28
29 /**
30 * Store the port information created by Openstack.
31 *
32 * @param openstackPort port information
33 */
34 void createPorts(OpenstackPort openstackPort);
35
36 /**
37 * Removes flow rules corresponding to the port removed by Openstack.
38 *
Jian Lidfba7392016-01-22 16:46:58 -080039 * @param uuid UUID
sanghoshin94872a12015-10-16 18:04:34 +090040 */
sanghoshin65723ae2015-11-17 22:07:21 +090041 void deletePort(String uuid);
sanghoshin94872a12015-10-16 18:04:34 +090042
43 /**
44 * Updates flow rules corresponding to the port information updated by Openstack.
45 *
Jian Lidfba7392016-01-22 16:46:58 -080046 * @param openstackPort OpenStack port
sanghoshin94872a12015-10-16 18:04:34 +090047 */
sanghoshin65723ae2015-11-17 22:07:21 +090048 void updatePort(OpenstackPort openstackPort);
sanghoshin94872a12015-10-16 18:04:34 +090049
50 /**
sanghoshin46297d22015-11-03 17:51:24 +090051 * Stores the network information created by openstack.
sanghoshin94872a12015-10-16 18:04:34 +090052 *
53 * @param openstackNetwork network information
54 */
55 void createNetwork(OpenstackNetwork openstackNetwork);
56
danielbb83ebc2015-10-29 15:13:06 +090057 /**
sanghoshin46297d22015-11-03 17:51:24 +090058 * Stores the subnet information created by openstack.
danielbb83ebc2015-10-29 15:13:06 +090059 *
60 * @param openstackSubnet subnet information
61 */
62 void createSubnet(OpenstackSubnet openstackSubnet);
sanghoshin46297d22015-11-03 17:51:24 +090063
64 /**
65 * Returns port information list for the network ID given.
66 *
67 * @param networkId Network ID of the ports
68 * @return port information list
69 */
70 Collection<OpenstackPort> ports(String networkId);
71
72 /**
Daniel Park3a06c522016-01-28 20:51:12 +090073 * Returns port information list.
74 *
75 * @return port information list
76 */
77 Collection<OpenstackPort> ports();
78 /**
sanghoshinf25d2e02015-11-11 23:07:17 +090079 * Returns port information for the port given.
80 *
81 * @param port port reference
82 * @return port information
83 */
84 OpenstackPort port(Port port);
85
86 /**
sanghoshin46297d22015-11-03 17:51:24 +090087 * Returns port information for the port ID given.
88 *
89 * @param portId Port ID
90 * @return port information
91 */
92 OpenstackPort port(String portId);
93
94 /**
95 * Returns network information list for the network ID given.
96 *
97 * @param networkId Network ID
sanghoshinf4ffb942015-12-10 11:28:24 +090098 * @return network information list, or null if not present
sanghoshin46297d22015-11-03 17:51:24 +090099 */
100 OpenstackNetwork network(String networkId);
101
sanghoshinf4ffb942015-12-10 11:28:24 +0900102
103 /**
104 * Returns subnet information for the subnet ID give.
105 *
106 * @param subnetId Subnet ID
107 * @return subnet information, or null if not present
108 */
109 OpenstackSubnet subnet(String subnetId);
Daniel Park3a06c522016-01-28 20:51:12 +0900110
111 /**
112 * Sends the created router information to OpenstackRouting service.
113 *
114 * @param openstackRouter Router Information
115 */
116 void createRouter(OpenstackRouter openstackRouter);
117 /**
118 * Sends the updated router information to OpenstackRouting service.
119 *
120 * @param routerId Router ID
121 */
122 void updateRouter(String routerId);
123 /**
124 * Sends the removed router information to OpenstackRouting service.
125 *
126 * @param routerId Router ID
127 */
128 void deleteRouter(String routerId);
129
130 /**
131 * Sends the updated router interface information to OpenstackRouting service.
132 *
133 * @param openstackRouterInterface Router interface information
134 */
135 void updateRouterInterface(OpenstackRouterInterface openstackRouterInterface);
136
137 /**
138 * Sends the removed router interface information to OpenstackRouting service.
139 *
140 * @param openstackRouterInterface Router interface information
141 */
142 void removeRouterInterface(OpenstackRouterInterface openstackRouterInterface);
143
144 /**
145 * Returns the router information list.
146 *
147 * @return router information list
148 */
149 Collection<OpenstackRouter> routers();
150
151 /**
152 * Returns the router information for the router ID given.
153 *
154 * @param routerId router ID
155 * @return router information
156 */
157 OpenstackRouter router(String routerId);
158
159 /**
160 * Returns the OpensatckPortInfo list.
161 *
162 * @return OpensatckPortInfo list
163 */
164 Collection<OpenstackPortInfo> portInfos();
165
166 /**
167 * Returns the MacAddress for physical router.
168 *
169 * @return physical router mac
170 */
171 String physicalRouterMac();
172
173
sanghoshin94872a12015-10-16 18:04:34 +0900174}