Hi,
I see there is a lot of jobs running in DataScope Select. Many of them have been started from C# API as RawExtraction. How can I cancel them ?
Thanks
Hi @Tux1
You can cancel active jobs using REST API or .Net SDK.
For REST API, the job cancellation can be request by issuing a delete to the monitor URL.
DELETE https://hosted.datascopeapi.thomsonreuters.com/restapi/v1/Extractions/ExtractRawResult(ExtractionId='<job Id>')
Active Jobs can be requested by issuing the following request.
GET https://hosted.datascopeapi.reuters.com/RestApi/v1/Jobs/JobGetActive
For .Net SDK, the same functions are available. Below is the sample code which cancels all active Jobs.
jobsContext = new JobsContext(dssUri, dssUserName, dssUserPassword);var activeJobs = jobsContext.JobOperations.GetActive();//Output the active jobsforeach (var activeJob in activeJobs.Take(10)){ System.Console.WriteLine("job: id {0}, status {1}, progress {2}, monitor url {3}", activeJob.JobId, activeJob.Status, activeJob.ProgressPercentage, activeJob.MonitorUrl); jobsContext.CancelJob(activeJob.MonitorUrl);}
For more information about Jobs, please see this key mechanism.
@Tux1
You can cancel an active in-progress job by submitting a DELETE to the MonitorUrl.Or, in the case of .NET C# API, use:
ExtractionsContext.CancelJob(IAsyncJob asyncJob);
or
ExtractionsContext.CancelJob(string monitorUrl);
See the C# example application for more information on monitoring and canceling jobs.
@webmastertux1, do you know who / what created these jobs ? If they come from your tests, then all is fine, but if you don't know, it might be worth investigating.
Thanks a lot. Exactly what I need