Change in ovirt-engine[master]: restapi: Add support for vnic profiles

masayag at redhat.com masayag at redhat.com
Mon Aug 12 07:57:21 UTC 2013


Moti Asayag has submitted this change and it was merged.

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


restapi: Add support for vnic profiles

The patch adds support for the vnic profiles model.
The vnic profiles is added as a top collection and also
as a sub collection of the network resource:
/api/vnicprofiles/
/api/networks/{network:id}/vnicprofiles

The POST'ed element should look like:

<vnic_profile>
    <name>profile1</name>
    <network id="00000000-0000-0000-0000-000000000009"/>
    <port_mirroring>true</port_mirroring>
</vnic_profile>

Since the vnic profile is created for a network and it is
not supported to switch an existing vnic profile between
networks, the update action of the vnic profile is not
supported under the networks collection, only under the
top collection of the vnic profile.

Adding or updating vms or templates nics will utilize the
vnic profiles to define the connectivity of the vnic.

For VMs via:
POST: /api/vms/{vm:id}/nics/
PUT: /api/vms/{vm:id}/nics/{nic:id}/

For tempales via:
POST: /api/templates/{template:id}/nics/
PUT: /api/templates/{template:id}/nics/{nic:id}/

The vnic profile will replace the deprecated network name and
port mirroring.

The former api for add or update a nic:
 <nic>
     ...
     <network name="ovirtmgmt"/>
 </nic>

It is replaced by providing the vnic profile id:

 <nic>
     ...
     <vnic_profile id="fa5d0471-f83b-44ec-8715-7fe1a53ab7a6"/>
 </nic>

See: http://www.ovirt.org/Features/Vnic_Profiles

Change-Id: I7a0d472215ec1b0c359c0e2012e142ae8a627ce9
Signed-off-by: Moti Asayag <masayag at redhat.com>
---
M backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/LinkHelper.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/AssignedVnicProfileResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/AssignedVnicProfilesResource.java
M backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/NetworkResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/VnicProfileResource.java
A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/VnicProfilesResource.java
M backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/BackendApplication.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendVnicProfileResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractBackendVnicProfilesResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendApiResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendAssignedVnicProfileResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendAssignedVnicProfilesResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendNetworkResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendNetworksResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVnicProfileResource.java
A backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVnicProfilesResource.java
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/utils/FeaturesHelper.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/AbstractBackendVnicProfilesResourceTest.java
M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendApiResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendAssignedVnicProfileResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendAssignedVnicProfilesResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVnicProfileResourceTest.java
A backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVnicProfilesResourceTest.java
M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/NicMapper.java
A backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VnicProfileMapper.java
M backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/NicMapperTest.java
A backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VnicProfileMapperTest.java
29 files changed, 1,370 insertions(+), 3 deletions(-)

Approvals:
  Moti Asayag: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a0d472215ec1b0c359c0e2012e142ae8a627ce9
Gerrit-PatchSet: 28
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkaplan at redhat.com>
Gerrit-Reviewer: Michael Pasternak <mpastern at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list