diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SANFeignClient.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SANFeignClient.java new file mode 100644 index 000000000000..325823f8515c --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/client/SANFeignClient.java @@ -0,0 +1,91 @@ +/* + * 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.Igroup; +import org.apache.cloudstack.storage.feign.model.Lun; +import org.apache.cloudstack.storage.feign.FeignConfiguration; +import org.apache.cloudstack.storage.feign.model.LunMap; +import org.apache.cloudstack.storage.feign.model.response.OntapResponse; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.context.annotation.Lazy; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestHeader; + +import java.net.URI; + +@Lazy +@FeignClient(name = "SANClient", url = "", configuration = FeignConfiguration.class ) +public interface SANFeignClient { + + //Lun Operation APIs + @RequestMapping(method = RequestMethod.POST) + OntapResponse createLun(URI baseURL, @RequestHeader("Authorization") String authHeader, @RequestHeader("return_records") boolean value, + @RequestBody Lun lun); + + //this method to get all luns and also filtered luns based on query params as a part of URL + @RequestMapping(method = RequestMethod.GET) + OntapResponse getLunResponse(URI baseURL, @RequestHeader("Authorization") String authHeader); + + @RequestMapping(method = RequestMethod.GET, value = "/{uuid}") + Lun getLunByUUID(URI baseURL, @RequestHeader("Authorization") String authHeader, @PathVariable(name="uuid", required=true) String uuid); + + @RequestMapping(method = RequestMethod.PATCH, value = "/{uuid}") + void updateLun(URI uri, @RequestHeader("Authorization") String authHeader, @PathVariable(name="uuid", required=true) String uuid, + @RequestBody Lun lun); + + @RequestMapping(method = RequestMethod.DELETE, value = "/{uuid}") + void deleteLun(URI baseURL, @RequestHeader("Authorization") String authHeader, @PathVariable(name="uuid", required=true) String uuid); + + + //iGroup Operation APIs + + @RequestMapping(method = RequestMethod.POST) + OntapResponse createIgroup(URI uri, @RequestHeader("Authorization") String header, @RequestHeader("return_records") boolean value, + @RequestBody Igroup igroupRequest); + + //this method to get all igroups and also filtered igroups based on query params as a part of URL + @RequestMapping(method = RequestMethod.GET) + OntapResponse getIgroupResponse(URI baseURL, @RequestHeader("Authorization") String header, @PathVariable(name = "uuid", required = true) String uuid); + @RequestMapping(method = RequestMethod.GET, value = "/{uuid}") + Igroup getIgroupByUUID(URI baseURL, @RequestHeader("Authorization") String header, @PathVariable(name = "uuid", required = true) String uuid); + @RequestMapping(method = RequestMethod.DELETE, value = "/{uuid}") + void deleteIgroup(URI baseUri, @RequestHeader("Authorization") String authHeader, @PathVariable(name = "uuid", required = true) String uuid); + + @RequestMapping(method = RequestMethod.POST, value = "/{uuid}/igroups") + OntapResponse addNestedIgroups(URI uri, @RequestHeader("Authorization") String header, @PathVariable(name = "uuid", required = true) String uuid, + @RequestBody Igroup igroupNestedRequest, @RequestHeader(value="return_records", defaultValue = "true") boolean value); + + + //Lun Maps Operation APIs + + @RequestMapping(method = RequestMethod.POST) + OntapResponse createLunMap(URI baseURL, @RequestHeader("Authorization") String authHeader, @RequestBody LunMap lunMap); + + @RequestMapping(method = RequestMethod.GET) + OntapResponse getLunMapResponse(URI baseURL, @RequestHeader("Authorization") String authHeader); + + @RequestMapping(method = RequestMethod.GET, value = "/{lun.uuid}/{igroup.uuid}") + void deleteLunMap(URI baseURL, @RequestHeader("Authorization") String authHeader, @PathVariable(name="lun.uuid", required=true) String uuid, + @PathVariable(name="igroup.uuid", required=true) String igroupUUID); + +} diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ExportPolicy.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ExportPolicy.java index be78639844b3..ab0ed0b9e356 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ExportPolicy.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/ExportPolicy.java @@ -96,7 +96,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash( id, name, rules, svm); + return Objects.hash( id, name); } diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/FileInfo.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/FileInfo.java index b67704435a9e..973e957ada63 100644 --- a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/FileInfo.java +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/FileInfo.java @@ -255,7 +255,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(bytesUsed, creationTime, fillEnabled, isEmpty, isSnapshot, isVmAligned, modifiedTime, name, overwriteEnabled, path, size, target, type, uniqueBytes, unixPermissions); + return Objects.hash(name, path); } diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Igroup.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Igroup.java new file mode 100644 index 000000000000..3ddde89f9184 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Igroup.java @@ -0,0 +1,255 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cloudstack.storage.feign.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Igroup { + @JsonProperty("delete_on_unmap") + private Boolean deleteOnUnmap = null; + @JsonProperty("initiators") + private List initiators = null; + @JsonProperty("lun_maps") + private List lunMaps = null; + @JsonProperty("os_type") + private OsTypeEnum osType = null; + + @JsonProperty("parent_igroups") + private List parentIgroups = null; + + @JsonProperty("igroups") + private List igroups = null; + + @JsonProperty("name") + private String name = null; + + @JsonProperty("protocol") + private ProtocolEnum protocol = ProtocolEnum.mixed; + @JsonProperty("svm") + private Svm svm = null; + @JsonProperty("uuid") + private String uuid = null; + + public enum OsTypeEnum { + hyper_v("hyper_v"), + + linux("linux"), + + vmware("vmware"), + + windows("windows"), + + xen("xen"); + + private String value; + + OsTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OsTypeEnum fromValue(String text) { + for (OsTypeEnum b : OsTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + + public List getParentIgroups() { + return parentIgroups; + } + + public void setParentIgroups(List parentIgroups) { + this.parentIgroups = parentIgroups; + } + + public Igroup igroups(List igroups) { + this.igroups = igroups; + return this; + } + + public List getIgroups() { + return igroups; + } + + public void setIgroups(List igroups) { + this.igroups = igroups; + } + + public enum ProtocolEnum { + iscsi("iscsi"), + + mixed("mixed"); + + private String value; + + ProtocolEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ProtocolEnum fromValue(String text) { + for (ProtocolEnum b : ProtocolEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + } + public Igroup deleteOnUnmap(Boolean deleteOnUnmap) { + this.deleteOnUnmap = deleteOnUnmap; + return this; + } + + public Boolean isDeleteOnUnmap() { + return deleteOnUnmap; + } + + public void setDeleteOnUnmap(Boolean deleteOnUnmap) { + this.deleteOnUnmap = deleteOnUnmap; + } + + public Igroup initiators(List initiators) { + this.initiators = initiators; + return this; + } + public List getInitiators() { + return initiators; + } + + public void setInitiators(List initiators) { + this.initiators = initiators; + } + + public Igroup lunMaps(List lunMaps) { + this.lunMaps = lunMaps; + return this; + } + public List getLunMaps() { + return lunMaps; + } + + public void setLunMaps(List lunMaps) { + this.lunMaps = lunMaps; + } + + public Igroup name(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public Igroup osType(OsTypeEnum osType) { + this.osType = osType; + return this; + } + public OsTypeEnum getOsType() { + return osType; + } + + public void setOsType(OsTypeEnum osType) { + this.osType = osType; + } + + public Igroup protocol(ProtocolEnum protocol) { + this.protocol = protocol; + return this; + } + + public ProtocolEnum getProtocol() { + return protocol; + } + + public void setProtocol(ProtocolEnum protocol) { + this.protocol = protocol; + } + + public Igroup svm(Svm svm) { + this.svm = svm; + return this; + } + public Svm getSvm() { + return svm; + } + + public void setSvm(Svm svm) { + this.svm = svm; + } + + public String getUuid() { + return uuid; + } + + @Override + public int hashCode() { + return Objects.hash(name, uuid); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Igroup other = (Igroup) obj; + return Objects.equals(name, other.name) && Objects.equals(uuid, other.uuid); + } + + @Override + public String toString() { + return "Igroup [deleteOnUnmap=" + deleteOnUnmap + ", initiators=" + initiators + ", lunMaps=" + lunMaps + + ", name=" + name + ", replication=" + ", osType=" + osType + ", parentIgroups=" + + parentIgroups + ", igroups=" + igroups + ", protocol=" + protocol + ", svm=" + svm + ", uuid=" + uuid + + ", portset=" + "]"; + } +} diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Initiator.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Initiator.java new file mode 100644 index 000000000000..dc290bdc2fc9 --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Initiator.java @@ -0,0 +1,36 @@ +/* + * 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; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Initiator { + @JsonProperty("name") + private String name = null; + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Lun.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Lun.java new file mode 100644 index 000000000000..d8f66106dd5c --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/Lun.java @@ -0,0 +1,296 @@ +/* + * 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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +import java.util.List; +import java.util.Objects; + +/** + * A LUN is the logical representation of storage in a storage area network (SAN).<br/> In ONTAP, a LUN is located within a volume. Optionally, it can be located within a qtree in a volume.<br/> A LUN can be created to a specified size using thin or thick provisioning. A LUN can then be renamed, resized, cloned, and moved to a different volume. LUNs support the assignment of a quality of service (QoS) policy for performance management or a QoS policy can be assigned to the volume containing the LUN. See the LUN object model to learn more about each of the properties supported by the LUN REST API.<br/> A LUN must be mapped to an initiator group to grant access to the initiator group's initiators (client hosts). Initiators can then access the LUN and perform I/O over a Fibre Channel (FC) fabric using the Fibre Channel Protocol or a TCP/IP network using iSCSI. + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Lun { + + @JsonProperty("auto_delete") + private Boolean autoDelete = null; + + /** + * The class of LUN.<br/> Optional in POST. + */ + public enum PropertyClassEnum { + REGULAR("regular"); + + private String value; + + PropertyClassEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static PropertyClassEnum fromValue(String value) { + for (PropertyClassEnum b : PropertyClassEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("class") + private PropertyClassEnum propertyClass = null; + + @JsonProperty("enabled") + private Boolean enabled = null; + + @JsonProperty("lun_maps") + private List lunMaps = null; + + @JsonProperty("name") + private String name = null; + + /** + * The operating system type of the LUN.<br/> Required in POST when creating a LUN that is not a clone of another. Disallowed in POST when creating a LUN clone. + */ + public enum OsTypeEnum { + HYPER_V("hyper_v"), + + LINUX("linux"), + + VMWARE("vmware"), + + WINDOWS("windows"), + + XEN("xen"); + + private String value; + + OsTypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OsTypeEnum fromValue(String value) { + for (OsTypeEnum b : OsTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("os_type") + private OsTypeEnum osType = null; + + @JsonProperty("serial_number") + private String serialNumber = null; + + @JsonProperty("space") + private LunSpace space = null; + + @JsonProperty("svm") + private Svm svm = null; + + @JsonProperty("uuid") + private String uuid = null; + + public Lun autoDelete(Boolean autoDelete) { + this.autoDelete = autoDelete; + return this; + } + + public Boolean isAutoDelete() { + return autoDelete; + } + + public void setAutoDelete(Boolean autoDelete) { + this.autoDelete = autoDelete; + } + + public Lun propertyClass(PropertyClassEnum propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + public PropertyClassEnum getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(PropertyClassEnum propertyClass) { + this.propertyClass = propertyClass; + } + + public Lun enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + public Boolean isEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public List getLunMaps() { + return lunMaps; + } + + public void setLunMaps(List lunMaps) { + this.lunMaps = lunMaps; + } + + public Lun name(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Lun osType(OsTypeEnum osType) { + this.osType = osType; + return this; + } + + public OsTypeEnum getOsType() { + return osType; + } + + public void setOsType(OsTypeEnum osType) { + this.osType = osType; + } + + public String getSerialNumber() { + return serialNumber; + } + + public Lun space(LunSpace space) { + this.space = space; + return this; + } + + public LunSpace getSpace() { + return space; + } + + public void setSpace(LunSpace space) { + this.space = space; + } + + public Lun svm(Svm svm) { + this.svm = svm; + return this; + } + + public Svm getSvm() { + return svm; + } + + public void setSvm(Svm svm) { + this.svm = svm; + } + + public String getUuid() { + return uuid; + } + public void setUuid(String uuid) { + this.uuid = uuid; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Lun lun = (Lun) o; + return Objects.equals(this.name, lun.name) && Objects.equals(this.uuid, lun.uuid); + } + + @Override + public int hashCode() { + return Objects.hash(name, uuid); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Lun {\n"); + sb.append(" autoDelete: ").append(toIndentedString(autoDelete)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" lunMaps: ").append(toIndentedString(lunMaps)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" osType: ").append(toIndentedString(osType)).append("\n"); + sb.append(" serialNumber: ").append(toIndentedString(serialNumber)).append("\n"); + sb.append(" space: ").append(toIndentedString(space)).append("\n"); + sb.append(" svm: ").append(toIndentedString(svm)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).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/LunMap.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/LunMap.java new file mode 100644 index 000000000000..4804a71e406d --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/LunMap.java @@ -0,0 +1,109 @@ +/* + * 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; + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class LunMap { + @JsonProperty("igroup") + private Igroup igroup = null; + @JsonProperty("logical_unit_number") + private Integer logicalUnitNumber = null; + @JsonProperty("lun") + private Lun lun = null; + @JsonProperty("svm") + @SerializedName("svm") + private Svm svm = null; + + public LunMap igroup (Igroup igroup) { + this.igroup = igroup; + return this; + } + + public Igroup getIgroup () { + return igroup; + } + + public void setIgroup (Igroup igroup) { + this.igroup = igroup; + } + + public LunMap logicalUnitNumber (Integer logicalUnitNumber) { + this.logicalUnitNumber = logicalUnitNumber; + return this; + } + + public Integer getLogicalUnitNumber () { + return logicalUnitNumber; + } + + public void setLogicalUnitNumber (Integer logicalUnitNumber) { + this.logicalUnitNumber = logicalUnitNumber; + } + + public LunMap lun (Lun lun) { + this.lun = lun; + return this; + } + + public Lun getLun () { + return lun; + } + + public void setLun (Lun lun) { + this.lun = lun; + } + + public LunMap svm (Svm svm) { + this.svm = svm; + return this; + } + + public Svm getSvm () { + return svm; + } + + public void setSvm (Svm svm) { + this.svm = svm; + } + + @Override + public String toString () { + StringBuilder sb = new StringBuilder(); + sb.append("class LunMap {\n"); + sb.append(" igroup: ").append(toIndentedString(igroup)).append("\n"); + sb.append(" logicalUnitNumber: ").append(toIndentedString(logicalUnitNumber)).append("\n"); + sb.append(" lun: ").append(toIndentedString(lun)).append("\n"); + sb.append(" svm: ").append(toIndentedString(svm)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + 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/LunSpace.java b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/LunSpace.java new file mode 100644 index 000000000000..d0956cd5366f --- /dev/null +++ b/plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/feign/model/LunSpace.java @@ -0,0 +1,95 @@ +/* + * 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; + +/** + * The storage space related properties of the LUN. + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +public class LunSpace { + + @JsonProperty("scsi_thin_provisioning_support_enabled") + private Boolean scsiThinProvisioningSupportEnabled = null; + + @JsonProperty("size") + private Long size = null; + + @JsonProperty("used") + private Long used = null; + @JsonProperty("physical_used") + private Long physicalUsed = null; + + public LunSpace scsiThinProvisioningSupportEnabled(Boolean scsiThinProvisioningSupportEnabled) { + this.scsiThinProvisioningSupportEnabled = scsiThinProvisioningSupportEnabled; + return this; + } + + public Boolean isScsiThinProvisioningSupportEnabled() { + return scsiThinProvisioningSupportEnabled; + } + + public void setScsiThinProvisioningSupportEnabled(Boolean scsiThinProvisioningSupportEnabled) { + this.scsiThinProvisioningSupportEnabled = scsiThinProvisioningSupportEnabled; + } + + public LunSpace size(Long size) { + this.size = size; + return this; + } + + public Long getSize() { + return size; + } + + public void setSize(Long size) { + this.size = size; + } + + public Long getUsed() { + return used; + } + + public Long getPhysicalUsed() { + return physicalUsed; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LunSpace {\n"); + sb.append(" scsiThinProvisioningSupportEnabled: ").append(toIndentedString(scsiThinProvisioningSupportEnabled)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" used: ").append(toIndentedString(used)).append("\n"); + sb.append(" physicalUsed: ").append(toIndentedString(physicalUsed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +}