Bug 1404051 - End external job expects a status to be provided, but it's not declared in the api model
Summary: End external job expects a status to be provided, but it's not declared in th...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ovirt-4.1.0-beta
: 4.1.0.2
Assignee: Juan Hernández
QA Contact: Aleksei Slaikovskii
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-12 23:56 UTC by Moti Asayag
Modified: 2017-02-01 14:48 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-01 14:48:20 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
gklein: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 68600 0 master MERGED Add 'succeeded' parameter to Job.end 2016-12-20 08:41:27 UTC
oVirt gerrit 68605 0 master MERGED restapi: Add 'succeeded' parameter to Job.end 2017-01-16 10:03:28 UTC
oVirt gerrit 70474 0 ovirt-engine-4.1 MERGED restapi: Add 'succeeded' parameter to Job.end 2017-01-16 11:03:45 UTC

Description Moti Asayag 2016-12-12 23:56:37 UTC
Description of problem:
The 'status' parameter is mandatory for terminating an external job, however it is not described anywhere.

In addition, even if the status is set, the final status set to the job might not match the one provided by the user.
i.e. if the user asked to terminate a job as 'aborted', it will be marked as 'failed'.

Version-Release number of selected component (if applicable):
4.1.master

How reproducible:
always

Steps to Reproduce:
1. send the following request to terminate a job:

  <action>
    <force>true</force>
  </action>

Actual results:
The request failed due to incomplete parameter.

Expected results:
The model should declare on that parameter.

Additional info:

The 'status' for terminating an external job via the api is mandatory:
(taken from BackendJobResource.java)
public Response end(Action action) {
        validateParameters(action, "status");
  ...
}


However, the model (Job.java) doesn't define such parameter for the end-job request:

interface End {
        @In Boolean force();
        @In Boolean async();
    }

Comment 1 Juan Hernández 2016-12-16 13:15:31 UTC
I believe that the right way to solve this issue is to add a new 'succeeded' parameter to the operation that ends the job. That parameter should be optional, and by default it should be `true`. Same for the 'step'. The following patch documents that in the specification of the API:

  Add 'succeeded' parameter to Job.end
  https://gerrit.ovirt.org/68600

And the following patch implements it in the server:

  restapi: Add 'succeeded' parameter to Job.end
  https://gerrit.ovirt.org/68605

Comment 2 Aleksei Slaikovskii 2017-01-30 16:04:41 UTC
Verified on ovirt-engine-4.1.1-0.0.master


Note You need to log in before you can comment on or make changes to this bug.