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;
26 import com.fasterxml.jackson.annotation.JsonProperty;
28 public class ContrailSubnet {
30 @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet")
31 private ContrailSubnetIp subnet = new ContrailSubnetIp();
33 @JsonProperty("network_ipam_refs_data_ipam_subnets_default_gateway")
34 private String defaultGateway;
36 @JsonProperty("network_ipam_refs_data_ipam_subnets_subnet_name")
37 private String subnetName;
39 @JsonProperty("network_ipam_refs_data_ipam_subnets_enable_dhcp")
40 private Boolean enableDhcp;
42 @JsonProperty("network_ipam_refs_data_ipam_subnets_addr_from_start")
43 private Boolean addrFromStart = true;
44 /** future - leave this commented
45 private String subnet_uuid;
46 private String dns_server_address;
47 private List<String> dns_nameservers;
48 private String dhcp_option_list;
51 @JsonProperty("network_ipam_refs_data_ipam_subnets_allocation_pools")
52 private List<ContrailSubnetPool> allocationPools = new ArrayList<>();
54 @JsonProperty("network_ipam_refs_data_ipam_subnets_host_routes")
55 private ContrailSubnetHostRoutes hostRoutes = new ContrailSubnetHostRoutes();
57 public ContrailSubnet() {
61 public String getDefaultGateway() {
62 return defaultGateway;
65 public void setDefaultGateway(String defaultGateway) {
66 this.defaultGateway = defaultGateway;
69 public ContrailSubnetIp getSubnet() {
73 public void setSubnet(ContrailSubnetIp subnet) {
77 public Boolean isEnableDhcp() {
81 public void setEnableDhcp(Boolean enableDhcp) {
82 this.enableDhcp = enableDhcp;
85 public String getSubnetName() {
89 public void setSubnetName(String subnetName) {
90 this.subnetName = subnetName;
93 public List<ContrailSubnetPool> getAllocationPools() {
94 return allocationPools;
97 public void setAllocationPools(List<ContrailSubnetPool> allocationPools) {
98 this.allocationPools = allocationPools;
101 public Boolean isAddrFromStart() {
102 return addrFromStart;
105 public void setAddrFromStart(Boolean addrFromStart) {
106 this.addrFromStart = addrFromStart;
109 public ContrailSubnetHostRoutes getHostRoutes() {
113 public void setHostRoutes(ContrailSubnetHostRoutes hostRoutes) {
114 this.hostRoutes = hostRoutes;
118 public String toString() {
119 StringBuilder buf = new StringBuilder ();
120 for (ContrailSubnetPool pool : allocationPools)
122 buf.append(pool.toString());
124 return "ContrailSubnet [subnet=" + subnet.toString() + " default_gateway=" + defaultGateway
125 + " enable_dhcp=" + enableDhcp + " addr_from_start=" + addrFromStart + " subnet_name=" + subnetName + " allocation_pools=" + buf + " ]";