blob: a8fbf3431b35ce263ebb89b533355ce93b629002 [file] [log] [blame]
Jian Li3e81b182021-01-11 02:35:06 +09001/*
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 */
16package org.onosproject.kubevirtnetworking.api;
17
Jian Lid5e8ea82021-01-18 00:19:31 +090018import org.onlab.packet.IpAddress;
19
Jian Li3e81b182021-01-11 02:35:06 +090020public 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 Lid5e8ea82021-01-18 00:19:31 +090043 /**
44 * Allocate an IP address.
45 *
46 * @param networkId network identifier
47 * @return IP address
48 */
49 IpAddress allocateIp(String networkId);
50
51 /**
Jian Li2417ab72021-02-02 17:35:12 +090052 * 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 Lid5e8ea82021-01-18 00:19:31 +090061 * 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 Li3e81b182021-01-11 02:35:06 +090068 void clear();
69}