-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cancel job #299
Add cancel job #299
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
samples/kill_all_jobs.py
Outdated
@@ -0,0 +1,47 @@ | |||
#### | |||
# This script demonstrates how to list all of the workbooks or datasources |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description here and on line 15 needs update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits 🚀
samples/kill_all_jobs.py
Outdated
req = TSC.RequestOptions() | ||
|
||
req.filter.add(TSC.Filter("progress", TSC.RequestOptions.Operator.LessThanOrEqual, 0)) | ||
for job in TSC.Pager(server.jobs.get, request_opts=req): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: You can just pass the endpoint
@@ -76,7 +76,7 @@ def delete_request(self, url): | |||
# We don't return anything for a delete | |||
self._make_request(self.parent_srv.session.delete, url, auth_token=self.parent_srv.auth_token) | |||
|
|||
def put_request(self, url, xml_request, content_type='text/xml'): | |||
def put_request(self, url, xml_request=None, content_type='text/xml'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So cancel takes an empty (as in b''
) PUT? Didn't run job take an empty <tsRequest/ >
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah...
@@ -17,12 +18,20 @@ def get(self, job_id=None, req_options=None): | |||
import warnings | |||
warnings.warn("Jobs.get(job_id) is deprecated, update code to use Jobs.get_by_id(job_id)") | |||
return self.get_by_id(job_id) | |||
if isinstance(job_id, RequestOptionsBase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm so sad. But customers will love the functionality!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah once we hit 1.0, we can remove this.
No description provided.