Skip to main content
Question

Rest Api- Getting running jobs then kill some


Forum|alt.badge.img+12

Hi Team,

 

Is it possible to get backup jobs running with Commvault Rest API and then kill some of them according to the desired Job ID? Can such a process be done? Your ideas are important.

6 replies

Forum|alt.badge.img+12
  • Vaulter
  • 173 replies
  • August 29, 2024

@0ber0n ,

 

Yes you can do all that you are asking. This REST API call can give you the job listing.

https://documentation.commvault.com/2023e/expert/rest_api_get_job.html

You can then use this REST API call to kill a job.

https://documentation.commvault.com/2023e/expert/rest_api_post_job_kill.html

Regards,

Edward J Holowienka


Forum|alt.badge.img+12
  • Author
  • Byte
  • 104 replies
  • September 2, 2024

Hi @HolowEd 

Thanks for the reply.

Can we done it like automation ? Our main purpose is this: Everyday at 08:30AM it will be checked with Rest API, and some of the listed backups will be killed. We want to use this for VM backups, I can't use Blackout Window because this time there will be a snapshot left on the VMs and this will cause a another problem. Or is there another way you can suggest?


Everything can be automated. You have the list of jobs from the 1st API call, you can then use a list of chosen jobs to send the 2nd API call against each one of them possibly in async mode.


Forum|alt.badge.img+12
  • Author
  • Byte
  • 104 replies
  • September 3, 2024

Hi @Jacek Piechucki 

What would you suggest to achived our main purpose ?

Rest api, qcommand, ansible etc ?


It does not really matter. One customer will use a set of commands, another will be mastering ansible, the other one will just use workflow.

Use the approach you feel the best. Eventually, you will be the one seeing the benefits of your own implementation.


Forum|alt.badge.img+12
  • Author
  • Byte
  • 104 replies
  • September 5, 2024

@Jacek Piechucki  

Yes, you are right, I created a powershell script using qlogin, qoperation-GetAllRunningJobs, qlogout and it works as expected. Can I embed this script into the workflow creating new one and run it on a scheduled basis? How can I do this, it seems a bit complicated?

Another option is to trigger the ps1 file with a subclient's PreScan phase, but I want to try the option above first.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings