Juan Hernandez has posted comments on this change. Change subject: restApi : RestApi to export volume profile to pdf ......................................................................
Patch Set 17: (3 comments) http://gerrit.ovirt.org/#/c/28340/17/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/gluster/GlusterVolumeResource.java File backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/gluster/GlusterVolumeResource.java: Line 106: public GlusterBricksResource getGlusterBrickSubResource(); Line 107: Line 108: @GET Line 109: @Produces("application/pdf") Line 110: @Path("profilestatsaspdf") If I understand correctly this method will return the same information that "getProfileStatistics", but in PDF instead of XMl/JSON. If this is true then the method should have the same @Path, as it is actually the same resource. The JAX-RS implementation (RESTEasy) will decide which method to call according to the content type requested by the caller. Line 111: public Response getGlusterVolumeProfileAsPdf(); http://gerrit.ovirt.org/#/c/28340/17/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml File backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml: Line 4420: signatures: [] Line 4421: urlparams: Line 4422: nfsStatistics: {context: matrix, type: 'xs:boolean', value: true|false, required: false} Line 4423: headers: Line 4424: Content-Type: {value: application/pdf, required: true} This isn't required, as there shouldn't be two URLs for the same resource. Line 4425: - name: /clusters/{cluster:id}/glustervolumes/{glustervolume:id}/bricks|rel=add Line 4426: description: add a new brick to the gluster volume attached to the cluster Line 4427: request: Line 4428: body: http://gerrit.ovirt.org/#/c/28340/17/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/gluster/BackendGlusterVolumeResource.java File backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/gluster/BackendGlusterVolumeResource.java: Line 188: throw new WebFaultException(null, localize(Messages.BACKEND_FAILED), Response.Status.INTERNAL_SERVER_ERROR); Line 189: } Line 190: } Line 191: Line 192: public Response getGlusterVolumeProfileAsPdf() { MIssing the @Override annotation. Note also that the method should probably named "getProfileStatisticsAsPdf", to make it clear that it is returning the same data that the "getProfileStatistics" method, just in a different format. Line 193: boolean nfsStats = isNfsStatistics(); Line 194: VdcQueryReturnValue result = runQuery(VdcQueryType.GetGlusterVolumeProfileInfo, new GlusterVolumeProfileParameters(Guid.createGuidFromString(parent.getParent().get().getId()), guid, nfsStats)); Line 195: if (result != null && result.getSucceeded() && result.getReturnValue() != null) { Line 196: GlusterVolumeProfileInfo profileInfo = (GlusterVolumeProfileInfo) result.getReturnValue(); -- To view, visit http://gerrit.ovirt.org/28340 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3ff28f5cf18bd7a2bcb53a169873fe6ae3541ed Gerrit-PatchSet: 17 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: anmolbabu <[email protected]> Gerrit-Reviewer: Alexander Wels <[email protected]> Gerrit-Reviewer: Juan Hernandez <[email protected]> Gerrit-Reviewer: Kanagaraj M <[email protected]> Gerrit-Reviewer: Ramesh N <[email protected]> Gerrit-Reviewer: Sahina Bose <[email protected]> Gerrit-Reviewer: Shubhendu Tripathi <[email protected]> Gerrit-Reviewer: anmolbabu <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
