use of org.ovirt.engine.core.common.action.SetVmTicketParameters in project ovirt-engine by oVirt.
the class ConfigureConsoleOptionsQuery method generateTicket.
private String generateTicket() {
SetVmTicketParameters parameters = new SetVmTicketParameters(getParameters().getOptions().getVmId(), null, ConsoleOptions.TICKET_VALIDITY_SECONDS, getParameters().getOptions().getGraphicsType());
// we need these two params because SetVmTicket needs to know current user
parameters.setSessionId(getEngineContext().getSessionId());
parameters.setParametersCurrentUser(getUser());
ActionReturnValue result = backend.runAction(ActionType.SetVmTicket, parameters);
if (!result.getSucceeded()) {
throw new TicketGenerationException(result);
}
return result.getActionReturnValue();
}
use of org.ovirt.engine.core.common.action.SetVmTicketParameters in project ovirt-engine by oVirt.
the class BackendGraphicsConsoleHelper method setTicket.
public static Response setTicket(BackendResource resource, Action action, Guid vmId, org.ovirt.engine.core.common.businessentities.GraphicsType graphicsType) {
final Response response = resource.performAction(ActionType.SetVmTicket, new SetVmTicketParameters(vmId, getTicketValue(action), getTicketExpiry(action), graphicsType), action);
final Action actionResponse = (Action) response.getEntity();
if (CreationStatus.FAILED.value().equals(actionResponse.getStatus())) {
actionResponse.getTicket().setValue(null);
actionResponse.getTicket().setExpiry(null);
}
return response;
}
Aggregations