Search in sources :

Example 6 with V3Permissions

use of org.ovirt.engine.api.v3.types.V3Permissions in project ovirt-engine by oVirt.

the class V3TemplatesServer method add.

@POST
@Consumes({ "application/xml", "application/json" })
public Response add(V3Template template) {
    // cloned, but in V4 this element has been removed and replaced by a "clone_permissions" parameter:
    if (template.isSetPermissions()) {
        V3Permissions permissions = template.getPermissions();
        if (permissions.isSetClone() && permissions.isClone()) {
            Map<String, String> parameters = CurrentManager.get().getParameters();
            parameters.put("clone_permissions", String.valueOf(true));
        }
    }
    Response response = adaptAdd(getDelegate()::add, template);
    V3TemplateHelper.addDisksLink(response);
    return response;
}
Also used : Response(javax.ws.rs.core.Response) V3Permissions(org.ovirt.engine.api.v3.types.V3Permissions) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes)

Aggregations

V3Permissions (org.ovirt.engine.api.v3.types.V3Permissions)6 V3Disks (org.ovirt.engine.api.v3.types.V3Disks)3 Consumes (javax.ws.rs.Consumes)2 POST (javax.ws.rs.POST)2 Response (javax.ws.rs.core.Response)2 Disk (org.ovirt.engine.api.model.Disk)2 DiskAttachment (org.ovirt.engine.api.model.DiskAttachment)2 V3CdRoms (org.ovirt.engine.api.v3.types.V3CdRoms)2 V3CustomProperties (org.ovirt.engine.api.v3.types.V3CustomProperties)2 V3Disk (org.ovirt.engine.api.v3.types.V3Disk)2 V3Floppies (org.ovirt.engine.api.v3.types.V3Floppies)2 V3KatelloErrata (org.ovirt.engine.api.v3.types.V3KatelloErrata)2 V3Nics (org.ovirt.engine.api.v3.types.V3Nics)2 V3Payloads (org.ovirt.engine.api.v3.types.V3Payloads)2 V3ReportedDevices (org.ovirt.engine.api.v3.types.V3ReportedDevices)2 V3Snapshots (org.ovirt.engine.api.v3.types.V3Snapshots)2 V3Statistics (org.ovirt.engine.api.v3.types.V3Statistics)2 V3Status (org.ovirt.engine.api.v3.types.V3Status)2 V3Tags (org.ovirt.engine.api.v3.types.V3Tags)2 V3WatchDogs (org.ovirt.engine.api.v3.types.V3WatchDogs)2