sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
sangho | 0c2a3da | 2016-02-16 13:39:07 +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 | */ |
sangho | 93447f1 | 2016-02-24 00:33:22 +0900 | [diff] [blame] | 16 | package org.onosproject.openstackinterface; |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 17 | |
Daniel Park | a26f265 | 2016-09-08 16:48:26 +0900 | [diff] [blame] | 18 | import org.onlab.packet.Ip4Address; |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 19 | import org.onosproject.net.Port; |
| 20 | |
| 21 | import java.util.Collection; |
Daniel Park | a26f265 | 2016-09-08 16:48:26 +0900 | [diff] [blame] | 22 | import java.util.Optional; |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * Handles port management REST API from Openstack for VMs. |
| 26 | */ |
sangho | 93447f1 | 2016-02-24 00:33:22 +0900 | [diff] [blame] | 27 | public interface OpenstackInterfaceService { |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 28 | |
| 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 Park | a26f265 | 2016-09-08 16:48:26 +0900 | [diff] [blame] | 54 | * @param portId port id |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 55 | * @return port information |
| 56 | */ |
| 57 | OpenstackPort port(String portId); |
| 58 | |
| 59 | /** |
| 60 | * Returns network information list for the network ID given. |
| 61 | * |
Daniel Park | a26f265 | 2016-09-08 16:48:26 +0900 | [diff] [blame] | 62 | * @param networkId network id |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 63 | * @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 Park | a26f265 | 2016-09-08 16:48:26 +0900 | [diff] [blame] | 77 | * @param subnetId subnet id |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 78 | * @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 Park | a26f265 | 2016-09-08 16:48:26 +0900 | [diff] [blame] | 99 | * @param routerId router id |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 100 | * @return router information |
| 101 | */ |
| 102 | OpenstackRouter router(String routerId); |
| 103 | |
| 104 | /** |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 105 | * Returns Security Group information of the security groupd id given. |
| 106 | * |
| 107 | * @param id security group id |
| 108 | * @return security group information |
| 109 | */ |
sangho | d177f8f | 2016-06-29 21:52:23 +0900 | [diff] [blame] | 110 | 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 Park | a26f265 | 2016-09-08 16:48:26 +0900 | [diff] [blame] | 119 | /** |
| 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 | |
sangho | d177f8f | 2016-06-29 21:52:23 +0900 | [diff] [blame] | 129 | |
sangho | 0c2a3da | 2016-02-16 13:39:07 +0900 | [diff] [blame] | 130 | |
| 131 | } |