Jian Li | 58b3398 | 2020-07-01 19:07:02 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020-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.k8snode.api; |
| 17 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onlab.packet.MacAddress; |
| 20 | |
| 21 | /** |
| 22 | * Representation of an external network. |
| 23 | */ |
| 24 | public interface K8sExternalNetwork { |
| 25 | |
| 26 | /** |
| 27 | * Returns the external bridge's IP address. |
| 28 | * |
| 29 | * @return IP address; null if the IP address does not exist |
| 30 | */ |
| 31 | IpAddress extBridgeIp(); |
| 32 | |
| 33 | /** |
| 34 | * Returns the external gateway IP address. |
| 35 | * |
| 36 | * @return IP address; null if the IP address does not exist |
| 37 | */ |
| 38 | IpAddress extGatewayIp(); |
| 39 | |
| 40 | /** |
| 41 | * Returns the external gateway MAC address. |
| 42 | * |
| 43 | * @return MAC address; null if the MAC address does not exist |
| 44 | */ |
| 45 | MacAddress extGatewayMac(); |
| 46 | |
| 47 | /** |
| 48 | * Builder of new network entity. |
| 49 | */ |
| 50 | interface Builder { |
| 51 | |
| 52 | /** |
| 53 | * Builds an immutable kubernetes external network instance. |
| 54 | * |
| 55 | * @return kubernetes external network |
| 56 | */ |
| 57 | K8sExternalNetwork build(); |
| 58 | |
| 59 | /** |
| 60 | * Returns kubernetes node builder with supplied external bridge IP. |
| 61 | * |
| 62 | * @param extBridgeIp external bridge IP |
| 63 | * @return kubernetes node builder |
| 64 | */ |
| 65 | Builder extBridgeIp(IpAddress extBridgeIp); |
| 66 | |
| 67 | /** |
| 68 | * Returns kubernetes node builder with supplied gateway IP. |
| 69 | * |
| 70 | * @param extGatewayIp external gateway IP |
| 71 | * @return kubernetes node builder |
| 72 | */ |
| 73 | Builder extGatewayIp(IpAddress extGatewayIp); |
| 74 | |
| 75 | /** |
| 76 | * Returns kubernetes node builder with supplied external gateway MAC. |
| 77 | * |
| 78 | * @param extGatewayMac external gateway MAC address |
| 79 | * @return kubernetes node builder |
| 80 | */ |
| 81 | Builder extGatewayMac(MacAddress extGatewayMac); |
| 82 | } |
| 83 | } |