"Fossies" - the Fresh Open Source Software Archive

Member "unicore-ucc-8.0.2/samples/killall.groovy" (10 Sep 2020, 662 Bytes) of package /linux/misc/unicore-ucc-8.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Java source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "killall.groovy": 8.0.1_vs_8.0.2.

    1 /*
    2 * deletes all successful jobs
    3 *
    4 * run with 'ucc run-groovy -f killall.groovy'
    5 * 
    6 */
    7 
    8 import eu.unicore.client.*
    9 import eu.unicore.client.core.*
   10 import eu.unicore.client.lookup.CoreEndpointLister
   11 
   12 def kill(job, statuscode){
   13   if (job.status==statuscode){
   14      println("Deleting "+job.endpoint.url)
   15      job.delete()
   16   }
   17 }
   18 
   19 // iterate over sites and delete all jobs that are "SUCCESSFUL"
   20 
   21 def endpoints = new CoreEndpointLister(registry, configurationProvider, auth)
   22 
   23 endpoints.each {
   24    it.jobsList.each {
   25       def jc = new JobClient(new Endpoint(it), configurationProvider.getClientConfiguration(it), auth)
   26       kill(jc, JobClient.Status.SUCCESSFUL)
   27    }
   28 }