blob: 8960dcdb7a5eeba47456eb8da074d14752f1e629 [file] [log] [blame]
sanghoshin94872a12015-10-16 18:04:34 +09001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
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;
19
sanghoshin46297d22015-11-03 17:51:24 +090020import java.util.Collection;
21
sanghoshin94872a12015-10-16 18:04:34 +090022/**
sanghoshin46297d22015-11-03 17:51:24 +090023 * Handles port management REST API from Openstack for VMs.
sanghoshin94872a12015-10-16 18:04:34 +090024 */
25public interface OpenstackSwitchingService {
26
27 /**
28 * Store the port information created by Openstack.
29 *
30 * @param openstackPort port information
31 */
32 void createPorts(OpenstackPort openstackPort);
33
34 /**
35 * Removes flow rules corresponding to the port removed by Openstack.
36 *
Jian Lidfba7392016-01-22 16:46:58 -080037 * @param uuid UUID
sanghoshin94872a12015-10-16 18:04:34 +090038 */
sanghoshin65723ae2015-11-17 22:07:21 +090039 void deletePort(String uuid);
sanghoshin94872a12015-10-16 18:04:34 +090040
41 /**
42 * Updates flow rules corresponding to the port information updated by Openstack.
43 *
Jian Lidfba7392016-01-22 16:46:58 -080044 * @param openstackPort OpenStack port
sanghoshin94872a12015-10-16 18:04:34 +090045 */
sanghoshin65723ae2015-11-17 22:07:21 +090046 void updatePort(OpenstackPort openstackPort);
sanghoshin94872a12015-10-16 18:04:34 +090047
48 /**
sanghoshin46297d22015-11-03 17:51:24 +090049 * Stores the network information created by openstack.
sanghoshin94872a12015-10-16 18:04:34 +090050 *
51 * @param openstackNetwork network information
52 */
53 void createNetwork(OpenstackNetwork openstackNetwork);
54
danielbb83ebc2015-10-29 15:13:06 +090055 /**
sanghoshin46297d22015-11-03 17:51:24 +090056 * Stores the subnet information created by openstack.
danielbb83ebc2015-10-29 15:13:06 +090057 *
58 * @param openstackSubnet subnet information
59 */
60 void createSubnet(OpenstackSubnet openstackSubnet);
sanghoshin46297d22015-11-03 17:51:24 +090061
62 /**
63 * Returns port information list for the network ID given.
64 *
65 * @param networkId Network ID of the ports
66 * @return port information list
67 */
68 Collection<OpenstackPort> ports(String networkId);
69
70 /**
sanghoshinf25d2e02015-11-11 23:07:17 +090071 * Returns port information for the port given.
72 *
73 * @param port port reference
74 * @return port information
75 */
76 OpenstackPort port(Port port);
77
78 /**
sanghoshin46297d22015-11-03 17:51:24 +090079 * Returns port information for the port ID given.
80 *
81 * @param portId Port ID
82 * @return port information
83 */
84 OpenstackPort port(String portId);
85
86 /**
87 * Returns network information list for the network ID given.
88 *
89 * @param networkId Network ID
sanghoshinf4ffb942015-12-10 11:28:24 +090090 * @return network information list, or null if not present
sanghoshin46297d22015-11-03 17:51:24 +090091 */
92 OpenstackNetwork network(String networkId);
93
sanghoshinf4ffb942015-12-10 11:28:24 +090094
95 /**
96 * Returns subnet information for the subnet ID give.
97 *
98 * @param subnetId Subnet ID
99 * @return subnet information, or null if not present
100 */
101 OpenstackSubnet subnet(String subnetId);
sanghoshin94872a12015-10-16 18:04:34 +0900102}