From 951d8eada772128f2fc255494772e8fd89f20bbb Mon Sep 17 00:00:00 2001 From: "Gupta, Surya" Date: Tue, 14 Oct 2025 22:47:06 +0530 Subject: [PATCH 01/10] CSTACKEX-29 Cluster, SVM and Aggr Feign Client --- .../feign/client/AggregateFeignClient.java | 24 +++ .../feign/client/ClusterFeignClient.java | 17 ++ .../storage/feign/client/SvmFeignClient.java | 20 +++ .../feign/client/VolumeFeignClient.java | 18 +-- .../storage/feign/model/Aggregate.java | 8 +- .../feign/model/AggregateResponse.java | 145 ++++++++++++++++++ .../storage/feign/model/Cluster.java | 115 ++++++++++++++ .../storage/feign/model/ClusterVersion.java | 117 ++++++++++++++ .../cloudstack/storage/feign/model/Svm.java | 17 +- .../storage/feign/model/SvmResponse.java | 119 ++++++++++++++ 10 files changed, 579 insertions(+), 21 deletions(-) create mode 100644 plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/AggregateFeignClient.java create mode 100644 plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/ClusterFeignClient.java create mode 100644 plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SvmFeignClient.java create mode 100644 plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java create mode 100644 plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Cluster.java create mode 100644 plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ClusterVersion.java create mode 100644 plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java 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..58ea3713681b --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/AggregateFeignClient.java @@ -0,0 +1,24 @@ +package org.apache.cloudstack.storage.feign.client; + +import org.apache.cloudstack.storage.feign.model.AggregateResponse; +import org.apache.cloudstack.storage.feign.model.Aggregate; +import org.apache.cloudstack.storage.feign.FeignConfiguration; +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 { + @RequestMapping(method=RequestMethod.GET) + AggregateResponse getAllAggregates(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); + +} \ No newline at end of file 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..fc72812eeaae --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/ClusterFeignClient.java @@ -0,0 +1,17 @@ +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..d9565668d6d9 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SvmFeignClient.java @@ -0,0 +1,20 @@ +package org.apache.cloudstack.storage.feign.client; + +import org.apache.cloudstack.storage.feign.FeignConfiguration; +import org.apache.cloudstack.storage.feign.model.SvmResponse; +import org.apache.cloudstack.storage.feign.model.Svm; +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 { + @RequestMapping(method = RequestMethod.GET) + SvmResponse getAllSvms(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..7c5b9191a662 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,16 @@ package org.apache.cloudstack.storage.feign.model; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_NULL) public class Aggregate { - @SerializedName("name") + @JsonProperty("name") private String name = null; @Override @@ -35,7 +37,7 @@ public int hashCode() { return Objects.hash(getName(), getUuid()); } - @SerializedName("uuid") + @JsonProperty("uuid") private String uuid = null; public Aggregate name(String name) { @@ -48,6 +50,7 @@ public Aggregate name(String name) { * * @return name **/ + @ApiModelProperty(value = "Name of aggregate") public String getName() { return name; } @@ -66,6 +69,7 @@ public Aggregate uuid(String uuid) { * * @return uuid **/ + @ApiModelProperty(value = "UUID of aggregate") public String getUuid() { return uuid; } diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java new file mode 100644 index 000000000000..3551b47b5e61 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java @@ -0,0 +1,145 @@ +/* + * ONTAP REST API + * ONTAP adds support for an expansive RESTful API. The documentation below provides information about the types of API calls available to you, as well as details about using each API endpoint. You can learn more about the ONTAP REST API and ONTAP in the ONTAP 9 Documentation Center: http://docs.netapp.com/ontap-9/topic/com.netapp.doc.dot-rest-api/home.html. NetApp welcomes your comments and suggestions about the ONTAP REST API and the documentation for its use.
**Using the ONTAP REST API online documentation** Each API method includes usage examples, as well as a model that displays all the required and optional properties supported by the method. Click the _Model_ link, available with each API method, to see all the required and optional properties supported by each method. + * + * OpenAPI spec version: v1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package org.apache.cloudstack.storage.feign.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * AggregateResponse + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class AggregateResponse { + @JsonProperty("error") + private Error error = null; + @JsonProperty("num_records") + private Integer numRecords = null; + @JsonProperty("records") + private List records = null; + + public AggregateResponse error(Error error) { + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @ApiModelProperty(value = "") + public Error getError() { + return error; + } + + public void setError(Error error) { + this.error = error; + } + + public AggregateResponse numRecords(Integer numRecords) { + this.numRecords = numRecords; + return this; + } + + /** + * Number of records + * @return numRecords + **/ + @ApiModelProperty(value = "Number of records") + public Integer getNumRecords() { + return numRecords; + } + + public void setNumRecords(Integer numRecords) { + this.numRecords = numRecords; + } + + public AggregateResponse records(List records) { + this.records = records; + return this; + } + + public AggregateResponse addRecordsItem(Aggregate recordsItem) { + if (this.records == null) { + this.records = new ArrayList(); + } + this.records.add(recordsItem); + return this; + } + + /** + * Get records + * @return records + **/ + @ApiModelProperty(value = "") + public List getRecords() { + return records; + } + + public void setRecords(List records) { + this.records = records; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AggregateResponse aggregateResponse = (AggregateResponse) o; + return + Objects.equals(this.error, aggregateResponse.error) && + Objects.equals(this.numRecords, aggregateResponse.numRecords) && + Objects.equals(this.records, aggregateResponse.records); + } + + @Override + public int hashCode() { + return Objects.hash(error, numRecords, records); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AggregateResponse {\n"); + + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" numRecords: ").append(toIndentedString(numRecords)).append("\n"); + sb.append(" records: ").append(toIndentedString(records)).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/Cluster.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Cluster.java new file mode 100644 index 000000000000..fa09a729ea09 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Cluster.java @@ -0,0 +1,115 @@ +/* +* +* Copyright (c) 2020 Netapp, Inc. +* All rights reserved. +*/ +package org.apache.cloudstack.storage.feign.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; + +/** + * Complete cluster information + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Cluster { + @JsonProperty("name") + private String name = null; + @JsonProperty("uuid") + private String uuid = null; + + @JsonProperty("version") + private ClusterVersion version = null; + @JsonProperty("health") + private String health = null; + + @JsonProperty("san_optimized") + private Boolean sanOptimized = null; + + @JsonProperty("disaggregated") + private Boolean disaggregated = null; + + @ApiModelProperty(example = "healthy", value = "") + public String getHealth() { + return health; + } + + public void setHealth(String health) { + this.health = health; + } + + public Cluster name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + **/ + @ApiModelProperty(example = "cluster1", value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * Get uuid + * + * @return uuid + **/ + @ApiModelProperty(example = "1cd8a442-86d1-11e0-ae1c-123478563412", value = "") + public String getUuid() { + return uuid; + } + + public Cluster version(ClusterVersion version) { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version + **/ + @ApiModelProperty(value = "") + public ClusterVersion getVersion() { + return version; + } + + public void setVersion(ClusterVersion version) { + this.version = version; + } + @ApiModelProperty(value = "") + public Boolean getSanOptimized() { + return sanOptimized; + } + + public void setSanOptimized(Boolean sanOptimized) { + this.sanOptimized = sanOptimized; + } + @ApiModelProperty(value = "") + public Boolean getDisaggregated() { + return disaggregated; + } + public void setDisaggregated(Boolean disaggregated) { + this.disaggregated = disaggregated; + } + @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/ClusterVersion.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ClusterVersion.java new file mode 100644 index 000000000000..d225aa600d0c --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ClusterVersion.java @@ -0,0 +1,117 @@ +/* +* +* Copyright (c) 2020 Netapp, Inc. +* All rights reserved. +*/ + + +package org.apache.cloudstack.storage.feign.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; + +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 ClusterVersion { + @JsonProperty("full") + private String full = null; + + @JsonProperty("generation") + private Integer generation = null; + + @JsonProperty("major") + private Integer major = null; + + @JsonProperty("minor") + private Integer minor = null; + + /** + * The full cluster version string. + * @return full + **/ + @ApiModelProperty(example = "NetApp Release 9.4.0: Sun Nov 05 18:20:57 UTC 2017", value = "The full cluster version string.") + public String getFull() { + return full; + } + + /** + * The generation portion of the version. + * @return generation + **/ + @ApiModelProperty(example = "9", value = "The generation portion of the version.") + public Integer getGeneration() { + return generation; + } + + /** + * The major portion of the version. + * @return major + **/ + @ApiModelProperty(example = "4", value = "The major portion of the version.") + public Integer getMajor() { + return major; + } + + /** + * The minor portion of the version. + * @return minor + **/ + @ApiModelProperty(example = "0", value = "The minor portion of the version.") + public Integer getMinor() { + return minor; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClusterVersion clusterVersion = (ClusterVersion) 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/Svm.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Svm.java index b4d5943eefda..3c6f3c71df8b 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 @@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; import java.util.List; import java.util.Objects; @@ -29,37 +30,30 @@ @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; + @ApiModelProperty(value = "UUID of svm") public String getUuid() { return uuid; } @@ -68,6 +62,7 @@ public void setUuid(String uuid) { this.uuid = uuid; } + @ApiModelProperty(value = "name of svm") public String getName() { return name; } @@ -76,6 +71,7 @@ public void setName(String name) { this.name = name; } + @ApiModelProperty(value = "iscsi enabled or not") public Boolean getIscsiEnabled() { return iscsiEnabled; } @@ -84,6 +80,7 @@ public void setIscsiEnabled(Boolean iscsiEnabled) { this.iscsiEnabled = iscsiEnabled; } + @ApiModelProperty(value = "fcp enabled or not") public Boolean getFcpEnabled() { return fcpEnabled; } @@ -92,6 +89,7 @@ public void setFcpEnabled(Boolean fcpEnabled) { this.fcpEnabled = fcpEnabled; } + @ApiModelProperty(value = "nfs enabled or not") public Boolean getNfsEnabled() { return nfsEnabled; } @@ -100,6 +98,7 @@ public void setNfsEnabled(Boolean nfsEnabled) { this.nfsEnabled = nfsEnabled; } + @ApiModelProperty(value = "list of aggregates") public List getAggregates() { return aggregates; } @@ -108,6 +107,7 @@ public void setAggregates(List aggregates) { this.aggregates = aggregates; } + @ApiModelProperty(value = "are aggregates delegated or not") public Boolean getAggregatesDelegated() { return aggregatesDelegated; } @@ -116,6 +116,7 @@ public void setAggregatesDelegated(Boolean aggregatesDelegated) { this.aggregatesDelegated = aggregatesDelegated; } + @ApiModelProperty(value = "state of svm") public String getState() { return state; } diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java new file mode 100644 index 000000000000..05e66542f505 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java @@ -0,0 +1,119 @@ +/* +* +* Copyright (c) 2020 Netapp, Inc. +* All rights reserved. +*/ + + +package org.apache.cloudstack.storage.feign.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; +import io.swagger.annotations.ApiModelProperty; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * SvmResponse + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class SvmResponse { + + @JsonProperty("num_records") + private Integer numRecords = null; + + @JsonProperty("records") + private List records = null; + + public SvmResponse numRecords(Integer numRecords) { + this.numRecords = numRecords; + return this; + } + + /** + * Number of records + * @return numRecords + **/ + @ApiModelProperty(value = "Number of records") + public Integer getNumRecords() { + return numRecords; + } + + public void setNumRecords(Integer numRecords) { + this.numRecords = numRecords; + } + + public SvmResponse records(List records) { + this.records = records; + return this; + } + + public SvmResponse addRecordsItem(Svm recordsItem) { + if (this.records == null) { + this.records = new ArrayList(); + } + this.records.add(recordsItem); + return this; + } + + /** + * Get records + * @return records + **/ + @ApiModelProperty(value = "") + public List getRecords() { + return records; + } + + public void setRecords(List records) { + this.records = records; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SvmResponse svmResponse = (SvmResponse) o; + return + Objects.equals(this.numRecords, svmResponse.numRecords) && + Objects.equals(this.records, svmResponse.records); + } + + @Override + public int hashCode() { + return Objects.hash(numRecords, records); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SvmResponse {\n"); + + sb.append(" numRecords: ").append(toIndentedString(numRecords)).append("\n"); + sb.append(" records: ").append(toIndentedString(records)).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 "); + } + +} + From 85da60725ebb3d24bd97cc79b75dbe13171b4fd7 Mon Sep 17 00:00:00 2001 From: "Gupta, Surya" Date: Wed, 15 Oct 2025 08:18:36 +0530 Subject: [PATCH 02/10] CSTACKEX-29 Change the endpoint method name in feign client --- .../cloudstack/storage/feign/client/AggregateFeignClient.java | 2 +- .../apache/cloudstack/storage/feign/client/SvmFeignClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 index 58ea3713681b..28115d1e349d 100644 --- 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 @@ -16,7 +16,7 @@ @FeignClient(name="AggregateClient", url="https://{clusterIP}/api/storage/aggregates", configuration = FeignConfiguration.class) public interface AggregateFeignClient { @RequestMapping(method=RequestMethod.GET) - AggregateResponse getAllAggregates(URI baseURL,@RequestHeader("Authorization") String header); + AggregateResponse 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/SvmFeignClient.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SvmFeignClient.java index d9565668d6d9..d39e3b9ed5d9 100644 --- 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 @@ -13,7 +13,7 @@ @FeignClient(name = "SvmClient", url = "https://{clusterIP}/api/svm/svms", configuration = FeignConfiguration.class) public interface SvmFeignClient { @RequestMapping(method = RequestMethod.GET) - SvmResponse getAllSvms(URI baseURL, @RequestHeader("Authorization") String header); + SvmResponse getSvmResponse(URI baseURL, @RequestHeader("Authorization") String header); @RequestMapping(method = RequestMethod.GET, value = "/{uuid}") Svm getSvmByUUID(URI baseURL, @RequestHeader("Authorization") String header); From c35ebc86bca177c0acf89b31e16c56661947ea95 Mon Sep 17 00:00:00 2001 From: "Gupta, Surya" Date: Wed, 15 Oct 2025 08:29:34 +0530 Subject: [PATCH 03/10] CSTACKEX-29 Make the alignment proper --- .../cloudstack/storage/feign/client/AggregateFeignClient.java | 1 + .../cloudstack/storage/feign/client/ClusterFeignClient.java | 1 + .../apache/cloudstack/storage/feign/client/SvmFeignClient.java | 2 ++ 3 files changed, 4 insertions(+) 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 index 28115d1e349d..b2c862c99d78 100644 --- 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 @@ -15,6 +15,7 @@ @Lazy @FeignClient(name="AggregateClient", url="https://{clusterIP}/api/storage/aggregates", configuration = FeignConfiguration.class) public interface AggregateFeignClient { + @RequestMapping(method=RequestMethod.GET) AggregateResponse getAggregateResponse(URI baseURL, @RequestHeader("Authorization") String header); 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 index fc72812eeaae..0cb645db7975 100644 --- 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 @@ -11,6 +11,7 @@ @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 index d39e3b9ed5d9..e5c49291cd3c 100644 --- 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 @@ -12,8 +12,10 @@ @FeignClient(name = "SvmClient", url = "https://{clusterIP}/api/svm/svms", configuration = FeignConfiguration.class) public interface SvmFeignClient { + @RequestMapping(method = RequestMethod.GET) SvmResponse getSvmResponse(URI baseURL, @RequestHeader("Authorization") String header); + @RequestMapping(method = RequestMethod.GET, value = "/{uuid}") Svm getSvmByUUID(URI baseURL, @RequestHeader("Authorization") String header); From 4a42f58f1cfc266efe053724acc7f167e0eff320 Mon Sep 17 00:00:00 2001 From: "Gupta, Surya" Date: Wed, 15 Oct 2025 08:43:14 +0530 Subject: [PATCH 04/10] CSTACKEX-29 Added License Info --- .../feign/client/AggregateFeignClient.java | 19 ++++++++++++++++ .../feign/client/ClusterFeignClient.java | 19 ++++++++++++++++ .../storage/feign/client/SvmFeignClient.java | 19 ++++++++++++++++ .../feign/model/AggregateResponse.java | 22 ++++++++++++------- .../storage/feign/model/Cluster.java | 22 +++++++++++++++---- .../storage/feign/model/ClusterVersion.java | 21 ++++++++++++++---- .../storage/feign/model/SvmResponse.java | 22 ++++++++++++++----- 7 files changed, 123 insertions(+), 21 deletions(-) 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 index b2c862c99d78..b9b55a4caf58 100644 --- 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 @@ -1,3 +1,22 @@ +/* + * 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.AggregateResponse; 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 index 0cb645db7975..7758a846f361 100644 --- 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 @@ -1,3 +1,22 @@ +/* + * 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; 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 index e5c49291cd3c..5be8696cfc3b 100644 --- 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 @@ -1,3 +1,22 @@ +/* + * 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; diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java index 3551b47b5e61..02d30010c27c 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java @@ -1,16 +1,22 @@ /* - * ONTAP REST API - * ONTAP adds support for an expansive RESTful API. The documentation below provides information about the types of API calls available to you, as well as details about using each API endpoint. You can learn more about the ONTAP REST API and ONTAP in the ONTAP 9 Documentation Center: http://docs.netapp.com/ontap-9/topic/com.netapp.doc.dot-rest-api/home.html. NetApp welcomes your comments and suggestions about the ONTAP REST API and the documentation for its use.
**Using the ONTAP REST API online documentation** Each API method includes usage examples, as well as a model that displays all the required and optional properties supported by the method. Click the _Model_ link, available with each API method, to see all the required and optional properties supported by each method. + * 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 * - * OpenAPI spec version: v1 - * + * http://www.apache.org/licenses/LICENSE-2.0 * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. + * 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; 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 index fa09a729ea09..bc5045cb9e88 100644 --- 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 @@ -1,8 +1,22 @@ /* -* -* Copyright (c) 2020 Netapp, Inc. -* All rights reserved. -*/ + * 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; diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ClusterVersion.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ClusterVersion.java index d225aa600d0c..595d9fa631fe 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ClusterVersion.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ClusterVersion.java @@ -1,8 +1,21 @@ /* -* -* Copyright (c) 2020 Netapp, Inc. -* All rights reserved. -*/ + * 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; diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java index 05e66542f505..c48ef7892f5e 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java @@ -1,9 +1,21 @@ /* -* -* Copyright (c) 2020 Netapp, Inc. -* All rights reserved. -*/ - + * 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; From 287a8b030525e5101e8eac2e45c2a5400d37908c Mon Sep 17 00:00:00 2001 From: "Gupta, Surya" Date: Wed, 15 Oct 2025 15:25:13 +0530 Subject: [PATCH 05/10] CSTACKEX-29 Resolve Review Comments --- .../feign/client/AggregateFeignClient.java | 4 +- .../feign/client/ClusterFeignClient.java | 1 + .../storage/feign/client/SvmFeignClient.java | 2 +- .../storage/feign/model/Aggregate.java | 14 +- .../feign/model/AggregateResponse.java | 151 ------------------ .../storage/feign/model/Cluster.java | 58 +++---- .../cloudstack/storage/feign/model/Svm.java | 14 +- .../storage/feign/model/SvmResponse.java | 131 --------------- .../{ClusterVersion.java => Version.java} | 25 +-- .../storage/feign/model/VolumeQosPolicy.java | 5 - .../feign/model/VolumeSpaceLogicalSpace.java | 2 - .../feign/model/response/OnTapResponse.java | 69 ++++++++ 12 files changed, 113 insertions(+), 363 deletions(-) delete mode 100644 plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java delete mode 100644 plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java rename plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/{ClusterVersion.java => Version.java} (79%) create mode 100644 plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/response/OnTapResponse.java 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 index b9b55a4caf58..71da97888454 100644 --- 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 @@ -19,7 +19,6 @@ package org.apache.cloudstack.storage.feign.client; -import org.apache.cloudstack.storage.feign.model.AggregateResponse; import org.apache.cloudstack.storage.feign.model.Aggregate; import org.apache.cloudstack.storage.feign.FeignConfiguration; import org.springframework.cloud.openfeign.FeignClient; @@ -41,4 +40,5 @@ public interface AggregateFeignClient { @RequestMapping(method=RequestMethod.GET, value="/{uuid}") Aggregate getAggregateByUUID(URI baseURL,@RequestHeader("Authorization") String header, @PathVariable(name = "uuid", required = true) String uuid); -} \ No newline at end of file +} + 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 index 7758a846f361..0913ca3e2ef4 100644 --- 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 @@ -35,3 +35,4 @@ public interface ClusterFeignClient { 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 index 5be8696cfc3b..029c871e3caa 100644 --- 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 @@ -20,7 +20,6 @@ package org.apache.cloudstack.storage.feign.client; import org.apache.cloudstack.storage.feign.FeignConfiguration; -import org.apache.cloudstack.storage.feign.model.SvmResponse; import org.apache.cloudstack.storage.feign.model.Svm; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.RequestHeader; @@ -39,3 +38,4 @@ public interface SvmFeignClient { Svm getSvmByUUID(URI baseURL, @RequestHeader("Authorization") String header); } + 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 7c5b9191a662..3ded245a3c6a 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 @@ -44,13 +44,6 @@ public Aggregate name(String name) { this.name = name; return this; } - - /** - * Get name - * - * @return name - **/ - @ApiModelProperty(value = "Name of aggregate") public String getName() { return name; } @@ -64,12 +57,6 @@ public Aggregate uuid(String uuid) { return this; } - /** - * Get uuid - * - * @return uuid - **/ - @ApiModelProperty(value = "UUID of aggregate") public String getUuid() { return uuid; } @@ -109,3 +96,4 @@ public String toString() { } } + diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java deleted file mode 100644 index 02d30010c27c..000000000000 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/AggregateResponse.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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 com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModelProperty; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * AggregateResponse - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -public class AggregateResponse { - @JsonProperty("error") - private Error error = null; - @JsonProperty("num_records") - private Integer numRecords = null; - @JsonProperty("records") - private List records = null; - - public AggregateResponse error(Error error) { - this.error = error; - return this; - } - - /** - * Get error - * @return error - **/ - @ApiModelProperty(value = "") - public Error getError() { - return error; - } - - public void setError(Error error) { - this.error = error; - } - - public AggregateResponse numRecords(Integer numRecords) { - this.numRecords = numRecords; - return this; - } - - /** - * Number of records - * @return numRecords - **/ - @ApiModelProperty(value = "Number of records") - public Integer getNumRecords() { - return numRecords; - } - - public void setNumRecords(Integer numRecords) { - this.numRecords = numRecords; - } - - public AggregateResponse records(List records) { - this.records = records; - return this; - } - - public AggregateResponse addRecordsItem(Aggregate recordsItem) { - if (this.records == null) { - this.records = new ArrayList(); - } - this.records.add(recordsItem); - return this; - } - - /** - * Get records - * @return records - **/ - @ApiModelProperty(value = "") - public List getRecords() { - return records; - } - - public void setRecords(List records) { - this.records = records; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AggregateResponse aggregateResponse = (AggregateResponse) o; - return - Objects.equals(this.error, aggregateResponse.error) && - Objects.equals(this.numRecords, aggregateResponse.numRecords) && - Objects.equals(this.records, aggregateResponse.records); - } - - @Override - public int hashCode() { - return Objects.hash(error, numRecords, records); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AggregateResponse {\n"); - - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append(" numRecords: ").append(toIndentedString(numRecords)).append("\n"); - sb.append(" records: ").append(toIndentedString(records)).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/Cluster.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Cluster.java index bc5045cb9e88..1031c1979fe7 100644 --- 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 @@ -21,8 +21,8 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModelProperty; + +import java.util.Objects; /** * Complete cluster information @@ -35,7 +35,7 @@ public class Cluster { private String uuid = null; @JsonProperty("version") - private ClusterVersion version = null; + private Version version = null; @JsonProperty("health") private String health = null; @@ -45,7 +45,7 @@ public class Cluster { @JsonProperty("disaggregated") private Boolean disaggregated = null; - @ApiModelProperty(example = "healthy", value = "") + public String getHealth() { return health; } @@ -59,12 +59,7 @@ public Cluster name(String name) { return this; } - /** - * Get name - * - * @return name - **/ - @ApiModelProperty(example = "cluster1", value = "") + public String getName() { return name; } @@ -73,35 +68,24 @@ public void setName(String name) { this.name = name; } - /** - * Get uuid - * - * @return uuid - **/ - @ApiModelProperty(example = "1cd8a442-86d1-11e0-ae1c-123478563412", value = "") + public String getUuid() { return uuid; } - public Cluster version(ClusterVersion version) { + public Cluster version(Version version) { this.version = version; return this; } - /** - * Get version - * - * @return version - **/ - @ApiModelProperty(value = "") - public ClusterVersion getVersion() { + public Version getVersion() { return version; } - public void setVersion(ClusterVersion version) { + public void setVersion(Version version) { this.version = version; } - @ApiModelProperty(value = "") + public Boolean getSanOptimized() { return sanOptimized; } @@ -109,13 +93,32 @@ public Boolean getSanOptimized() { public void setSanOptimized(Boolean sanOptimized) { this.sanOptimized = sanOptimized; } - @ApiModelProperty(value = "") + 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{" + @@ -127,3 +130,4 @@ public String toString() { '}'; } } + 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 3c6f3c71df8b..183134e12486 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 @@ -53,7 +53,6 @@ public class Svm { @JsonProperty("state.value") private String state = null; - @ApiModelProperty(value = "UUID of svm") public String getUuid() { return uuid; } @@ -62,7 +61,6 @@ public void setUuid(String uuid) { this.uuid = uuid; } - @ApiModelProperty(value = "name of svm") public String getName() { return name; } @@ -71,7 +69,6 @@ public void setName(String name) { this.name = name; } - @ApiModelProperty(value = "iscsi enabled or not") public Boolean getIscsiEnabled() { return iscsiEnabled; } @@ -80,7 +77,7 @@ public void setIscsiEnabled(Boolean iscsiEnabled) { this.iscsiEnabled = iscsiEnabled; } - @ApiModelProperty(value = "fcp enabled or not") + public Boolean getFcpEnabled() { return fcpEnabled; } @@ -89,7 +86,7 @@ public void setFcpEnabled(Boolean fcpEnabled) { this.fcpEnabled = fcpEnabled; } - @ApiModelProperty(value = "nfs enabled or not") + public Boolean getNfsEnabled() { return nfsEnabled; } @@ -98,7 +95,7 @@ public void setNfsEnabled(Boolean nfsEnabled) { this.nfsEnabled = nfsEnabled; } - @ApiModelProperty(value = "list of aggregates") + public List getAggregates() { return aggregates; } @@ -107,7 +104,7 @@ public void setAggregates(List aggregates) { this.aggregates = aggregates; } - @ApiModelProperty(value = "are aggregates delegated or not") + public Boolean getAggregatesDelegated() { return aggregatesDelegated; } @@ -116,7 +113,7 @@ public void setAggregatesDelegated(Boolean aggregatesDelegated) { this.aggregatesDelegated = aggregatesDelegated; } - @ApiModelProperty(value = "state of svm") + public String getState() { return state; } @@ -137,3 +134,4 @@ public int hashCode() { return Objects.hashCode(getUuid()); } } + diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java deleted file mode 100644 index c48ef7892f5e..000000000000 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/SvmResponse.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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 com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModelProperty; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * SvmResponse - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -public class SvmResponse { - - @JsonProperty("num_records") - private Integer numRecords = null; - - @JsonProperty("records") - private List records = null; - - public SvmResponse numRecords(Integer numRecords) { - this.numRecords = numRecords; - return this; - } - - /** - * Number of records - * @return numRecords - **/ - @ApiModelProperty(value = "Number of records") - public Integer getNumRecords() { - return numRecords; - } - - public void setNumRecords(Integer numRecords) { - this.numRecords = numRecords; - } - - public SvmResponse records(List records) { - this.records = records; - return this; - } - - public SvmResponse addRecordsItem(Svm recordsItem) { - if (this.records == null) { - this.records = new ArrayList(); - } - this.records.add(recordsItem); - return this; - } - - /** - * Get records - * @return records - **/ - @ApiModelProperty(value = "") - public List getRecords() { - return records; - } - - public void setRecords(List records) { - this.records = records; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SvmResponse svmResponse = (SvmResponse) o; - return - Objects.equals(this.numRecords, svmResponse.numRecords) && - Objects.equals(this.records, svmResponse.records); - } - - @Override - public int hashCode() { - return Objects.hash(numRecords, records); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SvmResponse {\n"); - - sb.append(" numRecords: ").append(toIndentedString(numRecords)).append("\n"); - sb.append(" records: ").append(toIndentedString(records)).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/ClusterVersion.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Version.java similarity index 79% rename from plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ClusterVersion.java rename to plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Version.java index 595d9fa631fe..6a463c07c8e9 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ClusterVersion.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Version.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gson.annotations.SerializedName; import io.swagger.annotations.ApiModelProperty; import java.util.Objects; @@ -31,7 +30,7 @@ * 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 ClusterVersion { +public class Version { @JsonProperty("full") private String full = null; @@ -44,38 +43,18 @@ public class ClusterVersion { @JsonProperty("minor") private Integer minor = null; - /** - * The full cluster version string. - * @return full - **/ - @ApiModelProperty(example = "NetApp Release 9.4.0: Sun Nov 05 18:20:57 UTC 2017", value = "The full cluster version string.") public String getFull() { return full; } - /** - * The generation portion of the version. - * @return generation - **/ - @ApiModelProperty(example = "9", value = "The generation portion of the version.") public Integer getGeneration() { return generation; } - /** - * The major portion of the version. - * @return major - **/ - @ApiModelProperty(example = "4", value = "The major portion of the version.") public Integer getMajor() { return major; } - /** - * The minor portion of the version. - * @return minor - **/ - @ApiModelProperty(example = "0", value = "The minor portion of the version.") public Integer getMinor() { return minor; } @@ -89,7 +68,7 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - ClusterVersion clusterVersion = (ClusterVersion) o; + Version clusterVersion = (Version) o; return Objects.equals(this.full, clusterVersion.full) && Objects.equals(this.generation, clusterVersion.generation) && Objects.equals(this.major, clusterVersion.major) && 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..4764d1af3685 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 @@ -26,23 +26,18 @@ @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..0eec49a72401 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 @@ -27,11 +27,9 @@ 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..b1d8454617a5 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/response/OnTapResponse.java @@ -0,0 +1,69 @@ +/* + * 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 io.swagger.annotations.ApiModelProperty; +import org.apache.cloudstack.storage.feign.model.Aggregate; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * 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; + } +} + + From 5802f447bc1e400702d7e83f86222a3ccd2431a1 Mon Sep 17 00:00:00 2001 From: "Gupta, Surya" Date: Wed, 15 Oct 2025 15:29:28 +0530 Subject: [PATCH 06/10] CSTACKEX-29 Remove Component Annotation from datastoredriverclass --- .../cloudstack/storage/driver/OntapPrimaryDatastoreDriver.java | 1 - .../cloudstack/storage/feign/client/AggregateFeignClient.java | 3 ++- .../apache/cloudstack/storage/feign/client/SvmFeignClient.java | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) 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..b566d8056ce4 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 @@ -44,7 +44,6 @@ 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 index 71da97888454..1f77a0366228 100644 --- 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 @@ -21,6 +21,7 @@ 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; @@ -35,7 +36,7 @@ public interface AggregateFeignClient { @RequestMapping(method=RequestMethod.GET) - AggregateResponse getAggregateResponse(URI baseURL, @RequestHeader("Authorization") String header); + 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/SvmFeignClient.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SvmFeignClient.java index 029c871e3caa..b84d46b1a454 100644 --- 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 @@ -21,6 +21,7 @@ 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; @@ -32,7 +33,7 @@ public interface SvmFeignClient { @RequestMapping(method = RequestMethod.GET) - SvmResponse getSvmResponse(URI baseURL, @RequestHeader("Authorization") String header); + OnTapResponse getSvmResponse(URI baseURL, @RequestHeader("Authorization") String header); @RequestMapping(method = RequestMethod.GET, value = "/{uuid}") Svm getSvmByUUID(URI baseURL, @RequestHeader("Authorization") String header); From 0363ab52a58d3386def7031b71cbec2e702e9e8d Mon Sep 17 00:00:00 2001 From: "Gupta, Surya" Date: Wed, 15 Oct 2025 19:58:21 +0530 Subject: [PATCH 07/10] CSTACKEX-29 Resolve Style check issues --- .../storage/driver/OntapPrimaryDatastoreDriver.java | 1 - .../storage/feign/client/AggregateFeignClient.java | 1 - .../cloudstack/storage/feign/client/SvmFeignClient.java | 1 - .../org/apache/cloudstack/storage/feign/model/Aggregate.java | 2 -- .../org/apache/cloudstack/storage/feign/model/Cluster.java | 1 - .../java/org/apache/cloudstack/storage/feign/model/Svm.java | 2 -- .../org/apache/cloudstack/storage/feign/model/Version.java | 2 -- .../cloudstack/storage/feign/model/VolumeQosPolicy.java | 1 - .../storage/feign/model/VolumeSpaceLogicalSpace.java | 1 - .../storage/feign/model/response/OnTapResponse.java | 5 ----- 10 files changed, 17 deletions(-) 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 b566d8056ce4..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,7 +39,6 @@ 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; 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 index 1f77a0366228..ab437324c77b 100644 --- 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 @@ -34,7 +34,6 @@ @Lazy @FeignClient(name="AggregateClient", url="https://{clusterIP}/api/storage/aggregates", configuration = FeignConfiguration.class) public interface AggregateFeignClient { - @RequestMapping(method=RequestMethod.GET) OnTapResponse getAggregateResponse(URI baseURL, @RequestHeader("Authorization") String header); 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 index b84d46b1a454..52ba1cb58fc2 100644 --- 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 @@ -31,7 +31,6 @@ @FeignClient(name = "SvmClient", url = "https://{clusterIP}/api/svm/svms", configuration = FeignConfiguration.class) public interface SvmFeignClient { - @RequestMapping(method = RequestMethod.GET) OnTapResponse getSvmResponse(URI baseURL, @RequestHeader("Authorization") String header); 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 3ded245a3c6a..1d3d262eac82 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 @@ -21,8 +21,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModelProperty; import java.util.Objects; 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 index 1031c1979fe7..465ce3b11d0a 100644 --- 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 @@ -118,7 +118,6 @@ public boolean equals(java.lang.Object o) { return Objects.equals(this.name, cluster.name) && Objects.equals(this.uuid, cluster.uuid); } - @Override public String toString() { return "Cluster{" + 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 183134e12486..532540493139 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,8 +21,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gson.annotations.SerializedName; -import io.swagger.annotations.ApiModelProperty; import java.util.List; import java.util.Objects; 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 index 6a463c07c8e9..173751527bd4 100644 --- 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 @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; import java.util.Objects; @@ -85,7 +84,6 @@ public int hashCode() { 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"); 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 4764d1af3685..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,7 +21,6 @@ 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 { 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 0eec49a72401..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,7 +21,6 @@ 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 { 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 index b1d8454617a5..e86c2fc4b032 100644 --- 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 @@ -21,12 +21,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; -import org.apache.cloudstack.storage.feign.model.Aggregate; - -import java.util.ArrayList; import java.util.List; -import java.util.Objects; /** * OnTapResponse From a74c021ec2379b65fbfc2edd2e00da42c1af9f71 Mon Sep 17 00:00:00 2001 From: "Gupta, Surya" Date: Wed, 15 Oct 2025 20:41:29 +0530 Subject: [PATCH 08/10] CSTACKEX-29 Resolve ALL Style issues --- .../feign/client/AggregateFeignClient.java | 9 +- .../storage/feign/client/SvmFeignClient.java | 9 +- .../storage/feign/model/Cluster.java | 199 +++++++++--------- 3 files changed, 110 insertions(+), 107 deletions(-) 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 index ab437324c77b..bfac10bd1f73 100644 --- 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 @@ -34,11 +34,12 @@ @Lazy @FeignClient(name="AggregateClient", url="https://{clusterIP}/api/storage/aggregates", configuration = FeignConfiguration.class) public interface AggregateFeignClient { - @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); + @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/SvmFeignClient.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SvmFeignClient.java index 52ba1cb58fc2..d1847f37072b 100644 --- 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 @@ -31,11 +31,12 @@ @FeignClient(name = "SvmClient", url = "https://{clusterIP}/api/svm/svms", configuration = FeignConfiguration.class) public interface SvmFeignClient { - @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); + @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/model/Cluster.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Cluster.java index 465ce3b11d0a..d6f5652a87f0 100644 --- 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 @@ -27,106 +27,107 @@ /** * 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 + - '}'; - } + + @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 + + '}'; + } } From 8de7034ac0dbb302c4a988d56304f851951f73be Mon Sep 17 00:00:00 2001 From: "Gupta, Surya" Date: Wed, 15 Oct 2025 20:52:20 +0530 Subject: [PATCH 09/10] CSTACKEX-29 Resolve Precommits Issues --- .../cloudstack/storage/feign/client/AggregateFeignClient.java | 1 - .../cloudstack/storage/feign/client/ClusterFeignClient.java | 1 - .../apache/cloudstack/storage/feign/client/SvmFeignClient.java | 1 - .../org/apache/cloudstack/storage/feign/model/Aggregate.java | 1 - .../java/org/apache/cloudstack/storage/feign/model/Cluster.java | 1 - .../java/org/apache/cloudstack/storage/feign/model/Svm.java | 1 - .../java/org/apache/cloudstack/storage/feign/model/Version.java | 1 - .../cloudstack/storage/feign/model/response/OnTapResponse.java | 2 -- 8 files changed, 9 deletions(-) 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 index bfac10bd1f73..b27e7048b9f8 100644 --- 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 @@ -42,4 +42,3 @@ public interface AggregateFeignClient { 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 index 0913ca3e2ef4..7758a846f361 100644 --- 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 @@ -35,4 +35,3 @@ public interface ClusterFeignClient { 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 index d1847f37072b..5f0c78f6084e 100644 --- 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 @@ -39,4 +39,3 @@ public interface SvmFeignClient { Svm getSvmByUUID(URI baseURL, @RequestHeader("Authorization") String header); } - 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 1d3d262eac82..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 @@ -94,4 +94,3 @@ public String toString() { } } - 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 index d6f5652a87f0..9dcf8aa738c1 100644 --- 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 @@ -130,4 +130,3 @@ public String toString() { '}'; } } - 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 532540493139..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 @@ -132,4 +132,3 @@ public int hashCode() { return Objects.hashCode(getUuid()); } } - 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 index 173751527bd4..056e20eb3400 100644 --- 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 @@ -104,4 +104,3 @@ private String toIndentedString(Object o) { } } - 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 index e86c2fc4b032..e91f271f58d4 100644 --- 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 @@ -60,5 +60,3 @@ public void setRecords(List records) { this.numRecords = (records != null) ? records.size() : 0; } } - - From 9ceeb10c2e051493bc8231507ee95e95090d7dfc Mon Sep 17 00:00:00 2001 From: "Gupta, Surya" Date: Thu, 16 Oct 2025 10:14:53 +0530 Subject: [PATCH 10/10] CSTACKEX-29 Added Method comments and change the ontap response class name --- .../storage/feign/client/AggregateFeignClient.java | 5 +++-- .../cloudstack/storage/feign/client/SvmFeignClient.java | 5 +++-- .../response/{OnTapResponse.java => OntapResponse.java} | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) rename plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/response/{OnTapResponse.java => OntapResponse.java} (94%) 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 index b27e7048b9f8..ed57bf419405 100644 --- 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 @@ -21,7 +21,7 @@ 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.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; @@ -35,8 +35,9 @@ @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); + 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/SvmFeignClient.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SvmFeignClient.java index 5f0c78f6084e..52ee30d71c8a 100644 --- 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 @@ -21,7 +21,7 @@ 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.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; @@ -32,8 +32,9 @@ @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); + 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/model/response/OnTapResponse.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/response/OntapResponse.java similarity index 94% rename from plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/response/OnTapResponse.java rename to plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/response/OntapResponse.java index e91f271f58d4..933c1ec0bdf4 100644 --- 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 @@ -27,18 +27,18 @@ * OnTapResponse */ @JsonInclude(JsonInclude.Include.NON_NULL) -public class OnTapResponse { +public class OntapResponse { @JsonProperty("num_records") private Integer numRecords; @JsonProperty("records") private List records; - public OnTapResponse() { + public OntapResponse () { // Default constructor } - public OnTapResponse(List records) { + public OntapResponse (List records) { this.records = records; this.numRecords = (records != null) ? records.size() : 0; }