blob: 7dcbd326c1d8b1a7f74f6f70362689fc486ac57c [file] [log] [blame]
Hyunsun Moon44aac662017-02-18 02:07:01 +09001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Hyunsun Moon44aac662017-02-18 02:07:01 +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.openstacknetworking.api;
17
18import org.onlab.packet.IpAddress;
19import org.onlab.packet.MacAddress;
20import org.onosproject.event.ListenerService;
21
22import java.util.Set;
23
24/**
25 * Service for interacting with the inventory of instance ports.
26 */
27public interface InstancePortService
28 extends ListenerService<InstancePortEvent, InstancePortListener> {
29
30 /**
31 * Returns instance port with the given MAC address.
32 *
33 * @param macAddress mac address
34 * @return instance port; null if not found
35 */
36 InstancePort instancePort(MacAddress macAddress);
37
38 /**
39 * Returns instance port with the given IP address in the given OpenStack network.
40 *
41 * @param ipAddress ip address
42 * @param osNetId openstack network id
43 * @return instance port; null if not found
44 */
45 InstancePort instancePort(IpAddress ipAddress, String osNetId);
46
47 /**
48 * Returns instance port with the given openstack port ID.
49 *
50 * @param osPortId openstack port id
51 * @return instance port; null if not found
52 */
53 InstancePort instancePort(String osPortId);
54
55 /**
56 * Returns all instance ports.
57 *
58 * @return set of instance ports; empty list if no port exists
59 */
60 Set<InstancePort> instancePorts();
61
62 /**
63 * Returns instance ports in the given OpenStack network.
64 *
65 * @param osNetId openstack network
66 * @return set of instance ports; empty list if no port exists
67 */
68 Set<InstancePort> instancePorts(String osNetId);
Jian Lic38e9032018-08-09 17:08:38 +090069
70 /**
71 * Returns the floating IP with the supplied instance port.
72 *
73 * @param osPortId openstack port id
74 * @return openstack floating IP
75 */
76 IpAddress floatingIp(String osPortId);
Hyunsun Moon44aac662017-02-18 02:07:01 +090077}