diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java index d1e1109b1900..3310064406fd 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java @@ -39,12 +39,10 @@ import org.apache.cloudstack.storage.command.CommandResult; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.springframework.stereotype.Component; import java.util.HashMap; import java.util.Map; -@Component public class OntapPrimaryDatastoreDriver implements PrimaryDataStoreDriver { private static final Logger s_logger = (Logger)LogManager.getLogger(OntapPrimaryDatastoreDriver.class); diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/AggregateFeignClient.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/AggregateFeignClient.java new file mode 100644 index 000000000000..ed57bf419405 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/AggregateFeignClient.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cloudstack.storage.feign.client; + +import org.apache.cloudstack.storage.feign.model.Aggregate; +import org.apache.cloudstack.storage.feign.FeignConfiguration; +import org.apache.cloudstack.storage.feign.model.response.OntapResponse; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.context.annotation.Lazy; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import java.net.URI; + +@Lazy +@FeignClient(name="AggregateClient", url="https://{clusterIP}/api/storage/aggregates", configuration = FeignConfiguration.class) +public interface AggregateFeignClient { + + //this method to get all aggregates and also filtered aggregates based on query params as a part of URL + @RequestMapping(method=RequestMethod.GET) + OntapResponse getAggregateResponse(URI baseURL, @RequestHeader("Authorization") String header); + + @RequestMapping(method=RequestMethod.GET, value="/{uuid}") + Aggregate getAggregateByUUID(URI baseURL,@RequestHeader("Authorization") String header, @PathVariable(name = "uuid", required = true) String uuid); + +} diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/ClusterFeignClient.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/ClusterFeignClient.java new file mode 100644 index 000000000000..7758a846f361 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/ClusterFeignClient.java @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cloudstack.storage.feign.client; + +import org.apache.cloudstack.storage.feign.FeignConfiguration; +import org.apache.cloudstack.storage.feign.model.Cluster; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import java.net.URI; + +@FeignClient(name="ClusterClient", url="https://{clusterIP}/api/cluster", configuration = FeignConfiguration.class) +public interface ClusterFeignClient { + + @RequestMapping(method= RequestMethod.GET) + Cluster getCluster(URI baseURL, @RequestHeader("Authorization") String header, @RequestHeader("return_records") boolean value); + +} diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SvmFeignClient.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SvmFeignClient.java new file mode 100644 index 000000000000..52ee30d71c8a --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SvmFeignClient.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cloudstack.storage.feign.client; + +import org.apache.cloudstack.storage.feign.FeignConfiguration; +import org.apache.cloudstack.storage.feign.model.Svm; +import org.apache.cloudstack.storage.feign.model.response.OntapResponse; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import java.net.URI; + +@FeignClient(name = "SvmClient", url = "https://{clusterIP}/api/svm/svms", configuration = FeignConfiguration.class) +public interface SvmFeignClient { + + //this method to get all svms and also filtered svms based on query params as a part of URL + @RequestMapping(method = RequestMethod.GET) + OntapResponse getSvmResponse(URI baseURL, @RequestHeader("Authorization") String header); + + @RequestMapping(method = RequestMethod.GET, value = "/{uuid}") + Svm getSvmByUUID(URI baseURL, @RequestHeader("Authorization") String header); + +} diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/VolumeFeignClient.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/VolumeFeignClient.java index 41f740c7d746..8218cffad6d6 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/VolumeFeignClient.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/VolumeFeignClient.java @@ -20,6 +20,9 @@ import org.apache.cloudstack.storage.feign.FeignConfiguration; +import org.apache.cloudstack.storage.feign.model.request.VolumeRequestDTO; +import org.apache.cloudstack.storage.feign.model.response.JobResponseDTO; +import org.apache.cloudstack.storage.feign.model.response.VolumeDetailsResponseDTO; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -34,27 +37,20 @@ public interface VolumeFeignClient { @DeleteMapping("/storage/volumes/{id}") - void deleteVolume(@RequestHeader("Authorization") String authHeader, - @PathVariable("id") String volumeId); + void deleteVolume(@RequestHeader("Authorization") String authHeader, @PathVariable("id") String volumeId); @PostMapping("/api/storage/volumes") - org.apache.cloudstack.storage.feign.model.response.JobResponseDTO createVolumeWithJob( - @RequestHeader("Authorization") String authHeader, - @RequestBody org.apache.cloudstack.storage.feign.model.request.VolumeRequestDTO request + JobResponseDTO createVolumeWithJob(@RequestHeader("Authorization") String authHeader, @RequestBody VolumeRequestDTO request ); @GetMapping("/api/storage/volumes/{uuid}") - org.apache.cloudstack.storage.feign.model.response.VolumeDetailsResponseDTO getVolumeDetails( - @RequestHeader("Authorization") String authHeader, - @PathVariable("uuid") String uuid + VolumeDetailsResponseDTO getVolumeDetails(@RequestHeader("Authorization") String authHeader, @PathVariable("uuid") String uuid ); @PatchMapping("/api/storage/volumes/{uuid}") - org.apache.cloudstack.storage.feign.model.response.JobResponseDTO updateVolumeRebalancing( - @RequestHeader("accept") String acceptHeader, + org.apache.cloudstack.storage.feign.model.response.JobResponseDTO updateVolumeRebalancing(@RequestHeader("accept") String acceptHeader, @PathVariable("uuid") String uuid, @RequestBody org.apache.cloudstack.storage.feign.model.request.VolumeRequestDTO request ); - } diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Aggregate.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Aggregate.java index 296cd2a2e4f7..85b72a0af27e 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Aggregate.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Aggregate.java @@ -20,14 +20,14 @@ package org.apache.cloudstack.storage.feign.model; import com.fasterxml.jackson.annotation.JsonInclude; -import com.google.gson.annotations.SerializedName; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_NULL) public class Aggregate { - @SerializedName("name") + @JsonProperty("name") private String name = null; @Override @@ -35,19 +35,13 @@ public int hashCode() { return Objects.hash(getName(), getUuid()); } - @SerializedName("uuid") + @JsonProperty("uuid") private String uuid = null; public Aggregate name(String name) { this.name = name; return this; } - - /** - * Get name - * - * @return name - **/ public String getName() { return name; } @@ -61,11 +55,6 @@ public Aggregate uuid(String uuid) { return this; } - /** - * Get uuid - * - * @return uuid - **/ public String getUuid() { return uuid; } diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Cluster.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Cluster.java new file mode 100644 index 000000000000..9dcf8aa738c1 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Cluster.java @@ -0,0 +1,132 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cloudstack.storage.feign.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Objects; + +/** + * Complete cluster information + */ +@SuppressWarnings("checkstyle:RegexpSingleline") +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Cluster { + + @JsonProperty("name") + private String name = null; + @JsonProperty("uuid") + private String uuid = null; + @JsonProperty("version") + private Version version = null; + @JsonProperty("health") + private String health = null; + + @JsonProperty("san_optimized") + private Boolean sanOptimized = null; + + @JsonProperty("disaggregated") + private Boolean disaggregated = null; + + + public String getHealth() { + return health; + } + + public void setHealth(String health) { + this.health = health; + } + + public Cluster name(String name) { + this.name = name; + return this; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public String getUuid() { + return uuid; + } + + public Cluster version(Version version) { + this.version = version; + return this; + } + + public Version getVersion() { + return version; + } + + public void setVersion(Version version) { + this.version = version; + } + + public Boolean getSanOptimized() { + return sanOptimized; + } + + public void setSanOptimized(Boolean sanOptimized) { + this.sanOptimized = sanOptimized; + } + + public Boolean getDisaggregated() { + return disaggregated; + } + public void setDisaggregated(Boolean disaggregated) { + this.disaggregated = disaggregated; + } + + @Override + public int hashCode() { + return Objects.hash(getName(), getUuid()); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cluster cluster = (Cluster) o; + return Objects.equals(this.name, cluster.name) && + Objects.equals(this.uuid, cluster.uuid); + } + @Override + public String toString() { + return "Cluster{" + + "name='" + name + '\'' + + ", uuid='" + uuid + '\'' + + ", version=" + version + + ", sanOptimized=" + sanOptimized + + ", disaggregated=" + disaggregated + + '}'; + } +} diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Svm.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Svm.java index b4d5943eefda..e89c1f8426a6 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Svm.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Svm.java @@ -21,7 +21,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gson.annotations.SerializedName; import java.util.List; import java.util.Objects; @@ -29,35 +28,27 @@ @JsonInclude(JsonInclude.Include.NON_NULL) public class Svm { @JsonProperty("uuid") - @SerializedName("uuid") private String uuid = null; @JsonProperty("name") - @SerializedName("name") private String name = null; @JsonProperty("iscsi.enabled") - @SerializedName("iscsi.enabled") private Boolean iscsiEnabled = null; @JsonProperty("fcp.enabled") - @SerializedName("fcp.enabled") private Boolean fcpEnabled = null; @JsonProperty("nfs.enabled") - @SerializedName("nfs.enabled") private Boolean nfsEnabled = null; @JsonProperty("aggregates") - @SerializedName("aggregates") private List aggregates = null; @JsonProperty("aggregates_delegated") - @SerializedName("aggregates_delegated") private Boolean aggregatesDelegated = null; @JsonProperty("state.value") - @SerializedName("state.value") private String state = null; public String getUuid() { @@ -84,6 +75,7 @@ public void setIscsiEnabled(Boolean iscsiEnabled) { this.iscsiEnabled = iscsiEnabled; } + public Boolean getFcpEnabled() { return fcpEnabled; } @@ -92,6 +84,7 @@ public void setFcpEnabled(Boolean fcpEnabled) { this.fcpEnabled = fcpEnabled; } + public Boolean getNfsEnabled() { return nfsEnabled; } @@ -100,6 +93,7 @@ public void setNfsEnabled(Boolean nfsEnabled) { this.nfsEnabled = nfsEnabled; } + public List getAggregates() { return aggregates; } @@ -108,6 +102,7 @@ public void setAggregates(List aggregates) { this.aggregates = aggregates; } + public Boolean getAggregatesDelegated() { return aggregatesDelegated; } @@ -116,6 +111,7 @@ public void setAggregatesDelegated(Boolean aggregatesDelegated) { this.aggregatesDelegated = aggregatesDelegated; } + public String getState() { return state; } diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Version.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Version.java new file mode 100644 index 000000000000..056e20eb3400 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Version.java @@ -0,0 +1,106 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +package org.apache.cloudstack.storage.feign.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Objects; + +/** + * This returns the cluster version information. When the cluster has more than one node, the cluster version is equivalent to the lowest of generation, major, and minor versions on all nodes. + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Version { + @JsonProperty("full") + private String full = null; + + @JsonProperty("generation") + private Integer generation = null; + + @JsonProperty("major") + private Integer major = null; + + @JsonProperty("minor") + private Integer minor = null; + + public String getFull() { + return full; + } + + public Integer getGeneration() { + return generation; + } + + public Integer getMajor() { + return major; + } + + public Integer getMinor() { + return minor; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Version clusterVersion = (Version) o; + return Objects.equals(this.full, clusterVersion.full) && + Objects.equals(this.generation, clusterVersion.generation) && + Objects.equals(this.major, clusterVersion.major) && + Objects.equals(this.minor, clusterVersion.minor); + } + + @Override + public int hashCode() { + return Objects.hash(full, generation, major, minor); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClusterVersion {\n"); + sb.append(" full: ").append(toIndentedString(full)).append("\n"); + sb.append(" generation: ").append(toIndentedString(generation)).append("\n"); + sb.append(" major: ").append(toIndentedString(major)).append("\n"); + sb.append(" minor: ").append(toIndentedString(minor)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/VolumeQosPolicy.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/VolumeQosPolicy.java index 313edac55314..ae4cfa519c14 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/VolumeQosPolicy.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/VolumeQosPolicy.java @@ -21,28 +21,22 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gson.annotations.SerializedName; @JsonInclude(JsonInclude.Include.NON_NULL) public class VolumeQosPolicy { @JsonProperty("max_throughput_iops") - @SerializedName("max_throughput_iops") private Integer maxThroughputIops = null; @JsonProperty("max_throughput_mbps") - @SerializedName("max_throughput_mbps") private Integer maxThroughputMbps = null; @JsonProperty("min_throughput_iops") - @SerializedName("min_throughput_iops") private Integer minThroughputIops = null; @JsonProperty("name") - @SerializedName("name") private String name = null; @JsonProperty("uuid") - @SerializedName("uuid") private String uuid = null; public Integer getMaxThroughputIops() { diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/VolumeSpaceLogicalSpace.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/VolumeSpaceLogicalSpace.java index b27840bf3c3d..354a314a5017 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/VolumeSpaceLogicalSpace.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/VolumeSpaceLogicalSpace.java @@ -21,17 +21,14 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gson.annotations.SerializedName; @JsonInclude(JsonInclude.Include.NON_NULL) public class VolumeSpaceLogicalSpace { @JsonProperty("available") - @SerializedName("available") private Long available = null; @JsonProperty("used") - @SerializedName("used") private Double used = null; public Long getAvailable() { diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/response/OntapResponse.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/response/OntapResponse.java new file mode 100644 index 000000000000..933c1ec0bdf4 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/response/OntapResponse.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cloudstack.storage.feign.model.response; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * OnTapResponse + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class OntapResponse { + @JsonProperty("num_records") + private Integer numRecords; + + @JsonProperty("records") + private List records; + + public OntapResponse () { + // Default constructor + } + + public OntapResponse (List records) { + this.records = records; + this.numRecords = (records != null) ? records.size() : 0; + } + + public Integer getNumRecords() { + return numRecords; + } + + public void setNumRecords(Integer numRecords) { + this.numRecords = numRecords; + } + + public List getRecords() { + return records; + } + + public void setRecords(List records) { + this.records = records; + this.numRecords = (records != null) ? records.size() : 0; + } +}