blob: 051bb5fb93dbd961a877e47c3a230efc2c967347 [file] [log] [blame]
sangho0c2a3da2016-02-16 13:39:07 +09001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
sangho0c2a3da2016-02-16 13:39:07 +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 */
sangho93447f12016-02-24 00:33:22 +090016package org.onosproject.openstackinterface;
sangho0c2a3da2016-02-16 13:39:07 +090017
Daniel Parka26f2652016-09-08 16:48:26 +090018import org.onlab.packet.Ip4Address;
sangho0c2a3da2016-02-16 13:39:07 +090019import org.onosproject.net.Port;
20
21import java.util.Collection;
Daniel Parka26f2652016-09-08 16:48:26 +090022import java.util.Optional;
sangho0c2a3da2016-02-16 13:39:07 +090023
24/**
25 * Handles port management REST API from Openstack for VMs.
26 */
sangho93447f12016-02-24 00:33:22 +090027public interface OpenstackInterfaceService {
sangho0c2a3da2016-02-16 13:39:07 +090028
29 /**
30 * Returns port information list for the network ID given.
31 *
32 * @param networkId Network ID of the ports
33 * @return port information list
34 */
35 Collection<OpenstackPort> ports(String networkId);
36
37 /**
38 * Returns port information list.
39 *
40 * @return port information list
41 */
42 Collection<OpenstackPort> ports();
43 /**
44 * Returns port information for the port given.
45 *
46 * @param port port reference
47 * @return port information
48 */
49 OpenstackPort port(Port port);
50
51 /**
52 * Returns port information for the port ID given.
53 *
Daniel Parka26f2652016-09-08 16:48:26 +090054 * @param portId port id
sangho0c2a3da2016-02-16 13:39:07 +090055 * @return port information
56 */
57 OpenstackPort port(String portId);
58
59 /**
60 * Returns network information list for the network ID given.
61 *
Daniel Parka26f2652016-09-08 16:48:26 +090062 * @param networkId network id
sangho0c2a3da2016-02-16 13:39:07 +090063 * @return network information, or null if not present
64 */
65 OpenstackNetwork network(String networkId);
66
67 /**
68 * Returns the information of all openstack networks.
69 *
70 * @return collection of network information
71 */
72 Collection<OpenstackNetwork> networks();
73
74 /**
75 * Returns subnet information for the subnet ID give.
76 *
Daniel Parka26f2652016-09-08 16:48:26 +090077 * @param subnetId subnet id
sangho0c2a3da2016-02-16 13:39:07 +090078 * @return subnet information, or null if not present
79 */
80 OpenstackSubnet subnet(String subnetId);
81
82 /**
83 * Returns collection of openstack subnet information.
84 *
85 * @return collection of openststack subnet information
86 */
87 Collection<OpenstackSubnet> subnets();
88
89 /**
90 * Returns the router information list.
91 *
92 * @return router information list
93 */
94 Collection<OpenstackRouter> routers();
95
96 /**
97 * Returns the router information for the router ID given.
98 *
Daniel Parka26f2652016-09-08 16:48:26 +090099 * @param routerId router id
sangho0c2a3da2016-02-16 13:39:07 +0900100 * @return router information
101 */
102 OpenstackRouter router(String routerId);
103
104 /**
sangho0c2a3da2016-02-16 13:39:07 +0900105 * Returns Security Group information of the security groupd id given.
106 *
107 * @param id security group id
108 * @return security group information
109 */
sanghod177f8f2016-06-29 21:52:23 +0900110 OpenstackSecurityGroup securityGroup(String id);
111
112 /**
113 * Returns collection of OpenStack floating IP information.
114 *
115 * @return collection of OpenStack floating IP information
116 */
117 Collection<OpenstackFloatingIP> floatingIps();
118
Daniel Parka26f2652016-09-08 16:48:26 +0900119 /**
120 * Updates a floating IP and its association with an internal port.
121 *
122 * @param id floating ip id
123 * @param portId port id
124 * @param fixedIpAddress fixed ip address of the port
125 * @return true if the update succeed
126 */
127 boolean updateFloatingIp(String id, String portId, Optional<Ip4Address> fixedIpAddress);
128
sanghod177f8f2016-06-29 21:52:23 +0900129
sangho0c2a3da2016-02-16 13:39:07 +0900130
131}