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