Michael Pasternak has posted comments on this change.

Change subject: restapi : Add /clusters sub-collection under 
/datacenters/xxx(#674521)
......................................................................


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

(4 inline comments)

please add RSDL metadata.

....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendDataCenterClustersResource.java
Line 19: import 
org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase;
Line 20: import org.ovirt.engine.core.common.queries.VdcQueryType;
Line 21: import org.ovirt.engine.core.compat.Guid;
Line 22: 
Line 23: public class BackendDataCenterClustersResource extends 
AbstractBackendCollectionResource<Cluster, VDSGroup>
why not inheriting from the BackendClustersResource + overriding relevant 
methods?
Line 24:         implements ClustersResource {
Line 25: 
Line 26:     static final String[] SUB_COLLECTIONS = { "networks", 
"permissions", "glustervolumes" };
Line 27:     static final String VIRT_ONLY_MODE_COLLECTIONS_TO_HIDE = 
"glustervolumes";


Line 44:     }
Line 45: 
Line 46:     @Override
Line 47:     public Response add(Cluster cluster) {
Line 48:         validateParameters(cluster, "name", "dataCenter.name|id");
why do you need/force "dataCenter.name|id" parameter? you already in context of 
DC.
Line 49:         validateEnums(Cluster.class, cluster);
Line 50:         storage_pool pool = getStoragePool(cluster, this);
Line 51:         VDSGroup entity = map(cluster, map(pool));
Line 52:         return performCreate(VdcActionType.AddVdsGroup,


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendDataCenterClustersResourceTest.java
Line 236:     public void testAddClusterFailureNamedDataCenter() throws 
Exception {
Line 237:         doTestBadAddClusterNamedDataCenter(true, false, FAILURE);
Line 238:     }
Line 239: 
Line 240:     private void doTestBadAddClusterNamedDataCenter(boolean canDo, 
boolean success, String detail)
not relevant
Line 241:             throws Exception {
Line 242:         setUpGetEntityExpectations("Datacenter: name=" + NAMES[1],
Line 243:                                    SearchType.StoragePool,
Line 244:                                    setUpStoragePool(1));


Line 269:         try {
Line 270:             collection.add(model);
Line 271:             fail("expected WebApplicationException on incomplete 
parameters");
Line 272:         } catch (WebApplicationException wae) {
Line 273:              verifyIncompleteException(wae, "Cluster", "add", 
"dataCenter.name|id");
no need to supply "dataCenter.name|id"
Line 274:         }
Line 275:     }
Line 276: 
Line 277:     @Override


--
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: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to