ctm_python_client.core package¶
Submodules¶
ctm_python_client.core.comm module¶
- class ctm_python_client.core.comm.AAPIClientResponse(success: bool, result: Any | None = None, errors: List[Any] | None = None)¶
Bases:
object
- is_ok()¶
- class ctm_python_client.core.comm.AbstractAAPIClient¶
Bases:
ABC
- abstract classmethod authenticate()¶
- class ctm_python_client.core.comm.Environment(endpoint: str, username: str | None = None, password: str | None = None, api_key: str | None = None, credentials: AbstractCredentials | None = None, mode: EnvironmentMode | None = None)¶
Bases:
object
- static create_onprem(host: str, port: str = '8443', username: str | None = None, password: str | None = None, credentials: AbstractCredentials | None = None)¶
- static create_saas(endpoint: str, api_key: str | None = None, credentials: AbstractCredentials | None = None)¶
- static create_workbench(host: str = 'localhost', port: str = '8443')¶
- class ctm_python_client.core.comm.EnvironmentMode(value)¶
Bases:
Enum
An enumeration.
- ONPREM = 'Control-M'¶
- SAAS = 'Control-M Helix'¶
- WORKBENCH = 'Control-M Workbench'¶
- class ctm_python_client.core.comm.OnPremAAPIClient(endpoint: str, credentials: AbstractCredentials)¶
Bases:
AbstractAAPIClient
- authenticate()¶
- class ctm_python_client.core.comm.SaasAAPIClient(endpoint: str, credentials: AbstractCredentials)¶
Bases:
AbstractAAPIClient
- authenticate()¶
ctm_python_client.core.credential module¶
- class ctm_python_client.core.credential.AbstractCredentials¶
Bases:
ABC
Abstract Class for Credentials
Use to create your custom classes for more advanced use cases of authentication
- abstract classmethod get_password()¶
- abstract classmethod get_username()¶
- class ctm_python_client.core.credential.InputPasswordCredentials(username: str)¶
Bases:
AbstractCredentials
- get_password()¶
- get_username()¶
- class ctm_python_client.core.credential.SimpleCredentials(username: str, password: str)¶
Bases:
AbstractCredentials
- get_password()¶
- get_username()¶
ctm_python_client.core.monitoring module¶
- class ctm_python_client.core.monitoring.Monitor(aapiclient: OnPremAAPIClient | SaasAAPIClient)¶
Bases:
object
- confirm_job(job_id: str) str ¶
Confirms a job. This only applies to jobs which where defined with confirm=True. Trying to confirm a job which can’t be confirmed or was already confirmed will result in error
- delete_job(job_id: str) str ¶
Deletes a job
- get_log(job_id: str) str ¶
Get the log of a job describing all actions regarding the job execution.
- get_output(job_id: str, run_number: int = 0)¶
- get_statuses(run_id: str | None = None, filter: Dict[str, Any] | None = None)¶
- hold_job(job_id: str) str ¶
Holds a job
- kill_job(job_id: str) str ¶
Kills a job
- release_job(job_id: str) str ¶
Releases a held job
- rerun_job(job_id: str) str ¶
Reruns a job
- set_to_ok(job_id: str) str ¶
Set a job to OK
- class ctm_python_client.core.monitoring.RunMonitor(run_id: str, aapiclient: OnPremAAPIClient | SaasAAPIClient, monitor_page_uri: str | None = None)¶
Bases:
Monitor
Class RunMonitor
Allows basic monitoring functions in a similar way that found in the Control-M Web interface
- confirm_job(job_name: str) str ¶
Confirms a job. This only applies to jobs which where defined with confirm=True. Trying to confirm a job which can’t be confirmed or was already confirmed will result in error
- delete_job(job_name: str) str ¶
Deletes a job
- get_jobid(job_name: str) str ¶
Get the job id from a job_name.
job_name can be a job name with or without path. If there are multiple jobs with the same name, the result will be determined according to path If no path is given, there will be an undefined behavior.
job_name example : “MyJob” or with path: “MyFolder/Subfolder1/Subfolder2/MyJob”
- get_log(job_name: str) str ¶
Get the log of a job describing all actions regarding the job execution.
- get_output(job_name: str, run_number: int = 0) str ¶
Get the output of a job describing all actions regarding the job execution. If not applicable, it returns None.
- get_status(job_name: str)¶
Get the status of a job.
- get_statuses()¶
Get the status of the run and all its jobs
- hold_job(job_name: str) str ¶
Holds a job
- kill_job(job_name: str) str ¶
Kills a job
- open_in_browser()¶
- print_output(job_name: str, run_number: int = 0)¶
Print the output of a job describing all actions regarding the job execution.
- print_statuses(**kwargs)¶
Pretty prints full status of the run and all its jobs
You can pass printer kwarg to specify a pretty pritner function. The function accepts one argument: the list of statuses
- release_job(job_name: str) str ¶
Releases a held job
- rerun_job(job_name: str) str ¶
Reruns a job
- set_to_ok(job_name: str) str ¶
Set a job to OK