Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions plugins/storage/volume/ontap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
<httpclient.version>4.5.14</httpclient.version>
<swagger-annotations.version>1.6.2</swagger-annotations.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<jackson-databind.version>2.13.4</jackson-databind.version>
<assertj.version>3.24.2</assertj.version>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
Expand Down Expand Up @@ -95,7 +94,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit-jupiter.version}</version>
<version>${cs.junit.jupiter.version}</version>
<scope>test</scope>
</dependency>

Expand All @@ -121,7 +120,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<version>${cs.assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -151,7 +150,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<version>${cs.surefire-plugin.version}</version>
<configuration>
<includes>
<include>**/*Test.java</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@

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

import java.util.Map;

import org.apache.cloudstack.storage.feign.model.Aggregate;
import org.apache.cloudstack.storage.feign.model.response.OntapResponse;

import feign.Headers;
import feign.Param;
import feign.QueryMap;
import feign.RequestLine;

public interface AggregateFeignClient {
Expand All @@ -33,5 +37,6 @@ public interface AggregateFeignClient {

@RequestLine("GET /api/storage/aggregates/{uuid}")
@Headers({"Authorization: {authHeader}"})
Aggregate getAggregateByUUID(@Param("authHeader") String authHeader, @Param("uuid") String uuid);
Aggregate getAggregateByUUID(@Param("authHeader") String authHeader, @Param("uuid") String uuid,
@QueryMap Map<String, Object> queryParams);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

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

import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

import java.util.Objects;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Aggregate {
Expand Down Expand Up @@ -77,6 +77,17 @@ public int hashCode() {
@JsonProperty("space")
private AggregateSpace space = null;

@JsonProperty("node")
private Node node = null;


public Node getNode() {
return node;
}

public void setNode(Node node) {
this.node = node;
}

public Aggregate name(String name) {
this.name = name;
Expand Down Expand Up @@ -107,10 +118,18 @@ public StateEnum getState() {
return state;
}

public void setState(StateEnum state) {
this.state = state;
}

public AggregateSpace getSpace() {
return space;
}

public void setSpace(AggregateSpace space) {
this.space = space;
}

public Double getAvailableBlockStorageSpace() {
if (space != null && space.blockStorage != null) {
return space.blockStorage.available;
Expand Down Expand Up @@ -148,9 +167,32 @@ public String toString() {
return "DiskAggregates [name=" + name + ", uuid=" + uuid + "]";
}

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class Node {
@JsonProperty("name")
private String name;

public String getName() {
return name;
}

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

public static class AggregateSpace {
@JsonProperty("block_storage")
private AggregateSpaceBlockStorage blockStorage = null;

public AggregateSpaceBlockStorage getBlockStorage() {
return blockStorage;
}

public void setBlockStorage(AggregateSpaceBlockStorage blockStorage) {
this.blockStorage = blockStorage;
}
}

public static class AggregateSpaceBlockStorage {
Expand All @@ -160,6 +202,14 @@ public static class AggregateSpaceBlockStorage {
private Double size = null;
@JsonProperty("used")
private Double used = null;

public Double getAvailable() {
return available;
}

public void setAvailable(Double available) {
this.available = available;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

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

import java.util.List;
import java.util.Objects;

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

import java.util.List;
import java.util.Objects;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class IpInterface {
Expand All @@ -44,6 +44,15 @@ public class IpInterface {
@JsonProperty("services")
private List<String> services;

@JsonProperty("state")
private String state;

@JsonProperty("enabled")
private Boolean enabled;

@JsonProperty("location")
private Location location;

// Getters and setters
public String getUuid() {
return uuid;
Expand Down Expand Up @@ -85,6 +94,30 @@ public void setServices(List<String> services) {
this.services = services;
}

public String getState() {
return state;
}

public void setState(String state) {
this.state = state;
}

public Boolean getEnabled() {
return enabled;
}

public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}

public Location getLocation() {
return location;
}

public void setLocation(Location location) {
this.location = location;
}

@Override
public boolean equals(Object o) {
if (this == o) {
Expand All @@ -98,12 +131,14 @@ public boolean equals(Object o) {
Objects.equals(name, that.name) &&
Objects.equals(ip, that.ip) &&
Objects.equals(svm, that.svm) &&
Objects.equals(services, that.services);
Objects.equals(services, that.services) &&
Objects.equals(state, that.state) &&
Objects.equals(enabled, that.enabled);
}

@Override
public int hashCode() {
return Objects.hash(uuid, name, ip, svm, services);
return Objects.hash(uuid, name, ip, svm, services, state, enabled);
}

@Override
Expand All @@ -114,9 +149,52 @@ public String toString() {
", ip=" + ip +
", svm=" + svm +
", services=" + services +
", state='" + state + '\'' +
", enabled=" + enabled +
'}';
}

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class Node {
@JsonProperty("name")
private String name;

public String getName() {
return name;
}

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

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public static class Location {
@JsonProperty("home_node")
private Node homeNode;

@JsonProperty("node")
private Node node;

public Node getHomeNode() {
return homeNode;
}

public void setHomeNode(Node homeNode) {
this.homeNode = homeNode;
}

public Node getNode() {
return node;
}

public void setNode(Node node) {
this.node = node;
}
}

// Nested class for IP information
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
Expand Down
Loading
Loading