blob: bcd1d1f136022f17ac52ba7f1060d71778352f7e [file] [log] [blame]
Jian Lifc55e422019-01-21 14:39:34 +09001/*
2 * Copyright 2019-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.k8snetworking.api;
17
18import org.onlab.packet.IpAddress;
19import org.onosproject.store.Store;
20
21import java.util.Set;
22
23/**
24 * Manages inventory of instance IPAM; not intended for direct use.
25 */
26public interface K8sIpamStore extends Store<K8sIpamEvent, K8sIpamStoreDelegate> {
27
28 /**
29 * Allocates a new IP address.
30 *
31 * @param networkId network identifier
32 * @return newly allocated IP address
33 */
34 IpAddress allocateIp(String networkId);
35
36 /**
37 * Leases the existing IP address.
38 *
39 * @param networkId network identifier
40 * @return leased IP address
41 */
42 IpAddress leaseIp(String networkId);
43
44 /**
45 * Initializes a new IP pool with the given network.
46 *
47 * @param networkId network identifier
48 */
49 void initializeIpPool(String networkId);
50
51 /**
52 * Purges an existing IP pool associated with the given network.
53 *
54 * @param networkId network identifier
55 */
56 void purgeIpPool(String networkId);
57
58 /**
59 * Returns the already allocated IP addresses.
60 *
61 * @param networkId network identifier
62 * @return allocated IP addresses
63 */
64 Set<IpAddress> allocatedIps(String networkId);
65
66 /**
67 * Returns the available IP addresses.
68 *
69 * @param networkId network identifier
70 * @return available IP addresses
71 */
72 Set<IpAddress> availableIps(String networkId);
73}