package org.ovirt.engine.api.resource;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

import org.jboss.resteasy.annotations.providers.jaxb.Formatted;
import org.ovirt.engine.api.model.NumaNodes;
import org.ovirt.engine.api.model.VirtualNumaNode;

@Produces({ ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML })
public interface VmNumaNodesResource {

    @GET
    @Formatted
    public NumaNodes list();

    @POST
    @Formatted
    @Consumes({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML})
    public Response add(VirtualNumaNode node);

    @DELETE
    @Path("{id}")
    public Response remove(@PathParam("id") String id);

    @Path("{iden}")
    public VmNumaNodeResource getVmNumaNodeSubResource(@PathParam("iden") String id);
}

package org.ovirt.engine.api.resource;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

import org.jboss.resteasy.annotations.providers.jaxb.Formatted;
import org.ovirt.engine.api.model.VirtualNumaNode;
import org.ovirt.engine.api.model.VirtualNumaNodes;

@Produces({ ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML })
public interface VmNumaNodesResource {

    @GET
    @Formatted
    public VirtualNumaNodes list();

    @POST
    @Formatted
    @Consumes({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML})
    public Response add(VirtualNumaNode node);

    @DELETE
    @Path("{id}")
    public Response remove(@PathParam("id") String id);

    @Path("{iden}")
    public VmNumaNodeResource getVmNumaNodeSubResource(@PathParam("iden") String id);
}

Fix return type of vms/{vm:id}/numanodes
restapi: Fix return type of vms/{vm:id}/numanodes

Currently the type returned by the "list" operation of this resources is
"NumaNodes", but it should be "VirtualNumaNodes", otherwise the
generator of the Java SDK will not work correctly.

Change-Id: I57af48c044012fe9009e51b48c8813114319980b
Bug-Url: https://bugzilla.redhat.com/1115610
Signed-off-by: Juan Hernandez <59e5b8140de97cc91c3fb6c5342dce948469af8c@redhat.com>
