blob: 7b192f1215165edde9171da37da76314850922d0 [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
daniel parkb5817102018-02-15 00:18:51 +090018import org.onlab.packet.IpAddress;
19import org.onlab.packet.MacAddress;
Hyunsun Moon44aac662017-02-18 02:07:01 +090020import org.onosproject.event.ListenerService;
daniel parkb5817102018-02-15 00:18:51 +090021import org.openstack4j.model.network.ExternalGateway;
Hyunsun Moon44aac662017-02-18 02:07:01 +090022import org.openstack4j.model.network.Network;
23import org.openstack4j.model.network.Port;
24import org.openstack4j.model.network.Subnet;
25
26import java.util.Set;
27
28/**
29 * Service for interacting with the inventory of OpenStack network and port.
30 */
31public 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 parkb5817102018-02-15 00:18:51 +090095 * Returns all OpenStack ports associated with supplied network.
96 *
Hyunsun Moon44aac662017-02-18 02:07:01 +090097 * @param networkId network id
98 * @return set of ports
99 */
100 Set<Port> ports(String networkId);
daniel parkb5817102018-02-15 00:18:51 +0900101
102 /**
daniel parkb5817102018-02-15 00:18:51 +0900103 * 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 park576969a2018-03-09 07:07:41 +0900119 * 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 parkb5817102018-02-15 00:18:51 +0900127 * Returns external peer router list.
128 *
129 * @return external peer router list
130 */
131 Set<ExternalPeerRouter> externalPeerRouters();
132
Hyunsun Moon44aac662017-02-18 02:07:01 +0900133}