blob: d9890db61d2085e732f6eb999529bc566a0ad354 [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;
Jian Li63430202018-08-30 16:24:09 +090021import org.onosproject.net.DeviceId;
22import org.onosproject.net.PortNumber;
Hyunsun Moon44aac662017-02-18 02:07:01 +090023
24import java.util.Set;
25
26/**
27 * Service for interacting with the inventory of instance ports.
28 */
29public 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 Li63430202018-08-30 16:24:09 +090058 * 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 /**
Hyunsun Moon44aac662017-02-18 02:07:01 +090067 * Returns all instance ports.
68 *
69 * @return set of instance ports; empty list if no port exists
70 */
71 Set<InstancePort> instancePorts();
72
73 /**
74 * Returns instance ports in the given OpenStack network.
75 *
76 * @param osNetId openstack network
77 * @return set of instance ports; empty list if no port exists
78 */
79 Set<InstancePort> instancePorts(String osNetId);
Jian Lic38e9032018-08-09 17:08:38 +090080
81 /**
82 * Returns the floating IP with the supplied instance port.
83 *
84 * @param osPortId openstack port id
85 * @return openstack floating IP
86 */
87 IpAddress floatingIp(String osPortId);
Hyunsun Moon44aac662017-02-18 02:07:01 +090088}