use of com.cloud.api.response.CreateSSHKeyPairResponse in project cosmic by MissionCriticalCloud.
the class CreateSSHKeyPairCmd method execute.
@Override
public void execute() {
final SSHKeyPair r = _mgr.createSSHKeyPair(this);
final CreateSSHKeyPairResponse response = (CreateSSHKeyPairResponse) _responseGenerator.createSSHKeyPairResponse(r, true);
response.setResponseName(getCommandName());
response.setObjectName("keypair");
setResponseObject(response);
}
use of com.cloud.api.response.CreateSSHKeyPairResponse in project cosmic by MissionCriticalCloud.
the class ApiResponseHelper method createSSHKeyPairResponse.
@Override
public SSHKeyPairResponse createSSHKeyPairResponse(final SSHKeyPair sshkeyPair, final boolean privatekey) {
SSHKeyPairResponse response = new SSHKeyPairResponse(sshkeyPair.getName(), sshkeyPair.getFingerprint());
if (privatekey) {
response = new CreateSSHKeyPairResponse(sshkeyPair.getName(), sshkeyPair.getFingerprint(), sshkeyPair.getPrivateKey());
}
final Account account = ApiDBUtils.findAccountById(sshkeyPair.getAccountId());
response.setAccountName(account.getAccountName());
final Domain domain = ApiDBUtils.findDomainById(sshkeyPair.getDomainId());
response.setDomainId(domain.getUuid());
response.setDomainName(domain.getName());
return response;
}
Aggregations