use of com.cloud.api.response.StorageProviderResponse in project cosmic by MissionCriticalCloud.
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");
}
final List<StorageProviderResponse> providers = this.dataStoreProviderApiService.getDataStoreProviders(getType());
final ListResponse<StorageProviderResponse> responses = new ListResponse<>();
for (final StorageProviderResponse provider : providers) {
provider.setObjectName("dataStoreProvider");
}
responses.setResponses(providers);
responses.setResponseName(this.getCommandName());
this.setResponseObject(responses);
}
use of com.cloud.api.response.StorageProviderResponse in project cosmic by MissionCriticalCloud.
the class DataStoreProviderManagerImpl method getPrimaryDataStoreProviders.
public List<StorageProviderResponse> getPrimaryDataStoreProviders() {
final List<StorageProviderResponse> providers = new ArrayList<>();
for (final DataStoreProvider provider : providerMap.values()) {
if (provider.getTypes().contains(DataStoreProviderType.PRIMARY)) {
final StorageProviderResponse response = new StorageProviderResponse();
response.setName(provider.getName());
response.setType(DataStoreProvider.DataStoreProviderType.PRIMARY.toString());
providers.add(response);
}
}
return providers;
}
use of com.cloud.api.response.StorageProviderResponse in project cosmic by MissionCriticalCloud.
the class DataStoreProviderManagerImpl method getImageDataStoreProviders.
public List<StorageProviderResponse> getImageDataStoreProviders() {
final List<StorageProviderResponse> providers = new ArrayList<>();
for (final DataStoreProvider provider : providerMap.values()) {
if (provider.getTypes().contains(DataStoreProviderType.IMAGE)) {
final StorageProviderResponse response = new StorageProviderResponse();
response.setName(provider.getName());
response.setType(DataStoreProvider.DataStoreProviderType.IMAGE.toString());
providers.add(response);
}
}
return providers;
}
use of com.cloud.api.response.StorageProviderResponse in project cosmic by MissionCriticalCloud.
the class DataStoreProviderManagerImpl method getCacheDataStoreProviders.
public List<StorageProviderResponse> getCacheDataStoreProviders() {
final List<StorageProviderResponse> providers = new ArrayList<>();
for (final DataStoreProvider provider : providerMap.values()) {
if (provider.getTypes().contains(DataStoreProviderType.ImageCache)) {
final StorageProviderResponse response = new StorageProviderResponse();
response.setName(provider.getName());
response.setType(DataStoreProviderType.ImageCache.toString());
providers.add(response);
}
}
return providers;
}
Aggregations