Ori Liel has posted comments on this change.
Change subject: restapi: wip: adding support for executing
ImportVmFromConfiguration
......................................................................
Patch Set 3: (2 inline comments)
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java
Line 84: if (vm.getInitialization() != null &&
vm.getInitialization().getConfiguration() != null) {
Line 85: response = importVmFromConfiguration(vm);
Line 86: } else {
Line 87: validateParameters(vm, "name");
Line 88: validateEnums(VM.class, vm);
validateEnums() is a generic validation of any enum values that exist in the VM
representation. It should be invoked in any condition (even if specifically in
the flow of creating a VM from a configuration, there are no relevant enum
values. There may be in the future). Leave the invocation at the beginning,
before the 'if' statement.
Line 89: if (isCreateFromSnapshot(vm)) {
Line 90: response = createVmFromSnapshot(vm);
Line 91: } else {
Line 92: validateParameters(vm, "template.id|name");
Line 182:
Line 183: public Response importVmFromConfiguration(VM vm) {
Line 184: Configuration config =
vm.getInitialization().getConfiguration();
Line 185: ImportVmFromConfigurationParameters params =
Line 186: new
ImportVmFromConfigurationParameters(config.getType().trim(),
config.getData().trim(), getClusterId(vm));
Is type an enum in the engine? I have a feeling that it should be an enum in
the API as well.
About calls to trim() - please remove them, as we never activate trim() for
user strings. So we would have many flows where whitespace is not removed for
the user, and one flow (yours) where it is removed - creating an inconsistent
user experience. Plus, I'm not sure, but maybe even jaxb will ignore a leading
or trailing space to begin with.
Line 187: return performCreate(VdcActionType.ImportVmFromConfiguration,
Line 188: params,
Line 189: new QueryIdResolver<Guid>(VdcQueryType.GetVmByVmId,
IdQueryParameters.class));
Line 190: }
--
To view, visit http://gerrit.ovirt.org/15893
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If1af88e93c65ab1a2a34e7a3e5c99db36956ab5b
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches