use of com.cloud.api.response.SSHKeyPairResponse in project cosmic by MissionCriticalCloud.
the class ListSSHKeyPairsCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final Pair<List<? extends SSHKeyPair>, Integer> resultList = _mgr.listSSHKeyPairs(this);
final List<SSHKeyPairResponse> responses = new ArrayList<>();
for (final SSHKeyPair result : resultList.first()) {
final SSHKeyPairResponse r = _responseGenerator.createSSHKeyPairResponse(result, false);
r.setObjectName("sshkeypair");
responses.add(r);
}
final ListResponse<SSHKeyPairResponse> response = new ListResponse<>();
response.setResponses(responses, resultList.second());
response.setResponseName(getCommandName());
setResponseObject(response);
}
Aggregations