mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
CLOUDSTACK-10015: Return storage provider with response to list storage pools (#2200)
It would be useful if we return the provider name in the list storage pools response. This will be useful for example to identify different storages that are in use and their scope.
This commit is contained in:
parent
6d5c61b7bc
commit
623ca0def2
@ -16,18 +16,16 @@
|
||||
// under the License.
|
||||
package org.apache.cloudstack.api.response;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import com.cloud.serializer.Param;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.storage.StoragePoolStatus;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import com.cloud.serializer.Param;
|
||||
import com.cloud.storage.StoragePool;
|
||||
import com.cloud.storage.StoragePoolStatus;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
@EntityReference(value = StoragePool.class)
|
||||
public class StoragePoolResponse extends BaseResponse {
|
||||
@ -119,6 +117,10 @@ public class StoragePoolResponse extends BaseResponse {
|
||||
@Param(description = "true if this pool is suitable to migrate a volume," + " false otherwise")
|
||||
private Boolean suitableForMigration;
|
||||
|
||||
@SerializedName("provider")
|
||||
@Param(description = "Storage provider for this pool")
|
||||
private String provider;
|
||||
|
||||
@SerializedName(ApiConstants.STORAGE_CAPABILITIES)
|
||||
@Param(description = "the storage pool capabilities")
|
||||
private Map<String, String> caps;
|
||||
@ -317,4 +319,12 @@ public class StoragePoolResponse extends BaseResponse {
|
||||
public Boolean getSuitableForMigration() {
|
||||
return suitableForMigration;
|
||||
}
|
||||
|
||||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
public void setProvider(String provider) {
|
||||
this.provider = provider;
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,16 +16,6 @@
|
||||
// under the License.
|
||||
package com.cloud.api.query.dao;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.apache.cloudstack.api.response.StoragePoolResponse;
|
||||
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
|
||||
import com.cloud.api.ApiDBUtils;
|
||||
import com.cloud.api.query.vo.StoragePoolJoinVO;
|
||||
import com.cloud.capacity.CapacityManager;
|
||||
@ -35,6 +25,14 @@ import com.cloud.utils.StringUtils;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.SearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
import org.apache.cloudstack.api.response.StoragePoolResponse;
|
||||
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Long> implements StoragePoolJoinDao {
|
||||
@ -98,6 +96,7 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
|
||||
|
||||
poolResponse.setClusterId(pool.getClusterUuid());
|
||||
poolResponse.setClusterName(pool.getClusterName());
|
||||
poolResponse.setProvider(pool.getStorageProviderName());
|
||||
poolResponse.setTags(pool.getTag());
|
||||
poolResponse.setOverProvisionFactor(Double.toString(CapacityManager.StorageOverprovisioningFactor.valueIn(pool.getId())));
|
||||
|
||||
@ -163,6 +162,7 @@ public class StoragePoolJoinDaoImpl extends GenericDaoBase<StoragePoolJoinVO, Lo
|
||||
|
||||
poolResponse.setClusterId(pool.getClusterUuid());
|
||||
poolResponse.setClusterName(pool.getClusterName());
|
||||
poolResponse.setProvider(pool.getStorageProviderName());
|
||||
poolResponse.setTags(pool.getTag());
|
||||
|
||||
// set async job
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user