2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.so.adapters.network.beans;
23 import java.util.ArrayList;
24 import java.util.List;
25 import com.fasterxml.jackson.annotation.JsonProperty;
27 public class ContrailSubnet {
29 @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet")
30 private ContrailSubnetIp subnet = new ContrailSubnetIp();
32 @JsonProperty("network_ipam_refs_data_ipam_subnets_default_gateway")
33 private String defaultGateway;
35 @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_name")
36 private String subnetName;
38 @JsonProperty("network_ipam_refs_data_ipam_subnets_enable_dhcp")
39 private Boolean enableDhcp;
41 @JsonProperty("network_ipam_refs_data_ipam_subnets_addr_from_start")
42 private Boolean addrFromStart = true;
44 * future - leave this commented private String subnet_uuid; private String dns_server_address; private List<String>
45 * dns_nameservers; private String dhcp_option_list;
48 @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools")
49 private List<ContrailSubnetPool> allocationPools = new ArrayList<>();
51 @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes")
52 private ContrailSubnetHostRoutes hostRoutes = new ContrailSubnetHostRoutes();
54 public ContrailSubnet() {
58 public String getDefaultGateway() {
59 return defaultGateway;
62 public void setDefaultGateway(String defaultGateway) {
63 this.defaultGateway = defaultGateway;
66 public ContrailSubnetIp getSubnet() {
70 public void setSubnet(ContrailSubnetIp subnet) {
74 public Boolean isEnableDhcp() {
78 public void setEnableDhcp(Boolean enableDhcp) {
79 this.enableDhcp = enableDhcp;
82 public String getSubnetName() {
86 public void setSubnetName(String subnetName) {
87 this.subnetName = subnetName;
90 public List<ContrailSubnetPool> getAllocationPools() {
91 return allocationPools;
94 public void setAllocationPools(List<ContrailSubnetPool> allocationPools) {
95 this.allocationPools = allocationPools;
98 public Boolean isAddrFromStart() {
102 public void setAddrFromStart(Boolean addrFromStart) {
103 this.addrFromStart = addrFromStart;
106 public ContrailSubnetHostRoutes getHostRoutes() {
110 public void setHostRoutes(ContrailSubnetHostRoutes hostRoutes) {
111 this.hostRoutes = hostRoutes;
115 public String toString() {
116 StringBuilder buf = new StringBuilder();
117 for (ContrailSubnetPool pool : allocationPools) {
118 buf.append(pool.toString());
120 return "ContrailSubnet [subnet=" + subnet.toString() + " default_gateway=" + defaultGateway + " enable_dhcp="
121 + enableDhcp + " addr_from_start=" + addrFromStart + " subnet_name=" + subnetName + " allocation_pools="