Michael Pasternak has posted comments on this change.

Change subject: core: restapi: add GetVmOvfConifugrationQuery
......................................................................


Patch Set 1: I would prefer that you didn't submit this

(8 inline comments)

....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SnapshotOvfResource.java
Line 6: 
Line 7: import org.jboss.resteasy.annotations.providers.jaxb.Formatted;
Line 8: 
Line 9: @Produces({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, 
ApiMediaType.APPLICATION_X_YAML})
Line 10: public interface SnapshotOvfResource {
no need for this interface, see explanations in the SnapshotResource
Line 11: 
Line 12:     @GET
Line 13:     @Formatted
Line 14:     public String get();


....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/SnapshotResource.java
Line 77:     @Path("nics")
Line 78:     public SnapshotNicsResource getSnapshotNicsResource();
Line 79: 
Line 80:     @Path("ovf")
Line 81:     public SnapshotOvfResource getSnapshotOvfResource();
rest-api pattern is a .../collection/resource/..., obviously this doesn't work,

also there is no need for nested collection/resource to fetch a ovf, as we 
discussed
earlier, <ovf> will be a part of the <vm> object, and since <snapshot> extends 
<vm>,
you can return it in snapshot.ovf,

but i'd not return it by default (in sake of saving bits being send over the 
wire), but
on demand, in api we have such functionality already, - user have to send 
httpheader
All-Content:True, 

actual implementation for this, resides in the 
BackendSnapshotResource.doPopulate()


....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
Line 625:     urlparams: {}
Line 626:     headers:
Line 627:       Content-Type: {value: application/xml|json, required: true}
Line 628:       Correlation-Id: {value: 'any string', required: false}
Line 629: - name: /api/vms/{vm:id}/snapshots/{snapshot:id}/ovf|rel=get
rest-api pattern is a .../collection/resource/..., obviously this doesn't work
Line 630:   request:
Line 631:     body:
Line 632:       parameterType: null
Line 633:       signatures: []


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSnapshotResource.java
Line 132:         return new BackendSnapshotNicsResource(this, id);
Line 133:     }
Line 134: 
Line 135:     @Override
Line 136:     public SnapshotOvfResource getSnapshotOvfResource() {
no need for nested collection, see explanations in the SnapshotResource
Line 137:         return new BackendSnapshotSnapshotOvfResource(this, id);
Line 138:     }
Line 139: 
Line 140:     public void setCollectionResource(BackendSnapshotsResource 
collection) {


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendSnapshotSnapshotOvfResource.java
Line 3: import org.ovirt.engine.api.resource.SnapshotOvfResource;
Line 4: import org.ovirt.engine.core.common.queries.IdQueryParameters;
Line 5: import org.ovirt.engine.core.common.queries.VdcQueryType;
Line 6: 
Line 7: public class BackendSnapshotSnapshotOvfResource extends 
BackendSnapshotElementsResource implements SnapshotOvfResource {
no need for this impl, see explanations in the SnapshotResource
Line 8: 
Line 9:     public BackendSnapshotSnapshotOvfResource(BackendSnapshotResource 
parent, String vmId) {
Line 10:         super(parent, vmId);
Line 11:     }


Line 11:     }
Line 12: 
Line 13:     @Override
Line 14:     public String get() {
Line 15:         return parent.getEntity(String.class, 
VdcQueryType.GetVmOvfConfigurationBySnapshot, new 
IdQueryParameters(parent.getSnapshotId()), null);
404
Line 16:     }


....................................................
Commit Message
Line 3: AuthorDate: 2013-06-26 09:38:23 +0300
Line 4: Commit:     Liron Aravot <[email protected]>
Line 5: CommitDate: 2013-06-27 12:13:57 +0300
Line 6: 
Line 7: core: restapi: add GetVmOvfConifugrationQuery
it's not a typo, it's a sophisticated feature so "cleanup" folks won't find it 
;-)
Line 8: 
Line 9: This patch adds the GetVmOvfConfigurationBySnapshotQuery query which
Line 10: returns the Ovf configuration of snapshot (if present).
Line 11: 


Line 7: core: restapi: add GetVmOvfConifugrationQuery
Line 8: 
Line 9: This patch adds the GetVmOvfConfigurationBySnapshotQuery query which
Line 10: returns the Ovf configuration of snapshot (if present).
Line 11: 
+1
Line 12: Change-Id: I46340c4461b57a4c314fb50ca9c19ac5fd08a451


-- 
To view, visit http://gerrit.ovirt.org/16176
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I46340c4461b57a4c314fb50ca9c19ac5fd08a451
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Deepak C Shetty <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[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

Reply via email to