blob: ecec1579db58de8165e0170bea1b5416d7a586e6 [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 Li70c32de2021-02-26 18:15:20 +090020/**
21 * Service for administering the inventory of kubevirt network service.
22 */
Jian Li3e81b182021-01-11 02:35:06 +090023public 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 Lid5e8ea82021-01-18 00:19:31 +090046 /**
47 * Allocate an IP address.
48 *
49 * @param networkId network identifier
50 * @return IP address
51 */
52 IpAddress allocateIp(String networkId);
53
54 /**
Jian Li2417ab72021-02-02 17:35:12 +090055 * 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 Lid5e8ea82021-01-18 00:19:31 +090064 * 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 Li3e81b182021-01-11 02:35:06 +090071 void clear();
72}