|
24 | 24 |
|
25 | 25 | import java.util.List; |
26 | 26 |
|
| 27 | +/** |
| 28 | + * Interface for Netris Services that provides methods to manage VPCs, networks, |
| 29 | + * NAT rules, network rules, and static routes in an SDN (Software Defined Networking) environment. |
| 30 | + */ |
| 31 | + |
27 | 32 | public interface NetrisService { |
| 33 | + |
| 34 | + /** |
| 35 | + * Creates IPAM (IP Address Management) allocations for zone-level public ranges. |
| 36 | + * |
| 37 | + * @param zoneId the ID of the zone |
| 38 | + * @return true if the operation is successful, false otherwise |
| 39 | + */ |
28 | 40 | boolean createIPAMAllocationsForZoneLevelPublicRanges(long zoneId); |
29 | 41 |
|
| 42 | + /** |
| 43 | + * Creates a VPC (Virtual Private Cloud) resource. |
| 44 | + * |
| 45 | + * @param zoneId the ID of the zone |
| 46 | + * @param accountId the ID of the account |
| 47 | + * @param domainId the ID of the domain |
| 48 | + * @param vpcId the ID of the VPC |
| 49 | + * @param vpcName the name of the VPC |
| 50 | + * @param sourceNatEnabled true if source NAT is enabled |
| 51 | + * @param cidr the CIDR of the VPC |
| 52 | + * @param isVpcNetwork true if it is a VPC network |
| 53 | + * @return true if the operation is successful, false otherwise |
| 54 | + */ |
30 | 55 | boolean createVpcResource(long zoneId, long accountId, long domainId, Long vpcId, String vpcName, boolean sourceNatEnabled, String cidr, boolean isVpcNetwork); |
31 | 56 |
|
| 57 | + /** |
| 58 | + * Updates an existing VPC resource. |
| 59 | + * |
| 60 | + * @param zoneId the ID of the zone |
| 61 | + * @param accountId the ID of the account |
| 62 | + * @param domainId the ID of the domain |
| 63 | + * @param vpcId the ID of the VPC |
| 64 | + * @param vpcName the new name of the VPC |
| 65 | + * @param previousVpcName the previous name of the VPC |
| 66 | + * @return true if the operation is successful, false otherwise |
| 67 | + */ |
32 | 68 | boolean updateVpcResource(long zoneId, long accountId, long domainId, Long vpcId, String vpcName, String previousVpcName); |
33 | 69 |
|
| 70 | + /** |
| 71 | + * Deletes a VPC resource. |
| 72 | + * |
| 73 | + * @param zoneId the ID of the zone |
| 74 | + * @param accountId the ID of the account |
| 75 | + * @param domainId the ID of the domain |
| 76 | + * @param vpc the VPC to delete |
| 77 | + * @return true if the operation is successful, false otherwise |
| 78 | + */ |
34 | 79 | boolean deleteVpcResource(long zoneId, long accountId, long domainId, Vpc vpc); |
35 | 80 |
|
| 81 | + /** |
| 82 | + * Creates a virtual network (vNet) resource. |
| 83 | + * |
| 84 | + * @param zoneId the ID of the zone |
| 85 | + * @param accountId the ID of the account |
| 86 | + * @param domainId the ID of the domain |
| 87 | + * @param vpcName the name of the VPC |
| 88 | + * @param vpcId the ID of the VPC |
| 89 | + * @param networkName the name of the network |
| 90 | + * @param networkId the ID of the network |
| 91 | + * @param cidr the CIDR of the network |
| 92 | + * @param globalRouting true if global routing is enabled |
| 93 | + * @return true if the operation is successful, false otherwise |
| 94 | + */ |
36 | 95 | boolean createVnetResource(Long zoneId, long accountId, long domainId, String vpcName, Long vpcId, String networkName, Long networkId, String cidr, Boolean globalRouting); |
37 | 96 |
|
| 97 | + /** |
| 98 | + * Updates an existing vNet resource. |
| 99 | + * |
| 100 | + * @param zoneId the ID of the zone |
| 101 | + * @param accountId the ID of the account |
| 102 | + * @param domainId the ID of the domain |
| 103 | + * @param vpcName the name of the VPC |
| 104 | + * @param vpcId the ID of the VPC |
| 105 | + * @param networkName the new name of the network |
| 106 | + * @param networkId the ID of the network |
| 107 | + * @param prevNetworkName the previous name of the network |
| 108 | + * @return true if the operation is successful, false otherwise |
| 109 | + */ |
38 | 110 | boolean updateVnetResource(Long zoneId, long accountId, long domainId, String vpcName, Long vpcId, String networkName, Long networkId, String prevNetworkName); |
39 | 111 |
|
| 112 | + /** |
| 113 | + * Deletes an existing vNet resource. |
| 114 | + * |
| 115 | + * @param zoneId the ID of the zone |
| 116 | + * @param accountId the ID of the account |
| 117 | + * @param domainId the ID of the domain |
| 118 | + * @param vpcName the name of the VPC |
| 119 | + * @param vpcId the ID of the VPC |
| 120 | + * @param networkName the name of the network |
| 121 | + * @param networkId the ID of the network |
| 122 | + * @param cidr the CIDR of the network |
| 123 | + * @return true if the operation is successful, false otherwise |
| 124 | + */ |
40 | 125 | boolean deleteVnetResource(long zoneId, long accountId, long domainId, String vpcName, Long vpcId, String networkName, Long networkId, String cidr); |
41 | 126 |
|
| 127 | + /** |
| 128 | + * Creates a source NAT rule for a VPC or network. |
| 129 | + * |
| 130 | + * @param zoneId the ID of the zone |
| 131 | + * @param accountId the ID of the account |
| 132 | + * @param domainId the ID of the domain |
| 133 | + * @param vpcName the name of the VPC |
| 134 | + * @param vpcId the ID of the VPC |
| 135 | + * @param networkName the name of the network |
| 136 | + * @param networkId the ID of the network |
| 137 | + * @param isForVpc true if the rule applies to a VPC |
| 138 | + * @param vpcCidr the VPC CIDR |
| 139 | + * @param sourceNatIp the source NAT IP |
| 140 | + * @return true if the operation is successful, false otherwise |
| 141 | + */ |
42 | 142 | boolean createSnatRule(long zoneId, long accountId, long domainId, String vpcName, long vpcId, String networkName, long networkId, boolean isForVpc, String vpcCidr, String sourceNatIp); |
43 | 143 |
|
| 144 | + /** |
| 145 | + * Creates a port forwarding rule for a VPC or network. |
| 146 | + * |
| 147 | + * @param zoneId the ID of the zone |
| 148 | + * @param accountId the ID of the account |
| 149 | + * @param domainId the ID of the domain |
| 150 | + * @param vpcName the name of the VPC |
| 151 | + * @param vpcId the ID of the VPC |
| 152 | + * @param networkName the name of the network |
| 153 | + * @param networkId the ID of the network |
| 154 | + * @param isForVpc true if the rule applies to a VPC |
| 155 | + * @param vpcCidr the VPC CIDR |
| 156 | + * @param networkRule the network rule to forward |
| 157 | + * @return true if the operation is successful, false otherwise |
| 158 | + */ |
44 | 159 | boolean createPortForwardingRule(long zoneId, long accountId, long domainId, String vpcName, long vpcId, String networkName, Long networkId, boolean isForVpc, String vpcCidr, SDNProviderNetworkRule networkRule); |
45 | 160 |
|
| 161 | + /** |
| 162 | + * Deletes a port forwarding rule for a VPC or network. |
| 163 | + * |
| 164 | + * @param zoneId the ID of the zone |
| 165 | + * @param accountId the ID of the account |
| 166 | + * @param domainId the ID of the domain |
| 167 | + * @param vpcName the name of the VPC |
| 168 | + * @param vpcId the ID of the VPC |
| 169 | + * @param networkName the name of the network |
| 170 | + * @param networkId the ID of the network |
| 171 | + * @param isForVpc true if the rule applies to a VPC |
| 172 | + * @param vpcCidr the VPC CIDR |
| 173 | + * @param networkRule the network rule to remove |
| 174 | + * @return true if the operation is successful, false otherwise |
| 175 | + */ |
46 | 176 | boolean deletePortForwardingRule(long zoneId, long accountId, long domainId, String vpcName, Long vpcId, String networkName, Long networkId, boolean isForVpc, String vpcCidr, SDNProviderNetworkRule networkRule); |
47 | 177 |
|
| 178 | + /** |
| 179 | + * Updates the source NAT IP for a specified VPC. |
| 180 | + * |
| 181 | + * @param vpc the VPC to updates |
| 182 | + * @param address the new source NAT IP address |
| 183 | + * @return true if the operation is successful, false otherwise |
| 184 | + */ |
48 | 185 | boolean updateVpcSourceNatIp(Vpc vpc, IpAddress address); |
49 | 186 |
|
| 187 | + /** |
| 188 | + * Creates a static NAT rule for a specific VM. |
| 189 | + * |
| 190 | + * @param zoneId the ID of the zone |
| 191 | + * @param accountId the ID of the account |
| 192 | + * @param domainId the ID of the domain |
| 193 | + * @param networkResourceName the name of the network resource |
| 194 | + * @param networkResourceId the ID of the network resource |
| 195 | + * @param isForVpc true if the rule applies to a VPC |
| 196 | + * @param vpcCidr the VPC CIDR |
| 197 | + * @param staticNatIp the static NAT IP |
| 198 | + * @param vmIp the VM's IP address |
| 199 | + * @param vmId the ID of the VM |
| 200 | + * @return true if the operation is successful, false otherwise |
| 201 | + */ |
50 | 202 | boolean createStaticNatRule(long zoneId, long accountId, long domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, String vpcCidr, String staticNatIp, String vmIp, long vmId); |
51 | 203 |
|
| 204 | + /** |
| 205 | + * Deletes a static NAT rule for a specific VM. |
| 206 | + * |
| 207 | + * @param zoneId the ID of the zone |
| 208 | + * @param accountId the ID of the account |
| 209 | + * @param domainId the ID of the domain |
| 210 | + * @param networkResourceName the name of the network resource |
| 211 | + * @param networkResourceId the ID of the network resource |
| 212 | + * @param isForVpc true if the rule applies to a VPC |
| 213 | + * @param staticNatIp the static NAT IP |
| 214 | + * @param vmId the ID of the VM |
| 215 | + * @return true if the operation is successful, false otherwise |
| 216 | + */ |
52 | 217 | boolean deleteStaticNatRule(long zoneId, long accountId, long domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, String staticNatIp, long vmId); |
53 | 218 |
|
| 219 | + /** |
| 220 | + * Adds firewall rules to a specific network. |
| 221 | + * |
| 222 | + * @param network the target network |
| 223 | + * @param firewallRules the list of firewall rules to add |
| 224 | + * @return true if the operation is successful, false otherwise |
| 225 | + */ |
54 | 226 | boolean addFirewallRules(Network network, List<NetrisNetworkRule> firewallRules); |
| 227 | + |
| 228 | + /** |
| 229 | + * Deletes firewall rules from a specific network. |
| 230 | + * |
| 231 | + * @param network the target network |
| 232 | + * @param firewallRules the list of firewall rules to delete |
| 233 | + * @return true if the operation is successful, false otherwise |
| 234 | + */ |
55 | 235 | boolean deleteFirewallRules(Network network, List<NetrisNetworkRule> firewallRules); |
56 | 236 |
|
| 237 | + /** |
| 238 | + * Adds or updates a static route for a specific network or VPC. |
| 239 | + * |
| 240 | + * @param zoneId the ID of the zone |
| 241 | + * @param accountId the ID of the account |
| 242 | + * @param domainId the ID of the domain |
| 243 | + * @param networkResourceName the name of the network resource |
| 244 | + * @param networkResourceId the ID of the network resource |
| 245 | + * @param isForVpc true if it is for a VPC |
| 246 | + * @param prefix the IP prefix of the route |
| 247 | + * @param nextHop the next hop address |
| 248 | + * @param routeId the ID of the route |
| 249 | + * @param updateRoute true if the route should be updated |
| 250 | + * @return true if the operation is successful, false otherwise |
| 251 | + */ |
57 | 252 | boolean addOrUpdateStaticRoute(long zoneId, long accountId, long domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, String prefix, String nextHop, Long routeId, boolean updateRoute); |
58 | 253 |
|
| 254 | + /** |
| 255 | + * Deletes a specific static route for a network or VPC. |
| 256 | + * |
| 257 | + * @param zoneId the ID of the zone |
| 258 | + * @param accountId the ID of the account |
| 259 | + * @param domainId the ID of the domain |
| 260 | + * @param networkResourceName the name of the network resource |
| 261 | + * @param networkResourceId the ID of the network resource |
| 262 | + * @param isForVpc true if it is for a VPC |
| 263 | + * @param prefix the IP prefix of the route |
| 264 | + * @param nextHop the next hop address |
| 265 | + * @param routeId the ID of the route |
| 266 | + * @return true if the operation is successful, false otherwise |
| 267 | + */ |
59 | 268 | boolean deleteStaticRoute(long zoneId, long accountId, long domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, String prefix, String nextHop, Long routeId); |
60 | 269 |
|
| 270 | + /** |
| 271 | + * Lists static routes for a specific network or VPC. |
| 272 | + * |
| 273 | + * @param zoneId the ID of the zone |
| 274 | + * @param accountId the ID of the account |
| 275 | + * @param domainId the ID of the domain |
| 276 | + * @param networkResourceName the name of the network resource |
| 277 | + * @param networkResourceId the ID of the network resource |
| 278 | + * @param isForVpc true if it is for a VPC |
| 279 | + * @param prefix the IP prefix of the route |
| 280 | + * @param nextHop the next hop address |
| 281 | + * @param routeId the ID of the route |
| 282 | + * @return a list of static routes |
| 283 | + */ |
61 | 284 | List<StaticRoute> listStaticRoutes(long zoneId, long accountId, long domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, String prefix, String nextHop, Long routeId); |
62 | 285 |
|
| 286 | + /** |
| 287 | + * Releases a NAT IP address. |
| 288 | + * |
| 289 | + * @param zoneId the ID of the zone |
| 290 | + * @param publicIp the public NAT IP to release |
| 291 | + * @return true if the operation is successful, false otherwise |
| 292 | + */ |
63 | 293 | boolean releaseNatIp(long zoneId, String publicIp); |
64 | 294 |
|
| 295 | + /** |
| 296 | + * Creates or updates a load balancer (LB) rule. |
| 297 | + * |
| 298 | + * @param rule the network rule for the load balancer |
| 299 | + * @return true if the operation is successful, false otherwise |
| 300 | + */ |
65 | 301 | boolean createOrUpdateLbRule(NetrisNetworkRule rule); |
| 302 | + |
| 303 | + /** |
| 304 | + * Deletes a load balancer (LB) rule. |
| 305 | + * |
| 306 | + * @param rule the network rule to delete |
| 307 | + * @return true if the operation is successful, false otherwise |
| 308 | + */ |
66 | 309 | boolean deleteLbRule(NetrisNetworkRule rule); |
67 | 310 | } |
0 commit comments