Michael Pasternak has posted comments on this change.
Change subject: restapi: Add Reboot support
......................................................................
Patch Set 10: I would prefer that you didn't submit this
(10 inline comments)
....................................................
File
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
Line 161: <xs:element name="exclusive" type="xs:boolean" minOccurs="0"/>
Line 162: <!-- For VM start -->
Line 163: <xs:element ref="vm" minOccurs="0" maxOccurs="1"/>
Line 164: <!-- For VM shutdown/reboot -->
Line 165: <xs:element name="graceful_timeout" type="xs:int" minOccurs="0"
maxOccurs="1" />
please reuse "grace_period" for that
Line 166: <!-- For import template -->
Line 167: <xs:element ref="template" minOccurs="0" maxOccurs="1"/>
Line 168: <!-- For Setup Networks -->
Line 169: <xs:element ref="host_nics" minOccurs="0" maxOccurs="1"/>
Line 2103: <xs:sequence>
Line 2104: <xs:element name="enabled" type="xs:boolean" minOccurs="0"
maxOccurs="1"/>
Line 2105: <xs:element name="priority" type="xs:int" minOccurs="0"
maxOccurs="1"/>
Line 2106: <xs:element name="powerdown_forced" type="xs:boolean"
minOccurs="0" maxOccurs="1" />
Line 2107: <xs:element name="graceful_timeout" type="xs:int"
minOccurs="0" maxOccurs="1" />
please reuse "grace_period"
Line 2108: </xs:sequence>
Line 2109: </xs:complexType>
Line 2110:
Line 2111: <xs:element name="display" type="Display"/>
....................................................
File
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
Line 199: urlparams: {}
Line 200: headers:
Line 201: Content-Type: {value: application/xml|json, required: true}
Line 202: Correlation-Id: {value: 'any string', required: false}
Line 203: - name: /api/vms/{vm:id}/powercycle|rel=powercycle
you should be mentioning new (optional) timeout parameter in all methods it's
relevant for
Line 204: request:
Line 205: body:
Line 206: parameterType: Action
Line 207: signatures: []
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmResource.java
Line 221: org.ovirt.engine.core.common.businessentities.VM vm =
getEntity(entityType,
Line 222:
VdcQueryType.GetVmByVmId,
Line 223:
new IdQueryParameters(guid),
Line 224:
"VM");
Line 225: Integer timeout = action.isSetGracefulTimeout() ?
action.getGracefulTimeout() : vm.getGracefulTimeout();
- i'd suggest using vm.getGracefulTimeout() in the backed as default instead of
forcing all clients to fetch VM and find it out for you?
Line 226: return doAction(VdcActionType.ShutdownVm,
Line 227: new PowerDownVmParameters(guid, timeout,
vm.isPowerdownForced()),
Line 228: action);
Line 229: }
Line 234: org.ovirt.engine.core.common.businessentities.VM vm =
getEntity(entityType,
Line 235:
VdcQueryType.GetVmByVmId,
Line 236:
new IdQueryParameters(guid),
Line 237:
"VM");
Line 238: Integer timeout = action.isSetGracefulTimeout() ?
action.getGracefulTimeout() : vm.getGracefulTimeout();
same here
Line 239: return doAction(VdcActionType.RebootVm,
Line 240: new PowerDownVmParameters(guid, timeout,
vm.isPowerdownForced()),
Line 241: action);
Line 242: }
Line 246: Integer timeout;
Line 247: if (action.isSetGracefulTimeout()) {
Line 248: timeout = action.getGracefulTimeout();
Line 249: } else {
Line 250: timeout = getEntity(entityType, VdcQueryType.GetVmByVmId,
new IdQueryParameters(guid), "VM").getGracefulTimeout();
same here
Line 251: }
Line 252: return doAction(VdcActionType.RebootVm,
Line 253: new PowerDownVmParameters(guid, timeout,
true),
Line 254: action);
....................................................
File
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/TemplateMapper.java
Line 259: model.setHighAvailability(new HighAvailability());
Line 260:
model.getHighAvailability().setEnabled(entity.isAutoStartup());
Line 261: model.getHighAvailability().setPriority(entity.getPriority());
Line 262:
model.getHighAvailability().setPowerdownForced(entity.isPowerdownForced());
Line 263:
model.getHighAvailability().setGracefulTimeout(entity.getGracefulTimeout());
please add entry for these properties in the corresponding mapper test
Line 264: model.setStateless(entity.isStateless());
Line 265: model.setDeleteProtected(entity.isDeleteProtected());
Line 266: if (entity.getVmType() != null) {
Line 267: model.setType(VmMapper.map(entity.getVmType(), null));
....................................................
File
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
Line 102: staticVm.setUsbPolicy(entity.getUsbPolicy());
Line 103: staticVm.setTunnelMigration(entity.getTunnelMigration());
Line 104: staticVm.setVncKeyboardLayout(entity.getVncKeyboardLayout());
Line 105: staticVm.setPowerdownForced(entity.isPowerdownForced());
Line 106: staticVm.setGracefulTimeout(entity.getGracefulTimeout());
please add entry for these properties in the corresponding mapper test
Line 107: return staticVm;
Line 108: }
Line 109:
Line 110: @Mapping(from = VM.class, to = VmStatic.class)
....................................................
Commit Message
Line 5: CommitDate: 2013-07-17 16:59:18 +0200
Line 6:
Line 7: restapi: Add Reboot support
Line 8:
Line 9: Added new VM actions reboot and powercycle along with new VM properties
used to
what does powercycle stands for?
Line 10: configure the power-down behavior of given VM.
Line 11:
Line 12: Change-Id: Ie9a5007a1364392830e4112e57ec54a7025fee02
Line 6:
Line 7: restapi: Add Reboot support
Line 8:
Line 9: Added new VM actions reboot and powercycle along with new VM properties
used to
Line 10: configure the power-down behavior of given VM.
1. any reference to the feature page/BZ?
2. please document these features in the FeatureHelper
thanks
Line 11:
Line 12: Change-Id: Ie9a5007a1364392830e4112e57ec54a7025fee02
--
To view, visit http://gerrit.ovirt.org/16194
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9a5007a1364392830e4112e57ec54a7025fee02
Gerrit-PatchSet: 10
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches