Jian Li | 8fe714d | 2021-01-11 02:35:06 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021-present Open Networking Foundation |
| 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.kubevirtnetworking.api; |
| 17 | |
Jian Li | ca20b71 | 2021-01-18 00:19:31 +0900 | [diff] [blame] | 18 | import org.onlab.packet.IpAddress; |
| 19 | |
Jian Li | 8fe714d | 2021-01-11 02:35:06 +0900 | [diff] [blame] | 20 | public interface KubevirtNetworkAdminService extends KubevirtNetworkService { |
| 21 | |
| 22 | /** |
| 23 | * Creates a kubevirt network with the given information. |
| 24 | * |
| 25 | * @param network the new network |
| 26 | */ |
| 27 | void createNetwork(KubevirtNetwork network); |
| 28 | |
| 29 | /** |
| 30 | * Updates the kubevirt network with the given information. |
| 31 | * |
| 32 | * @param network the updated network |
| 33 | */ |
| 34 | void updateNetwork(KubevirtNetwork network); |
| 35 | |
| 36 | /** |
| 37 | * Removes the network. |
| 38 | * |
| 39 | * @param networkId network identifier |
| 40 | */ |
| 41 | void removeNetwork(String networkId); |
| 42 | |
Jian Li | ca20b71 | 2021-01-18 00:19:31 +0900 | [diff] [blame] | 43 | /** |
| 44 | * Allocate an IP address. |
| 45 | * |
| 46 | * @param networkId network identifier |
| 47 | * @return IP address |
| 48 | */ |
| 49 | IpAddress allocateIp(String networkId); |
| 50 | |
| 51 | /** |
Jian Li | 7a581b1 | 2021-02-18 14:24:32 +0900 | [diff] [blame^] | 52 | * Reserve the given IP address. |
| 53 | * |
| 54 | * @param networkId network identifier |
| 55 | * @param ip IP address to be reserved |
| 56 | * @return reserve result |
| 57 | */ |
| 58 | boolean reserveIp(String networkId, IpAddress ip); |
| 59 | |
| 60 | /** |
Jian Li | ca20b71 | 2021-01-18 00:19:31 +0900 | [diff] [blame] | 61 | * Release the existing IP address. |
| 62 | * |
| 63 | * @param networkId network identifier |
| 64 | * @param ip IP address to be released |
| 65 | */ |
| 66 | void releaseIp(String networkId, IpAddress ip); |
| 67 | |
Jian Li | 8fe714d | 2021-01-11 02:35:06 +0900 | [diff] [blame] | 68 | void clear(); |
| 69 | } |