Sahina Bose has posted comments on this change. Change subject: restApi : RestApi to export volume profile to pdf ......................................................................
Patch Set 5: (3 comments) http://gerrit.ovirt.org/#/c/28340/5/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 107: Line 108: @GET Line 109: @Produces("application/pdf") Line 110: @Path("exportstats") Line 111: public Response saveGlusterVolumeProfileAsPdf(); Could you rename this as get..AsPdf? http://gerrit.ovirt.org/#/c/28340/5/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 4395: signatures: [] Line 4396: urlparams: {} Line 4397: headers: Line 4398: All-Content: {value: true|false, required: false} Line 4399: - name: /clusters/{cluster:id}/glustervolumes/{glustervolume:id}/exportstats|rel=get Shouldn't there be a parameter to get nfs statistics? Line 4400: description: Export the profile statistics to pdf Line 4401: request: Line 4402: body: Line 4403: parameterType: null http://gerrit.ovirt.org/#/c/28340/5/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 193: public Response saveGlusterVolumeProfileAsPdf() { Line 194: boolean nfsStats = isNfsStatistics(); Line 195: VdcQueryReturnValue result = runQuery(VdcQueryType.GetGlusterVolumeProfileInfo, new GlusterVolumeProfileParameters(Guid.createGuidFromString(parent.getParent().get().getId()), guid, nfsStats)); Line 196: if (result != null && result.getSucceeded() && result.getReturnValue() != null) { Line 197: GlusterVolumeProfileInfo profileInfo = (GlusterVolumeProfileInfo) result.getReturnValue(); Ideally, we should have had an option to return as pdf in addition to xml, json return types on getProfileStatistics. If that's not possible, can you refactor the code to avoid repetition? Line 198: try { Line 199: final byte[] data = (byte[]) (doAction(VdcActionType.GlusterVolumeProfilePdfExport, Line 200: new GlusterVolumeCreatePdfParameters(profileInfo, null, "admin", ExportData.BrickProfile)).getActionReturnValue()); Line 201: StreamingOutput stream = new StreamingOutput() { -- 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: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: anmolbabu <anb...@redhat.com> Gerrit-Reviewer: Alexander Wels <aw...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com> Gerrit-Reviewer: Sahina Bose <sab...@redhat.com> Gerrit-Reviewer: Shubhendu Tripathi <shtri...@redhat.com> Gerrit-Reviewer: anmolbabu <anb...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches