package org.ovirt.engine.core.vdsbroker;

import org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand;

public class SetNumberOfCpusVDSCommand<P extends SetNumberOfCpusVDSCommand.Params> extends VdsBrokerCommand<P> {

    public SetNumberOfCpusVDSCommand(P parameters) {
        super(parameters);
    }

    @Override
    protected void executeVdsBrokerCommand() {
        try {
            status = getBroker().setNumberOfCpus(
                    getParameters().getVmId().toString(),
                    String.valueOf(getParameters().getNumberOfCpus()));
            proceedProxyReturnValue();
        } catch (RuntimeException e) {
            setVdsRuntimeError(e);
            // prevent exception handler from rethrowing an exception
            getVDSReturnValue().setExceptionString(null);
        }
    }

    public static class Params extends VdsAndVmIDVDSParametersBase{

        private int numberOfCpus;

        public Params(Guid vdsId, Guid vmId, int numberOfCpus) {
            super(vdsId, vmId);
            this.numberOfCpus = numberOfCpus;
        }

        public int getNumberOfCpus() {
            return numberOfCpus;
        }
    }
}

@@ -1271,21 +1271,179 @@
 s;%0A        %7D
+%0A%0A        @Override%0A        public String toString() %7B%0A            return String.format(%22%25s, numberOfCpus=%25s%22, super.toString(), getNumberOfCpus());%0A        %7D
 %0A    %7D%0A%7D%0A

print number of cpu value in SetNumberOfCpusVDSCommand