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 | |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onlab.packet.MacAddress; |
| 20 | import org.onlab.packet.VlanId; |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 21 | import org.onosproject.event.ListenerService; |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 22 | import org.openstack4j.model.network.ExternalGateway; |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 23 | import org.openstack4j.model.network.Network; |
| 24 | import org.openstack4j.model.network.Port; |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 25 | import org.openstack4j.model.network.Router; |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 26 | import org.openstack4j.model.network.Subnet; |
| 27 | |
| 28 | import java.util.Set; |
| 29 | |
| 30 | /** |
| 31 | * Service for interacting with the inventory of OpenStack network and port. |
| 32 | */ |
| 33 | public interface OpenstackNetworkService |
| 34 | extends ListenerService<OpenstackNetworkEvent, OpenstackNetworkListener> { |
| 35 | /** |
| 36 | * Returns the network with the supplied network ID. |
| 37 | * |
| 38 | * @param networkId network id |
| 39 | * @return openstack network |
| 40 | */ |
| 41 | Network network(String networkId); |
| 42 | |
| 43 | /** |
| 44 | * Returns all networks registered in the service. |
| 45 | * |
| 46 | * @return set of networks |
| 47 | */ |
| 48 | Set<Network> networks(); |
| 49 | |
| 50 | /** |
| 51 | * Returns the subnet with the supplied subnet ID. |
| 52 | * |
| 53 | * @param subnetId subnet id |
| 54 | * @return subnet |
| 55 | */ |
| 56 | Subnet subnet(String subnetId); |
| 57 | |
| 58 | /** |
| 59 | * Returns all subnets registered in the service. |
| 60 | * |
| 61 | * @return set of subnet |
| 62 | */ |
| 63 | Set<Subnet> subnets(); |
| 64 | |
| 65 | /** |
| 66 | * Returns all subnets associated with the supplied network. |
| 67 | * |
| 68 | * @param networkId network id |
| 69 | * @return set of subnet |
| 70 | */ |
| 71 | Set<Subnet> subnets(String networkId); |
| 72 | |
| 73 | /** |
| 74 | * Returns the OpenStack port with the supplied port ID. |
| 75 | * |
| 76 | * @param portId openstack port id |
| 77 | * @return openstack port |
| 78 | */ |
| 79 | Port port(String portId); |
| 80 | |
| 81 | /** |
| 82 | * Returns the OpenStack port with the supplied ONOS port. |
| 83 | * |
| 84 | * @param port onos port |
| 85 | * @return openstack port |
| 86 | */ |
| 87 | Port port(org.onosproject.net.Port port); |
| 88 | |
| 89 | /** |
| 90 | * Returns all OpenStack ports registered in the service. |
| 91 | * |
| 92 | * @return set of ports |
| 93 | */ |
| 94 | Set<Port> ports(); |
| 95 | |
| 96 | /** |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 97 | * Returns all OpenStack ports associated with supplied network. |
| 98 | * |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 99 | * @param networkId network id |
| 100 | * @return set of ports |
| 101 | */ |
| 102 | Set<Port> ports(String networkId); |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 103 | |
| 104 | /** |
| 105 | * Derives external router mac address with supplied external gateway. |
| 106 | * |
| 107 | * @param externalGateway external gateway information |
| 108 | * @param router router which owns externalGateway |
| 109 | */ |
| 110 | void deriveExternalPeerRouterMac(ExternalGateway externalGateway, Router router); |
| 111 | |
| 112 | /** |
| 113 | * Deletes external router with supplied external gateway. |
| 114 | * |
| 115 | * @param externalGateway external gateway information |
| 116 | */ |
| 117 | void deleteExternalPeerRouter(ExternalGateway externalGateway); |
| 118 | |
| 119 | /** |
daniel park | eeb8e04 | 2018-02-21 14:06:58 +0900 | [diff] [blame] | 120 | * Deletes external router with supplied ip address. |
| 121 | * |
| 122 | * @param ipAddress ip address |
| 123 | */ |
| 124 | void deleteExternalPeerRouter(String ipAddress); |
| 125 | |
| 126 | /** |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 127 | * Updates external router mac address with supplied ip address. |
| 128 | * |
| 129 | * @param ipAddress ip address |
| 130 | * @param macAddress mac address |
| 131 | */ |
| 132 | void updateExternalPeerRouterMac(IpAddress ipAddress, MacAddress macAddress); |
| 133 | |
| 134 | /** |
| 135 | * Updates external router vlan id with supplied ip address. |
| 136 | * |
| 137 | * @param ipAddress ip address |
| 138 | * @param vlanId vlan id |
| 139 | */ |
| 140 | void updateExternalPeerRouterVlan(IpAddress ipAddress, VlanId vlanId); |
| 141 | |
| 142 | /** |
| 143 | * Updates external router ith supplied ip address, mac address, vlan id. |
| 144 | * |
| 145 | * @param ipAddress ip address |
| 146 | * @param macAddress mac address |
| 147 | * @param vlanId vlan id |
| 148 | */ |
| 149 | void updateExternalPeerRouter(IpAddress ipAddress, MacAddress macAddress, VlanId vlanId); |
| 150 | |
| 151 | /** |
| 152 | * Returns external router mac with supplied external gateway. |
| 153 | * |
| 154 | * @param externalGateway external gateway information |
| 155 | * @return mac address |
| 156 | */ |
| 157 | MacAddress externalPeerRouterMac(ExternalGateway externalGateway); |
| 158 | |
| 159 | /** |
| 160 | * Returns external peer router with supplied ip address. |
| 161 | * |
| 162 | * @param ipAddress ip address |
| 163 | * @return external peer router |
| 164 | */ |
| 165 | ExternalPeerRouter externalPeerRouter(IpAddress ipAddress); |
| 166 | |
| 167 | /** |
| 168 | * Returns external peer router list. |
| 169 | * |
| 170 | * @return external peer router list |
| 171 | */ |
| 172 | Set<ExternalPeerRouter> externalPeerRouters(); |
| 173 | |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 174 | } |