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; |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 20 | import org.onosproject.event.ListenerService; |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 21 | import org.openstack4j.model.network.ExternalGateway; |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 22 | import org.openstack4j.model.network.Network; |
| 23 | import org.openstack4j.model.network.Port; |
| 24 | import org.openstack4j.model.network.Subnet; |
| 25 | |
| 26 | import java.util.Set; |
| 27 | |
| 28 | /** |
| 29 | * Service for interacting with the inventory of OpenStack network and port. |
| 30 | */ |
| 31 | public interface OpenstackNetworkService |
| 32 | extends ListenerService<OpenstackNetworkEvent, OpenstackNetworkListener> { |
| 33 | /** |
| 34 | * Returns the network with the supplied network ID. |
| 35 | * |
| 36 | * @param networkId network id |
| 37 | * @return openstack network |
| 38 | */ |
| 39 | Network network(String networkId); |
| 40 | |
| 41 | /** |
| 42 | * Returns all networks registered in the service. |
| 43 | * |
| 44 | * @return set of networks |
| 45 | */ |
| 46 | Set<Network> networks(); |
| 47 | |
| 48 | /** |
| 49 | * Returns the subnet with the supplied subnet ID. |
| 50 | * |
| 51 | * @param subnetId subnet id |
| 52 | * @return subnet |
| 53 | */ |
| 54 | Subnet subnet(String subnetId); |
| 55 | |
| 56 | /** |
| 57 | * Returns all subnets registered in the service. |
| 58 | * |
| 59 | * @return set of subnet |
| 60 | */ |
| 61 | Set<Subnet> subnets(); |
| 62 | |
| 63 | /** |
| 64 | * Returns all subnets associated with the supplied network. |
| 65 | * |
| 66 | * @param networkId network id |
| 67 | * @return set of subnet |
| 68 | */ |
| 69 | Set<Subnet> subnets(String networkId); |
| 70 | |
| 71 | /** |
| 72 | * Returns the OpenStack port with the supplied port ID. |
| 73 | * |
| 74 | * @param portId openstack port id |
| 75 | * @return openstack port |
| 76 | */ |
| 77 | Port port(String portId); |
| 78 | |
| 79 | /** |
| 80 | * Returns the OpenStack port with the supplied ONOS port. |
| 81 | * |
| 82 | * @param port onos port |
| 83 | * @return openstack port |
| 84 | */ |
| 85 | Port port(org.onosproject.net.Port port); |
| 86 | |
| 87 | /** |
| 88 | * Returns all OpenStack ports registered in the service. |
| 89 | * |
| 90 | * @return set of ports |
| 91 | */ |
| 92 | Set<Port> ports(); |
| 93 | |
| 94 | /** |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 95 | * Returns all OpenStack ports associated with supplied network. |
| 96 | * |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 97 | * @param networkId network id |
| 98 | * @return set of ports |
| 99 | */ |
| 100 | Set<Port> ports(String networkId); |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 101 | |
| 102 | /** |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 103 | * Returns external router mac with supplied external gateway. |
| 104 | * |
| 105 | * @param externalGateway external gateway information |
| 106 | * @return mac address |
| 107 | */ |
| 108 | MacAddress externalPeerRouterMac(ExternalGateway externalGateway); |
| 109 | |
| 110 | /** |
| 111 | * Returns external peer router with supplied ip address. |
| 112 | * |
| 113 | * @param ipAddress ip address |
| 114 | * @return external peer router |
| 115 | */ |
| 116 | ExternalPeerRouter externalPeerRouter(IpAddress ipAddress); |
| 117 | |
| 118 | /** |
daniel park | 576969a | 2018-03-09 07:07:41 +0900 | [diff] [blame] | 119 | * Returns external router with supplied external gateway. |
| 120 | * |
| 121 | * @param externalGateway external gateway information |
| 122 | * @return external router |
| 123 | */ |
| 124 | ExternalPeerRouter externalPeerRouter(ExternalGateway externalGateway); |
| 125 | |
| 126 | /** |
daniel park | b581710 | 2018-02-15 00:18:51 +0900 | [diff] [blame] | 127 | * Returns external peer router list. |
| 128 | * |
| 129 | * @return external peer router list |
| 130 | */ |
| 131 | Set<ExternalPeerRouter> externalPeerRouters(); |
| 132 | |
Hyunsun Moon | 44aac66 | 2017-02-18 02:07:01 +0900 | [diff] [blame] | 133 | } |