use of org.apache.cloudstack.api.response.StorageProviderResponse in project cloudstack by apache.
the class ListStorageProvidersCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
if (getType() == null) {
throw new ServerApiException(ApiErrorCode.MALFORMED_PARAMETER_ERROR, "need to specify type: either primary or image");
}
List<StorageProviderResponse> providers = this.dataStoreProviderApiService.getDataStoreProviders(getType());
ListResponse<StorageProviderResponse> responses = new ListResponse<StorageProviderResponse>();
for (StorageProviderResponse provider : providers) {
provider.setObjectName("dataStoreProvider");
}
responses.setResponses(providers);
responses.setResponseName(this.getCommandName());
this.setResponseObject(responses);
}
use of org.apache.cloudstack.api.response.StorageProviderResponse in project cloudstack by apache.
the class DataStoreProviderManagerImpl method getPrimaryDataStoreProviders.
public List<StorageProviderResponse> getPrimaryDataStoreProviders() {
List<StorageProviderResponse> providers = new ArrayList<StorageProviderResponse>();
for (DataStoreProvider provider : providerMap.values()) {
if (provider.getTypes().contains(DataStoreProviderType.PRIMARY)) {
StorageProviderResponse response = new StorageProviderResponse();
response.setName(provider.getName());
response.setType(DataStoreProvider.DataStoreProviderType.PRIMARY.toString());
providers.add(response);
}
}
return providers;
}
use of org.apache.cloudstack.api.response.StorageProviderResponse in project cloudstack by apache.
the class DataStoreProviderManagerImpl method getImageDataStoreProviders.
public List<StorageProviderResponse> getImageDataStoreProviders() {
List<StorageProviderResponse> providers = new ArrayList<StorageProviderResponse>();
for (DataStoreProvider provider : providerMap.values()) {
if (provider.getTypes().contains(DataStoreProviderType.IMAGE)) {
StorageProviderResponse response = new StorageProviderResponse();
response.setName(provider.getName());
response.setType(DataStoreProvider.DataStoreProviderType.IMAGE.toString());
providers.add(response);
}
}
return providers;
}
use of org.apache.cloudstack.api.response.StorageProviderResponse in project cloudstack by apache.
the class DataStoreProviderManagerImpl method getCacheDataStoreProviders.
public List<StorageProviderResponse> getCacheDataStoreProviders() {
List<StorageProviderResponse> providers = new ArrayList<StorageProviderResponse>();
for (DataStoreProvider provider : providerMap.values()) {
if (provider.getTypes().contains(DataStoreProviderType.ImageCache)) {
StorageProviderResponse response = new StorageProviderResponse();
response.setName(provider.getName());
response.setType(DataStoreProviderType.ImageCache.toString());
providers.add(response);
}
}
return providers;
}
Aggregations