Search in sources :

Example 1 with GetVMPasswordResponse

use of com.cloud.api.response.GetVMPasswordResponse in project CloudStack-archive by CloudStack-extras.

the class GetVMPasswordCmd method execute.

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public void execute() {
    String passwd = _mgr.getVMPassword(this);
    if (passwd == null || passwd.equals(""))
        throw new InvalidParameterException("No password for VM with id '" + getId() + "' found.");
    this.setResponseObject(new GetVMPasswordResponse(getCommandName(), passwd));
}
Also used : InvalidParameterException(java.security.InvalidParameterException) GetVMPasswordResponse(com.cloud.api.response.GetVMPasswordResponse)

Aggregations

GetVMPasswordResponse (com.cloud.api.response.GetVMPasswordResponse)1 InvalidParameterException (java.security.InvalidParameterException)1