Moti Asayag has posted comments on this change.

Change subject: restapi: Add support for vnic profiles
......................................................................


Patch Set 8:

(10 comments)

The http://gerrit.ovirt.org/#/c/17611/ patch was squashed into this patch.

....................................................
Commit Message
Line 9: The patch adds support for the vnic profiles model.
Line 10: The vnic profiles is added as a top collection and also
Line 11: as a sub collection of the network resource:
Line 12: /api/vnicprofiles/
Line 13: /api/networks/{network:id}/vnicprofiles
Done
Line 14: 
Line 15: Since the vnic profile is created for a network and it is
Line 16: not supported to switch an existing vnic profile between
Line 17: networks, the update action of the vnic profile is not


Line 15: Since the vnic profile is created for a network and it is
Line 16: not supported to switch an existing vnic profile between
Line 17: networks, the update action of the vnic profile is not
Line 18: supported under the networks collection, only under the
Line 19: top collection of the vnic profile.
Done
Line 20: 
Line 21: Change-Id: I7a0d472215ec1b0c359c0e2012e142ae8a627ce9


....................................................
File 
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
Line 2347:   request:
Line 2348:     body:
Line 2349:       parameterType: null
Line 2350:       signatures: []
Line 2351:     urlparams: {}
Done
Line 2352:     headers: {}
Line 2353: - name: /api/vnicprofiles/{vnicprofile:id}|rel=get
Line 2354:   request:
Line 2355:     body:


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendVnicProfilesResource.java
Line 23: 
Line 24:     protected VnicProfiles 
mapCollection(List<org.ovirt.engine.core.common.businessentities.network.VnicProfile>
 entities) {
Line 25:         VnicProfiles collection = new VnicProfiles();
Line 26:         for 
(org.ovirt.engine.core.common.businessentities.network.VnicProfile entity : 
entities) {
Line 27:             collection.getVnicProfiles().add(addLinks(map(entity)));
Done
Line 28:         }
Line 29: 
Line 30:         return collection;
Line 31:     }


Line 30:         return collection;
Line 31:     }
Line 32: 
Line 33:     protected Response add(VnicProfile vnicProfile) {
Line 34:         
org.ovirt.engine.core.common.businessentities.network.VnicProfile entity = 
map(vnicProfile);
Done
Line 35:         return performCreate(VdcActionType.AddVnicProfile,
Line 36:                 new VnicProfileParameters(entity),
Line 37:                 new 
QueryIdResolver<Guid>(VdcQueryType.GetVnicProfileById, 
IdQueryParameters.class));
Line 38:     }


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendAssignedVnicProfilesResource.java
Line 36: 
Line 37:         return super.add(vnicProfile);
Line 38:     }
Line 39: 
Line 40:     @Override
Done
Line 41:     public AssignedVnicProfileResource 
getAssignedVnicProfileSubResource(@PathParam("id") String id) {
Line 42:         return inject(new BackendAssignedVnicProfileResource(id, 
this));
Line 43:     }
Line 44: 


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVnicProfileResource.java
Line 20:     }
Line 21: 
Line 22:     @Override
Line 23:     public VnicProfile get() {
Line 24:         return addLinks(super.get());
Done
Line 25:     }
Line 26: 
Line 27:     @Override
Line 28:     public VnicProfile update(VnicProfile resource) {


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVnicProfilesResource.java
Line 34:         validateParameters(vnicProfile, "name", "network.id");
Line 35:         return super.add(vnicProfile);
Line 36:     }
Line 37: 
Line 38:     @Override
Done
Line 39:     public VnicProfileResource 
getVnicProfileSubResource(@PathParam("id") String id) {
Line 40:         return inject(new BackendVnicProfileResource(id));
Line 41:     }


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/AbstractBackendVnicProfilesResourceTest.java
Line 203:     @Ignore
Line 204:     @Override
Line 205:     public void testListCrashClientLocale() throws Exception {
Line 206:     }
Line 207: 
To my understanding the implementation of those tests relies on the search 
engine. The vnic profiles has no search support, therefore they doesn't seem 
relevant for it.
Line 208:     protected abstract void setGetAllVnicProfilesExpectations();
Line 209: 
Line 210:     protected void setUpEntityQueryExpectations(int times, int index, 
boolean notFound) throws Exception {
Line 211:         while (times-- > 0) {


....................................................
File 
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVnicProfilesResourceTest.java
Line 35: 
Line 36:     @Override
Line 37:     protected List<VnicProfile> getCollection() {
Line 38:         return collection.list().getVnicProfiles();
Line 39:     }
the tests (testAdd* and testRemove*) are invoked by their implementation on the 
base class (AbstractBackendVnicProfilesResourceTest)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7a0d472215ec1b0c359c0e2012e142ae8a627ce9
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
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

Reply via email to