Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.openstacknetworking.api; |
| 17 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onlab.packet.MacAddress; |
| 20 | import org.onosproject.event.ListenerService; |
Jian Li | 6343020 | 2018-08-30 16:24:09 +0900 | [diff] [blame] | 21 | import org.onosproject.net.DeviceId; |
| 22 | import org.onosproject.net.PortNumber; |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 23 | |
| 24 | import java.util.Set; |
| 25 | |
| 26 | /** |
| 27 | * Service for interacting with the inventory of instance ports. |
| 28 | */ |
| 29 | public interface InstancePortService |
| 30 | extends ListenerService<InstancePortEvent, InstancePortListener> { |
| 31 | |
| 32 | /** |
| 33 | * Returns instance port with the given MAC address. |
| 34 | * |
| 35 | * @param macAddress mac address |
| 36 | * @return instance port; null if not found |
| 37 | */ |
| 38 | InstancePort instancePort(MacAddress macAddress); |
| 39 | |
| 40 | /** |
| 41 | * Returns instance port with the given IP address in the given OpenStack network. |
| 42 | * |
| 43 | * @param ipAddress ip address |
| 44 | * @param osNetId openstack network id |
| 45 | * @return instance port; null if not found |
| 46 | */ |
| 47 | InstancePort instancePort(IpAddress ipAddress, String osNetId); |
| 48 | |
| 49 | /** |
| 50 | * Returns instance port with the given openstack port ID. |
| 51 | * |
| 52 | * @param osPortId openstack port id |
| 53 | * @return instance port; null if not found |
| 54 | */ |
| 55 | InstancePort instancePort(String osPortId); |
| 56 | |
| 57 | /** |
Jian Li | 6343020 | 2018-08-30 16:24:09 +0900 | [diff] [blame] | 58 | * Returns instance port with the given device identifier and port number. |
| 59 | * |
| 60 | * @param deviceId device identifier |
| 61 | * @param portNumber port number |
| 62 | * @return instance port; null if not found |
| 63 | */ |
| 64 | InstancePort instancePort(DeviceId deviceId, PortNumber portNumber); |
| 65 | |
| 66 | /** |
Daniel Park | 4fa1f5e | 2018-10-17 12:41:52 +0900 | [diff] [blame] | 67 | * Returns instance ports with the given device identifier. |
| 68 | * |
| 69 | * @param deviceId device identifier |
| 70 | * @return set of instance ports; empty list if no port exists |
| 71 | */ |
| 72 | Set<InstancePort> instancePort(DeviceId deviceId); |
| 73 | |
| 74 | /** |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 75 | * Returns all instance ports. |
| 76 | * |
| 77 | * @return set of instance ports; empty list if no port exists |
| 78 | */ |
| 79 | Set<InstancePort> instancePorts(); |
| 80 | |
| 81 | /** |
| 82 | * Returns instance ports in the given OpenStack network. |
| 83 | * |
| 84 | * @param osNetId openstack network |
| 85 | * @return set of instance ports; empty list if no port exists |
| 86 | */ |
| 87 | Set<InstancePort> instancePorts(String osNetId); |
Jian Li | c38e903 | 2018-08-09 17:08:38 +0900 | [diff] [blame] | 88 | |
| 89 | /** |
| 90 | * Returns the floating IP with the supplied instance port. |
| 91 | * |
| 92 | * @param osPortId openstack port id |
| 93 | * @return openstack floating IP |
| 94 | */ |
| 95 | IpAddress floatingIp(String osPortId); |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 96 | } |