Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c7b0005
UI support for extraconfig in deploy and update instance (#11719)
abh1sar Sep 30, 2025
c822028
CKS: generate a random UUID as password of CKS user in project (#11639)
weizhouapache Oct 1, 2025
1f436b6
server: Consider Instance in Starting state as well for allocation al…
sudo87 Oct 2, 2025
23dbe3c
CKS: fix CKS creation on an existing Shared and Routed network (#11735)
weizhouapache Oct 3, 2025
6da9414
VMware: match nic mac for ip address fetch (#10641)
alexandru-bagu Oct 4, 2025
9e46ee1
server: add user.password.reset.smtp.useStartTLS and enabledSecurityP…
weizhouapache Oct 7, 2025
77247b1
server: do not enable the disabled local storage(s) on host connectio…
sureshanaparti Oct 7, 2025
1fc1a5d
linstor: use sparse/discard qemu-img convert on thin devices (#11787)
rp- Oct 6, 2025
0c61d97
Add support for providing userdata to system VMs (#11654)
vishesh92 Oct 8, 2025
6f74ebf
Storage pool response improvements (#10740)
sureshanaparti Oct 8, 2025
4a9b4a4
refactor: remove use of term entry-point from extensions code base (#…
shwstppr Oct 8, 2025
39ef8f6
Add `Hypervisor default` as cache mode for disk offerings (#10282)
hsato03 Oct 8, 2025
572c520
systemvmtemplate: Bump Debian version to 12.12.0 (#11778)
weizhouapache Oct 8, 2025
9b8d822
UI: Deal with crosssite api call after login (#10533)
DaanHoogland Oct 8, 2025
1b6436d
UI: Fix primary storage for datastore cluster and retain traffic labe…
sudo87 Oct 8, 2025
2392bc8
Sanitize the rbd file cmd parameter logs during qemu-img convert (thr…
sureshanaparti Oct 8, 2025
53370cf
storage: change storage pool to Up state when cancel storage migratio…
weizhouapache Oct 8, 2025
80a3c0b
Initial primary storage pool plugin skeleton
Sep 30, 2025
db371e2
Initial primary storage pool plugin skeleton - added license string
rajiv-jain-netapp Oct 8, 2025
9bb758a
Initial primary storage pool plugin skeleton - added license string +…
rajiv-jain-netapp Oct 8, 2025
25fb255
Initial primary storage pool plugin skeleton - added license string +…
rajiv-jain-netapp Oct 8, 2025
6d933e8
Feignconfiguration and volume feignClient along with desired POJOs
rajiv-jain-netapp Oct 13, 2025
f07a444
Feignconfiguration and volume feignClient along with desired POJOs
rajiv-jain-netapp Oct 13, 2025
43867e6
Revert "Feignconfiguration and volume feignClient along with desired …
rajiv-jain-netapp Oct 13, 2025
4f57cd2
Revert "Feignconfiguration and volume feignClient along with desired …
rajiv-jain-netapp Oct 13, 2025
bd4a23a
Feignconfiguration and volume feignClient along with desired POJOs
rajiv-jain-netapp Oct 13, 2025
1bb907f
Feignconfiguration and volume feignClient along with desired POJOs
rajiv-jain-netapp Oct 13, 2025
3327c15
CSTACKEX-28: added copyright comment in the logger configuration
rajiv-jain-netapp Oct 13, 2025
35ccaab
CSTACKEX-28: added newline in the end of the file
rajiv-jain-netapp Oct 13, 2025
b4c2f30
CSTACKEX-28 - incorporated review comments
rajiv-jain-netapp Oct 14, 2025
8e4efd1
Cluster, SVM and Aggr Feign Client
suryag1201 Oct 16, 2025
d8b98ed
NAS and Job Feign Client
suryag1201 Oct 17, 2025
a20dc4e
# This is a combination of 11 commits. This is a combination of 10 c…
Oct 10, 2025
572a1d5
CSTACKEX-25: Basic class structure
Oct 17, 2025
0be388b
CSTACKEX-25: Added code for job polling and addressed the review comm…
Oct 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Feignconfiguration and volume feignClient along with desired POJOs
  • Loading branch information
rajiv-jain-netapp authored and Locharla, Sandeep committed Oct 21, 2025
commit bd4a23a853bb66710a194e734a5bc735e49b931d
48 changes: 48 additions & 0 deletions plugins/storage/volume/ontap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
<version>4.22.0.0-SNAPSHOT</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<properties>
<spring-cloud.version>2021.0.7</spring-cloud.version>
<openfeign.version>11.0</openfeign.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
Expand All @@ -38,14 +53,47 @@
<artifactId>json</artifactId>
<version>20230227</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-crypto</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-httpclient</artifactId>
<version>${openfeign.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-engine-storage-volume</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.6.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package org.apache.cloudstack.storage.feign;


import feign.RequestInterceptor;
import feign.RequestTemplate;
import feign.Retryer;
import org.springframework.cloud.commons.httpclient.ApacheHttpClientFactory;
import org.apache.http.conn.ConnectionKeepAliveStrategy;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.TrustAllStrategy;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.ssl.SSLContexts;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import feign.Client;
import feign.httpclient.ApacheHttpClient;
import javax.net.ssl.SSLContext;
import java.util.concurrent.TimeUnit;

@Configuration
public class FeignConfiguration {
private static Logger logger = LogManager.getLogger(FeignConfiguration.class);

private int retryMaxAttempt = 3;

private int retryMaxInterval = 5;

private String ontapFeignMaxConnection = "80";

private String ontapFeignMaxConnectionPerRoute = "20";

@Bean
public Client client(ApacheHttpClientFactory httpClientFactory) {

int maxConn;
int maxConnPerRoute;
try {
maxConn = Integer.parseInt(this.ontapFeignMaxConnection);
} catch (Exception e) {
logger.error("ontapFeignClient: encounter exception while parse the max connection from env. setting default value");
maxConn = 20;
}
try {
maxConnPerRoute = Integer.parseInt(this.ontapFeignMaxConnectionPerRoute);
} catch (Exception e) {
logger.error("ontapFeignClient: encounter exception while parse the max connection per route from env. setting default value");
maxConnPerRoute = 2;
}
// Disable Keep Alive for Http Connection
logger.debug("ontapFeignClient: Setting the feign client config values as max connection: {}, max connections per route: {}", maxConn, maxConnPerRoute);
ConnectionKeepAliveStrategy keepAliveStrategy = (response, context) -> 0;
CloseableHttpClient httpClient = httpClientFactory.createBuilder()
.setMaxConnTotal(maxConn)
.setMaxConnPerRoute(maxConnPerRoute)
.setKeepAliveStrategy(keepAliveStrategy)
.setSSLSocketFactory(getSSLSocketFactory())
.setConnectionTimeToLive(60, TimeUnit.SECONDS)
.build();
return new ApacheHttpClient(httpClient);
}

private SSLConnectionSocketFactory getSSLSocketFactory() {
try {
// The TrustAllStrategy is a strategy used in SSL context configuration that accepts any certificate
SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustAllStrategy()).build();
return new SSLConnectionSocketFactory(sslContext, new NoopHostnameVerifier());
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}


@Bean
public RequestInterceptor requestInterceptor() {
return new RequestInterceptor() {
@Override
public void apply(RequestTemplate template) {
logger.info("Feign Request URL: {}", template.url());
logger.info("HTTP Method: {}", template.method());
logger.info("Headers: {}", template.headers());
logger.info("Body: {}", template.requestBody().asString());
}
};
}

@Bean
public Retryer feignRetryer() {
return new Retryer.Default(1000L, retryMaxInterval * 1000L, retryMaxAttempt);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.apache.cloudstack.storage.feign.client;


import org.apache.cloudstack.storage.feign.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;


@FeignClient(name = "VolumeClient", url = "https://{clusterIP}/api/storage/volumes", configuration = FeignConfiguration.class)
public interface VolumeFeignClient {

@DeleteMapping("/storage/volumes/{id}")
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
);

@GetMapping("/api/storage/volumes/{uuid}")
org.apache.cloudstack.storage.feign.model.response.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,
@PathVariable("uuid") String uuid,
@RequestBody org.apache.cloudstack.storage.feign.model.request.VolumeRequestDTO request
);


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package org.apache.cloudstack.storage.feign.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.google.gson.annotations.SerializedName;

import java.util.Objects;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class Aggregate {

@SerializedName("name")
private String name = null;

@SerializedName("uuid")
private String uuid = null;

public Aggregate name(String name) {
this.name = name;
return this;
}

/**
* Get name
*
* @return name
**/
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Aggregate uuid(String uuid) {
this.uuid = uuid;
return this;
}

/**
* Get uuid
*
* @return uuid
**/
public String getUuid() {
return uuid;
}

public void setUuid(String uuid) {
this.uuid = uuid;
}


@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Aggregate diskAggregates = (Aggregate) o;
return Objects.equals(this.name, diskAggregates.name) &&
Objects.equals(this.uuid, diskAggregates.uuid);
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

@Override
public String toString() {
return "DiskAggregates [name=" + name + ", uuid=" + uuid + "]";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// AntiRansomware.java
package org.apache.cloudstack.storage.feign.model;

import com.fasterxml.jackson.annotation.JsonProperty;

public class AntiRansomware {
@JsonProperty("state")
private String state;

// Getters and setters
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// ExportPolicy.java
package org.apache.cloudstack.storage.feign.model;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class ExportPolicy {
private String name;
private long id;
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public long getId() { return id; }
public void setId(long id) { this.id = id; }
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Nas.java
package org.apache.cloudstack.storage.feign.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class Nas {
@JsonProperty("path")
private String path;

@JsonProperty("export_policy")
private ExportPolicy exportPolicy;

// Getters and setters
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

package org.apache.cloudstack.storage.feign.model;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class Policy {
private int minThroughputIops;
private int minThroughputMbps;
private int maxThroughputIops;
private int maxThroughputMbps;
private String uuid;
private String name;
public int getMinThroughputIops() { return minThroughputIops; }
public void setMinThroughputIops(int minThroughputIops) { this.minThroughputIops = minThroughputIops; }
public int getMinThroughputMbps() { return minThroughputMbps; }
public void setMinThroughputMbps(int minThroughputMbps) { this.minThroughputMbps = minThroughputMbps; }
public int getMaxThroughputIops() { return maxThroughputIops; }
public void setMaxThroughputIops(int maxThroughputIops) { this.maxThroughputIops = maxThroughputIops; }
public int getMaxThroughputMbps() { return maxThroughputMbps; }
public void setMaxThroughputMbps(int maxThroughputMbps) { this.maxThroughputMbps = maxThroughputMbps; }
public String getUuid() { return uuid; }
public void setUuid(String uuid) { this.uuid = uuid; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Qos.java
package org.apache.cloudstack.storage.feign.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class Qos {
@JsonProperty("policy")
private Policy policy;

// Getters and setters
}
Loading