tron.commands.client module¶
A command line http client used by tronview, tronctl, and tronfig
- class tron.commands.client.Client(url_base, cluster_name=None, user_attribution=False)¶
Bases:
objectAn HTTP client used to issue commands to the Tron API.
- action_runs(action_run_url, num_lines=0)¶
- config(config_name, config_data=None, config_hash=None, check=False)¶
Retrieve or update the configuration.
- get_url(identifier)¶
- home()¶
- http_get(url, data=None)¶
- index()¶
- job(job_url, include_action_runs=False, count=0)¶
- job_runs(url, include_runs=True, include_graph=False)¶
- jobs(include_job_runs=False, include_action_runs=False, include_action_graph=True, include_node_pool=True)¶
- metrics()¶
- request(url, data=None)¶
- status()¶
- class tron.commands.client.IdentifierParts(name, full_id, length)¶
Bases:
tuple- full_id¶
Alias for field number 1
- length¶
Alias for field number 2
- name¶
Alias for field number 0
- exception tron.commands.client.RequestError¶
Bases:
ValueErrorRaised when the request to tron API fails.
- class tron.commands.client.Response(error, msg, content)¶
Bases:
tuple- content¶
Alias for field number 2
- error¶
Alias for field number 0
- msg¶
Alias for field number 1
- class tron.commands.client.TronObjectIdentifier(type, url)¶
Bases:
tuple- type¶
Alias for field number 0
- url¶
Alias for field number 1
- class tron.commands.client.TronObjectType¶
Bases:
objectConstants to identify a Tron object type.
- action_run = 'ACTION_RUN'¶
- groups = {'jobs': ['JOB', 'JOB_RUN', 'ACTION_RUN']}¶
- job = 'JOB'¶
- job_run = 'JOB_RUN'¶
- url_builders = {'jobs': <function get_job_url>}¶
- tron.commands.client.build_api_url(resource, identifier_parts)¶
- tron.commands.client.build_get_url(url, data=None)¶
- tron.commands.client.build_http_error_response(exc)¶
- tron.commands.client.build_url_request(uri, data, headers=None, method=None)¶
- tron.commands.client.ensure_user_attribution(headers: Dict[str, str]) Dict[str, str]¶
- tron.commands.client.first(seq)¶
- tron.commands.client.get_job_url(identifier)¶
- tron.commands.client.get_object_type_from_identifier(url_index, identifier)¶
Given a string identifier, return a TronObjectIdentifier.
- tron.commands.client.load_response_content(http_response)¶
- tron.commands.client.request(uri, data=None, headers=None, method=None, user_attribution=False)¶
- tron.commands.client.split_identifier(identifier)¶