blob: f879d2b800553a4630ebf29a18f6d447b7bf605e [file] [log] [blame]
Jian Li073f1ba2021-02-28 03:50:15 +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
18import org.onlab.packet.IpAddress;
19
20/**
21 * Representation of floating IP address.
22 */
23public interface KubevirtFloatingIp {
24
25 /**
26 * Returns the floating IP identifier.
27 *
28 * @return floating IP identifier
29 */
30 String id();
31
32 /**
33 * Returns the name of router where the floating IP is associated.
34 *
35 * @return name of router
36 */
37 String routerName();
38
39 /**
40 * Returns the floating IP address.
41 *
42 * @return floating IP address
43 */
44 IpAddress floatingIp();
45
46 /**
47 * Returns the fixed IP address.
48 *
49 * @return fixed IP address
50 */
51 IpAddress fixedIp();
52
53 /**
54 * Returns the name of POD where this floating IP is associated with.
55 *
56 * @return POD name
57 */
58 String podName();
59
60 /**
61 * Updates the kubevirt floating IP with the supplied fixed IP address.
62 *
63 * @param ip fixed IP address
64 * @return kubevirt floating IP
65 */
66 KubevirtFloatingIp updateFixedIp(IpAddress ip);
67
68 /**
69 * Updates the kubevirt floating IP with the supplied pod Name.
70 *
71 * @param name POD name
72 * @return kubevirt floating IP
73 */
74 KubevirtFloatingIp updatePodName(String name);
75
76 interface Builder {
77 /**
78 * Builds an immutable floaing IP instance.
79 *
80 * @return kubevirt floating IP
81 */
82 KubevirtFloatingIp build();
83
84 /**
85 * Returns kubevirt floating IP builder with supplied identifier.
86 *
87 * @param id floating IP identifier
88 * @return floating IP builder
89 */
90 Builder id(String id);
91
92 /**
93 * Returns kubevirt floating IP builder with supplied router name.
94 *
95 * @param name router name
96 * @return floating IP builder
97 */
98 Builder routerName(String name);
99
100 /**
101 * Returns kubevirt floating IP builder with supplied floating IP address.
102 *
103 * @param ip floating IP address
104 * @return floating IP builder
105 */
106 Builder floatingIp(IpAddress ip);
107
108 /**
109 * Returns kubevirt floating IP builder with supplied fixed IP address.
110 *
111 * @param ip fixed IP address
112 * @return floating IP builder
113 */
114 Builder fixedIp(IpAddress ip);
115
116 /**
117 * Returns kubevirt floating IP builder with supplied POD name.
118 *
119 * @param name POD name
120 * @return floating IP builder
121 */
122 Builder podName(String name);
123 }
124}