Bug 1568063

Summary: [RFE] Hammer Job Cancellation
Product: Red Hat Satellite Reporter: Camry Fedei <cfedei>
Component: Remote ExecutionAssignee: Adam Ruzicka <aruzicka>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.14CC: akarsale, apatel, aruzicka, bkearney, cwelton, dhlavacd, inecas, kgaikwad, mhulan, pcreech, rabajaj, wlehman
Target Milestone: 6.5.0Keywords: FutureFeature
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: hammer_cli_foreman_remote_execution-0.1.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:37:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1465521    
Bug Blocks: 1582380    

Description Camry Fedei 2018-04-16 17:06:02 UTC
Description of problem:
Currently only able to cancel a job via the UI. Would like the ability to cancel the job via CLI via: # hammer job-invocation cancel id=job_id

Steps to complete in WebUI:
 1. Navigate to Monitor -> Jobs 
 2. Choose scheduled Job in question
 3. Select "Cancel Job"

Potential/Preferred Alternative:
 #  hammer job-invocation cancel id=job_id

Practical Use Case:
 - Partner has a customer who has provided a list of jobs needing to be scheduled for remote execution via satellite, and has decided to cancel one of these jobs for any reason.
     > It's difficult to search these as you can find the ID via hammer, but were unable to search through the webUI in the same manner, and have to dig through their other tasks to try and find the appropriate task.
     > Would make for a much easier execution to simply utilize hammer for the cancellation.

Comment 3 Adam Ruzicka 2018-06-04 12:46:49 UTC
hammer_cli_foreman_remote_execution-0.1.0 containing the needed bits and pieces was released in upstream.

Comment 8 jcallaha 2019-01-10 21:57:30 UTC
Verified in Satellite 6.5.0 Snap 10

[vagrant@sat-6-5-qa-rhel7 ~]$ hammer job-invocation list
---|--------------------------|--------|---------|--------|---------|-------|------------------------
ID | DESCRIPTION              | STATUS | SUCCESS | FAILED | PENDING | TOTAL | START                  
---|--------------------------|--------|---------|--------|---------|-------|------------------------
1  | Run ping -c 5 google.com | queued | N/A     | N/A    | N/A     | N/A   | 2019-01-11 21:46:00 UTC
---|--------------------------|--------|---------|--------|---------|-------|------------------------ 

[vagrant@sat-6-5-qa-rhel7 ~]$ hammer job-invocation cancel --id 1
Job invocation 1 cancelled

[vagrant@sat-6-5-qa-rhel7 ~]$ hammer job-invocation list
---|--------------------------|--------|---------|--------|---------|-------|------------------------
ID | DESCRIPTION              | STATUS | SUCCESS | FAILED | PENDING | TOTAL | START                  
---|--------------------------|--------|---------|--------|---------|-------|------------------------
1  | Run ping -c 5 google.com | failed | N/A     | N/A    | N/A     | 0     | 2019-01-11 21:46:00 UTC
---|--------------------------|--------|---------|--------|---------|-------|------------------------

Comment 10 errata-xmlrpc 2019-05-14 12:37:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:1222