Michael Pasternak has posted comments on this change.
Change subject: restapi : Add /clusters sub-collection under
/datacenters/xxx(#674521)
......................................................................
Patch Set 6: I would prefer that you didn't submit this
(3 inline comments)
....................................................
File
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
Line 1194: body:
Line 1195: parameterType: null
Line 1196: signatures: []
Line 1197: urlparams:
Line 1198: search: {context: query, type: 'xs:string', value: 'search
query', required: false}
search is not available in this context
Line 1199: case_sensitive: {context: matrix, type: 'xs:boolean', value:
true|false, required: false}
Line 1200: max: {context: matrix, type: 'xs:int', value: 'max results',
required: false}
Line 1201: headers:
Line 1202: Filter: {value: true|false, required: false}
Line 1195: parameterType: null
Line 1196: signatures: []
Line 1197: urlparams:
Line 1198: search: {context: query, type: 'xs:string', value: 'search
query', required: false}
Line 1199: case_sensitive: {context: matrix, type: 'xs:boolean', value:
true|false, required: false}
case_sensitive is not available in this context
Line 1200: max: {context: matrix, type: 'xs:int', value: 'max results',
required: false}
Line 1201: headers:
Line 1202: Filter: {value: true|false, required: false}
Line 1203: - name:
/api/datacenters/{datacenter:id}/clusters/{cluster:id}|rel=get
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDataCenterClusterResource.java
Line 14: }
Line 15:
Line 16: @Override
Line 17: public Cluster get() {
Line 18: Clusters clusters = parent.list();
this call is not efficient cause you will map all N clusters in list() while
only one can
(potentially) answer your cluster.getId().equals(guid.toString()) condition (or
even none),
instead please implement public method in parent only doing
VdcQueryType.GetVdsGroupsByStoragePoolId and reuse it in both parent and this
class
Line 19: for (Cluster cluster : clusters.getClusters()) {
Line 20: if (cluster.getId().equals(guid.toString())) {
Line 21: return cluster;
Line 22: }
--
To view, visit http://gerrit.ovirt.org/11618
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6b27ef501324d890efbe0e8b914d9db47653f146
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches