blob: 1ed4f6f6f55e8b0ea646a7a38436350d654f4757 [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 *
37 */
sanghoshin65723ae2015-11-17 22:07:21 +090038 void deletePort(String uuid);
sanghoshin94872a12015-10-16 18:04:34 +090039
40 /**
41 * Updates flow rules corresponding to the port information updated by Openstack.
42 *
sanghoshin65723ae2015-11-17 22:07:21 +090043 * @param openstackPort
sanghoshin94872a12015-10-16 18:04:34 +090044 */
sanghoshin65723ae2015-11-17 22:07:21 +090045 void updatePort(OpenstackPort openstackPort);
sanghoshin94872a12015-10-16 18:04:34 +090046
47 /**
sanghoshin46297d22015-11-03 17:51:24 +090048 * Stores the network information created by openstack.
sanghoshin94872a12015-10-16 18:04:34 +090049 *
50 * @param openstackNetwork network information
51 */
52 void createNetwork(OpenstackNetwork openstackNetwork);
53
danielbb83ebc2015-10-29 15:13:06 +090054 /**
sanghoshin46297d22015-11-03 17:51:24 +090055 * Stores the subnet information created by openstack.
danielbb83ebc2015-10-29 15:13:06 +090056 *
57 * @param openstackSubnet subnet information
58 */
59 void createSubnet(OpenstackSubnet openstackSubnet);
sanghoshin46297d22015-11-03 17:51:24 +090060
61 /**
62 * Returns port information list for the network ID given.
63 *
64 * @param networkId Network ID of the ports
65 * @return port information list
66 */
67 Collection<OpenstackPort> ports(String networkId);
68
69 /**
sanghoshinf25d2e02015-11-11 23:07:17 +090070 * Returns port information for the port given.
71 *
72 * @param port port reference
73 * @return port information
74 */
75 OpenstackPort port(Port port);
76
77 /**
sanghoshin46297d22015-11-03 17:51:24 +090078 * Returns port information for the port ID given.
79 *
80 * @param portId Port ID
81 * @return port information
82 */
83 OpenstackPort port(String portId);
84
85 /**
86 * Returns network information list for the network ID given.
87 *
88 * @param networkId Network ID
sanghoshinf4ffb942015-12-10 11:28:24 +090089 * @return network information list, or null if not present
sanghoshin46297d22015-11-03 17:51:24 +090090 */
91 OpenstackNetwork network(String networkId);
92
sanghoshinf4ffb942015-12-10 11:28:24 +090093
94 /**
95 * Returns subnet information for the subnet ID give.
96 *
97 * @param subnetId Subnet ID
98 * @return subnet information, or null if not present
99 */
100 OpenstackSubnet subnet(String subnetId);
sanghoshin94872a12015-10-16 18:04:34 +0900101}