Eli Mesika has uploaded a new change for review. Change subject: [WIP] API: Adding JobResource and JobsResource... ......................................................................
[WIP] API: Adding JobResource and JobsResource... API: Adding JobResource and JobsResource interfaces Change-Id: Id1b95a094dc586e6ebbdacd44e0a034e91604385 Signed-off-by: Eli Mesika <[email protected]> Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=872719 --- A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/JobResource.java A backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/JobsResource.java 2 files changed, 79 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/62/16162/1 diff --git a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/JobResource.java b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/JobResource.java new file mode 100644 index 0000000..15ee633 --- /dev/null +++ b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/JobResource.java @@ -0,0 +1,43 @@ +package org.ovirt.engine.api.resource; + + +import javax.ws.rs.Consumes; +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.Action; +import org.ovirt.engine.api.model.Actionable; +import org.ovirt.engine.api.model.Job; + +@Produces( { ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML }) +public interface JobResource { + + @Path("{action: (end|clear)}/{oid}") + public ActionResource getActionSubresource(@PathParam("action")String action, @PathParam("oid")String oid); + + @POST + @Formatted + @Consumes({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML}) + @Actionable + @Path("end") + public Response end(Action action); + + @POST + @Formatted + @Consumes({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML}) + @Actionable + @Path("clear") + public Response clear(Action action); + + @GET + @Formatted + public Job get(); + + @Path("steps") + public StepsResource getStepsResource(); +} diff --git a/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/JobsResource.java b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/JobsResource.java new file mode 100644 index 0000000..334bd29 --- /dev/null +++ b/backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/JobsResource.java @@ -0,0 +1,36 @@ +package org.ovirt.engine.api.resource; + +import javax.ws.rs.Consumes; +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.Job; +import org.ovirt.engine.api.model.Jobs; + +@Path("/jobs") +@Produces( { ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML }) +public interface JobsResource { + + @GET + @Formatted + public Jobs list(); + + @POST + @Formatted + @Consumes({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML}) + public Response add(Job job); + + /** + * Sub-resource locator method, returns individual EventResource on which the remainder of the URI is dispatched. + * + * @param id the Event ID + * @return matching sub-resource if found + */ + @Path("{id}") + public JobResource getJobSubResource(@PathParam("id") String id); +} -- To view, visit http://gerrit.ovirt.org/16162 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id1b95a094dc586e6ebbdacd44e0a034e91604385 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Eli Mesika <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
