use of com.cloud.legacymodel.communication.command.ListVolumeCommand in project cosmic by MissionCriticalCloud.
the class VolumeServiceImpl method listVolume.
private Map<Long, TemplateProp> listVolume(final DataStore store) {
final ListVolumeCommand cmd = new ListVolumeCommand(store.getTO(), store.getUri());
final EndPoint ep = _epSelector.select(store);
Answer answer = null;
if (ep == null) {
final String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";
s_logger.error(errMsg);
answer = new Answer(cmd, false, errMsg);
} else {
answer = ep.sendMessage(cmd);
}
if (answer != null && answer.getResult()) {
final ListVolumeAnswer tanswer = (ListVolumeAnswer) answer;
return tanswer.getTemplateInfo();
} else {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Can not list volumes for image store " + store.getId());
}
}
return null;
}
Aggregations