Skip to content

rafaeldelrey/controlm_py

Repository files navigation

controlm-py

Provides access to BMC Control-M Services

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 9.20.115
  • Package version: 9.20.115
  • Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/dcompane/controlm_py.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/dcompane/controlm_py.git)

Then import the package:

import controlm_py 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import controlm_py

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import controlm_py
from controlm_py.rest import ApiException
from pprint import pprint

# Configure API key authorization: Bearer
configuration = controlm_py.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = controlm_py.ArchiveApi(controlm_py.ApiClient(configuration))
job_id = 'job_id_example' # str | The job ID
run_no = 789 # int | The execution number in case of multiple executions

try:
    # Get job log
    api_response = api_instance.get_archive_job_log(job_id, run_no)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ArchiveApi->get_archive_job_log: %s\n" % e)

# Configure API key authorization: Bearer
configuration = controlm_py.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = controlm_py.ArchiveApi(controlm_py.ApiClient(configuration))
job_id = 'job_id_example' # str | The job ID
run_no = 789 # int | The execution number in case of multiple executions

try:
    # Get job output
    api_response = api_instance.get_archive_job_output(job_id, run_no)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ArchiveApi->get_archive_job_output: %s\n" % e)

# Configure API key authorization: Bearer
configuration = controlm_py.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = controlm_py.ArchiveApi(controlm_py.ApiClient(configuration))
limit = 500 # int | maximum jobs to fetch (default 500). (optional) (default to 500)
jobname = 'jobname_example' # str | The name of the job. (optional)
jobid = 'jobid_example' # str |  (optional)
ctm = 'ctm_example' # str | The name of the Control-M server in which the job was ordered from. (optional)
server = 'server_example' # str | The name of the Control-M server in which the job was ordered from. (optional)
folder = 'folder_example' # str | The name of the parent folder. (optional)
from_time = 'from_time_example' # str | Job execution start date. Date format - YYYY-MM-DD. (optional)
to_time = 'to_time_example' # str | Job execution end date. Date format - YYYY-MM-DD. (optional)
log_contains = 'log_contains_example' # str | Job log must contain the given phrase. (optional)
output_contains = 'output_contains_example' # str | Job output must contain the given phrase. (optional)
application = 'application_example' # str | The name of the application the jobs belong to. (optional)
sub_application = 'sub_application_example' # str | The name of the sub-application the jobs belong to. (optional)
library = 'library_example' # str | The job's library name. (optional)
mem_name = 'mem_name_example' # str | Member name. (optional)
mem_library = 'mem_library_example' # str | Member's library. (optional)
host = 'host_example' # str |  (optional)
host_group = 'host_group_example' # str | Job's host group. (optional)
run_as = 'run_as_example' # str | Runs as (username on agent machine). (optional)
order_id = 'order_id_example' # str | Job's order id. (optional)
status = 'All' # str | The job's end status. (optional) (default to All)
order_date_from = 'order_date_from_example' # str | Indicating a date by which will look for jobs that their order date started afterwards. Date format - YYYY-MM-DD. (optional)
order_date_to = 'order_date_to_example' # str | Indicating a date by which will look for jobs that their order date ended before. Date format - YYYY-MM-DD. (optional)
number_of_runs = 789 # int |  (optional)

try:
    # Search jobs in Archive
    api_response = api_instance.search_jobs(limit=limit, jobname=jobname, jobid=jobid, ctm=ctm, server=server, folder=folder, from_time=from_time, to_time=to_time, log_contains=log_contains, output_contains=output_contains, application=application, sub_application=sub_application, library=library, mem_name=mem_name, mem_library=mem_library, host=host, host_group=host_group, run_as=run_as, order_id=order_id, status=status, order_date_from=order_date_from, order_date_to=order_date_to, number_of_runs=number_of_runs)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ArchiveApi->search_jobs: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to /

Class Method HTTP request Description
ArchiveApi get_archive_job_log GET /archive/{jobId}/log Get job log
ArchiveApi get_archive_job_output GET /archive/{jobId}/output Get job output
ArchiveApi search_jobs GET /archive/search Search jobs in Archive
BuildApi build_file POST /build Compile definitions file to check its validity
ConfigApi add_archive_rule POST /config/archive/rule Add Workload Archiving rule
ConfigApi add_external_user POST /config/mft/externaluser Add and external user
ConfigApi add_external_user_or_user_group_to_mft_folder POST /config/mft/virtualfolder/{folderName}/user/{userOrGroup} Add external user or user groups to virtual folder external users list.
ConfigApi add_gateway POST /config/mft/gateway add gateway.
ConfigApi add_host_to_hostgroup POST /config/server/{server}/hostgroup/{hostgroup}/agent add agent to hostgroup
ConfigApi add_hub_to_cluster POST /config/mft/cluster/hub/{agentname} add hub to cluster.
ConfigApi add_mft_folder POST /config/mft/virtualfolder Add virtual folder
ConfigApi add_mft_user_group POST /config/mft/usergroup Add user group.
ConfigApi add_pgp_template POST /config/server/{server}/agent/{agent}/mft/pgptemplate/{templateName} Add PGP Template
ConfigApi add_remote_host POST /config/server/{server}/remotehost add remote host to Server
ConfigApi add_role POST /config/authorization/role Add Authorization Role
ConfigApi add_role_to_ldap_group POST /config/authorization/ldap/{ldapgroup}/role/{role} Add a role to LDAP group
ConfigApi add_role_to_user POST /config/authorization/user/{user}/role/{role} Add a role to user
ConfigApi add_secret POST /config/secret Add a new secret
ConfigApi add_server POST /config/server add server to the system
ConfigApi add_user POST /config/authorization/user Add user
ConfigApi add_zos_template POST /config/server/{server}/agent/{agent}/mft/zostemplate/{templateName} Add z/OS Template
ConfigApi authorize_mft_ssh_cluster POST /config/server/{server}/agent/{agent}/mft/ssh/cluster/{clusterName} Authorize SSH Cluster
ConfigApi authorize_mft_ssh_host POST /config/server/{server}/agent/{agent}/mft/ssh/host/{hostname} Authorize SSH Host
ConfigApi authorize_ssh_known_remotehost POST /config/server/{server}/remotehost/{remotehost}/authorize Authorize
ConfigApi change_user_password POST /config/user/{user}/password/adminUpdate Change user password
ConfigApi create_agent_certificate_signing_request POST /config/server/{server}/agent/{agent}/csr Create certificate signing request (CSR).
ConfigApi create_run_as_user POST /config/server/{server}/runasuser Add a new Run-as user
ConfigApi delete_agent DELETE /config/server/{server}/agent/{agent} delete an agent from Server
ConfigApi delete_archive_rule DELETE /config/archive/rule/{ruleName} Delete Workload Archiving rule
ConfigApi delete_authorization_role DELETE /config/authorization/role/{role} Delete Authorization Role
ConfigApi delete_external_user DELETE /config/mft/externaluser/{username} Delete an external user
ConfigApi delete_external_user_or_user_group_from_mft_folder DELETE /config/mft/virtualfolder/{folderName}/user/{userOrGroup} Remove an external user or user group from an existing virtual folder in MFT.
ConfigApi delete_host_from_group DELETE /config/server/{server}/hostgroup/{hostgroup}/agent/{host} delete an agent from a hostgroup
ConfigApi delete_host_group DELETE /config/server/{server}/hostgroup/{hostgroup} delete host group
ConfigApi delete_mft_folder DELETE /config/mft/virtualfolder/{folderName} Delete a virtual folder.
ConfigApi delete_mft_user_group DELETE /config/mft/usergroup/{name} Delete user group.
ConfigApi delete_pgp_template DELETE /config/server/{server}/agent/{agent}/mft/pgptemplate/{templateName} Delete PGP Template
ConfigApi delete_remote_host DELETE /config/server/{server}/remotehost/{remotehost} delete a remote host from Server
ConfigApi delete_role_from_ldap_group DELETE /config/authorization/ldap/{ldapgroup}/role/{role} Delete a role from LDAP group
ConfigApi delete_run_as_user DELETE /config/server/{server}/runasuser/{agent}/{user} delete Run-as user
ConfigApi delete_secret DELETE /config/secret/{name} Delete an existing secret
ConfigApi delete_user DELETE /config/authorization/user/{user} Delete user
ConfigApi delete_zos_template DELETE /config/server/{server}/agent/{agent}/mft/zostemplate/{templateName} Delete z/OS Template
ConfigApi deploy_agent_certificate POST /config/server/{server}/agent/{agent}/crt Deploy certificate (CRT).
ConfigApi disable_agent POST /config/server/{server}/agent/{agent}/disable disable agent from the Server
ConfigApi enable_agent POST /config/server/{server}/agent/{agent}/enable enable agent from the Server
ConfigApi failover PUT /config/server/{server}/failover Perform Manual Failover on a specified Server
ConfigApi generate_mft_rsa_ssh_key POST /config/server/{server}/agent/{agent}/mft/ssh/key Generate RSA SSH Key
ConfigApi get_agent_certificate_expiration_date GET /config/server/{server}/agent/{agent}/crt/expiration Get certificate expiration date.
ConfigApi get_agent_parameters GET /config/server/{server}/agent/{agent}/params get agent parameters
ConfigApi get_agents GET /config/server/{server}/agents get Server agents
ConfigApi get_all_archive_rules GET /config/archive/rules Get all Workload Archiving rules
ConfigApi get_all_authorization_roles GET /config/authorization/roles Get Authorization Roles
ConfigApi get_all_ldap_groups GET /config/authorization/ldaps Get All LDAP groups
ConfigApi get_all_roles_associated_with_ldap GET /config/authorization/ldap/{ldapgroup}/roles Get Authorization Roles associated with an LDAP group
ConfigApi get_all_users GET /config/authorization/users Get users
ConfigApi get_archive_statistics GET /config/archive/statistics Get Workload Archiving statistics
ConfigApi get_external_user_authorized_folders GET /config/mft/externaluser/{name}/virtualfolders Get MFT external user authorized folders
ConfigApi get_external_users GET /config/mft/externalusers Get MFT external users that match the search criteria.
ConfigApi get_fts_settings GET /config/server/{server}/agent/{agent}/mft/fts/settings Get File Transfer Server (FTS) configuration data.
ConfigApi get_hostgroups GET /config/server/{server}/hostgroups get Server hostgroups
ConfigApi get_hosts_in_group GET /config/server/{server}/hostgroup/{hostgroup}/agents get hostgroup agents
ConfigApi get_hub_status_details GET /config/mft/hub/{nodeId}/status Get hub status.
ConfigApi get_mft_configuration GET /config/server/{server}/agent/{agent}/mft/configuration Get MFT Configuration
ConfigApi get_mft_folders GET /config/mft/virtualfolders Get MFT virtual folders that match the search criteria.
ConfigApi get_mft_gateways GET /config/mft/gateways Get MFT gateways
ConfigApi get_mft_user_groups GET /config/mft/usergroups Get all user groups that match the search criteria.
ConfigApi get_pgp_templates GET /config/server/{server}/agent/{agent}/mft/pgptemplates Get PGP Templates
ConfigApi get_remote_host_properties GET /config/server/{server}/remotehost/{remotehost} get a remote host configuration from Server
ConfigApi get_remote_hosts GET /config/server/{server}/remotehosts get Server remote hosts
ConfigApi get_role GET /config/authorization/role/{role} Get Authorization Role
ConfigApi get_role_associates GET /config/authorization/role/{role}/associates Get all authorization entities associated with role
ConfigApi get_run_as_user GET /config/server/{server}/runasuser/{agent}/{user} Get Run-as user
ConfigApi get_run_as_users_list GET /config/server/{server}/runasusers Get Run-as user list that match the requested search criteria.
ConfigApi get_server_parameters GET /config/server/{server}/params get Server parameters
ConfigApi get_servers GET /config/servers get all the Servers name and hostname in the system
ConfigApi get_user GET /config/authorization/user/{user} Get user
ConfigApi get_user_effective_rights GET /config/authorization/user/effectiveRights Get user real effective authorizations
ConfigApi get_zos_templates GET /config/server/{server}/agent/{agent}/mft/zostemplates Get z/OS Templates
ConfigApi list_secrets GET /config/secrets Get list of secret names
ConfigApi ping_agent POST /config/server/{server}/agent/{agent}/ping ping to the agent in the Server
ConfigApi recycle_item POST /config/item/{id}/recycle recycle item
ConfigApi remove_controlm_server DELETE /config/server/{server} Delete Server
ConfigApi remove_gateway DELETE /config/mft/gateway/{gatewayName} remove gateway.
ConfigApi remove_hub_from_cluster DELETE /config/mft/cluster/hub/{agentname} remove hub from cluster.
ConfigApi remove_role_from_user DELETE /config/authorization/user/{user}/role/{role} Remove a role from a user
ConfigApi send_archive_cleanup_request DELETE /config/archive/cleanup Deletes data (jobs including outputs and logs) from the Workload Archiving database.
ConfigApi set_agent_parameter POST /config/server/{server}/agent/{agent}/param/{name} set agent parameter
ConfigApi set_system_param POST /config/em/param/{name} set value of a an em system parameter
ConfigApi setasprimary PUT /config/server/{server}/setasprimary Set secondary server as Primary on a specified Server
ConfigApi test_run_as_user POST /config/server/{server}/runasuser/{agent}/{user}/test Test existed Run-as user
ConfigApi update_archive_rule POST /config/archive/rule/{ruleName} Edit Workload Archiving rule
ConfigApi update_external_user POST /config/mft/externaluser/{username} Update an external user
ConfigApi update_fts_settings POST /config/server/{server}/agent/{agent}/mft/fts/settings Update File Transfer Server (FTS) configuration data.
ConfigApi update_hosts_in_hostgroup POST /config/server/{server}/hostgroup/{hostgroup} update agents in hostgroup.
ConfigApi update_mft_configuration POST /config/server/{server}/agent/{agent}/mft/configuration Update MFT Configuration
ConfigApi update_mft_folder POST /config/mft/virtualfolder/{folderName} Update an existing virtual folder in MFT.
ConfigApi update_mft_user_group POST /config/mft/usergroup/{name} Update user group.
ConfigApi update_pgp_template PUT /config/server/{server}/agent/{agent}/mft/pgptemplate/{templateName} Update PGP Template
ConfigApi update_role POST /config/authorization/role/{role} Update Authorization Role
ConfigApi update_run_as_user POST /config/server/{server}/runasuser/{agent}/{user} Update Run-as user
ConfigApi update_secret POST /config/secret/{name} Update an existing secret
ConfigApi update_user POST /config/authorization/user/{user} Update user
ConfigApi update_zos_template PUT /config/server/{server}/agent/{agent}/mft/zostemplate/{templateName} Update z/OS Template
DeployApi delete_calendar DELETE /deploy/calendar/{calendarName} delete a calendar
DeployApi delete_connection_profile DELETE /deploy/connectionprofile/{server}/{agent}/{type}/{name} Delete Local Connection Profile
DeployApi delete_folder DELETE /deploy/folder/{controlM}/{folderName} delete a folder
DeployApi delete_local_connection_profile DELETE /deploy/connectionprofile/local/{server}/{agent}/{type}/{name} Delete Local Connection Profile
DeployApi delete_shared_connection_profile DELETE /deploy/connectionprofile/centralized/{type}/{name} Delete centralized Connection Profile
DeployApi deploy_ai_jobtype POST /deploy/ai/jobtype Deploy of Application Integrator job type.
DeployApi deploy_file POST /deploy Deploy definitions file
DeployApi deploy_jobtype_file POST /deploy/jobtype Deploy jobtype
DeployApi get_connection_profiles_deployment_status GET /deploy/connectionprofile/centralized/deploymentstatus/{type}/{name} Get deployed connection profiles deployment status
DeployApi get_deployed_ai_jobtypes GET /deploy/ai/jobtypes Get Application Integrator job types
DeployApi get_deployed_calendars GET /deploy/calendars Get deployed calendars that match the search criteria.
DeployApi get_deployed_connection_profiles GET /deploy/connectionprofiles Get local deployed connection profiles
DeployApi get_deployed_connection_profiles_status GET /deploy/connectionprofiles/centralized/status Get deployed connection profiles status
DeployApi get_deployed_folders_new GET /deploy/jobs Get deployed jobs that match the search criteria.
DeployApi get_local_connection_profiles GET /deploy/connectionprofiles/local Get local deployed connection profiles
DeployApi get_shared_connection_profiles GET /deploy/connectionprofiles/centralized Get centralized deployed connection profile
DeployApi get_site_standard_field_restrictions GET /deploy/sitestandard/{standardName}/fieldRestriction/{fieldName} Get the allowed values for the specified field in the specified site standard.
DeployApi set_site_standard_field_restrictions POST /deploy/sitestandard/{standardName}/fieldRestriction/{fieldName} Replace the allowed values for the specified field in the specified site standard.
DeployApi test_connection_profile POST /deploy/connectionprofile/test Test connection profile on agent
DeployApi transform_file POST /deploy/transform Transform a definitions file
ProvisionApi cancel_upgrade_activity POST /provision/upgrade/{upgradeId}/cancel Cancel upgrade activity
ProvisionApi delete_upgrade_activity DELETE /provision/upgrade/{upgradeId} Delete upgrade activity status for specific upgrade id.
ProvisionApi get_all_upgrade_activities_status GET /provision/upgrades Get all upgrade activities status.
ProvisionApi get_deploy_versions GET /provision/upgrades/versions Get available versions for upgrade.
ProvisionApi get_eligible_agents_for_upgrade GET /provision/upgrades/agents Get eligible agents for upgrade that match the requested search criteria.
ProvisionApi get_images GET /provision/images/{os} get list of available images for the requested OS
ProvisionApi get_upgrade_activity_log GET /provision/upgrade/{upgradeId}/output Returns log of upgrade activity.
ProvisionApi get_upgrade_activity_status_per_upgrade_id GET /provision/upgrade/{upgradeId} Get upgrade activity status for specific upgrade id.
ProvisionApi retry_upgrade_activity POST /provision/upgrade/{upgradeId}/retry Retry upgrade activity
ProvisionApi transfer_and_install_product POST /provision/upgrade/install Transfer and install a product on an agent
ProvisionApi uninstall_product POST /provision/upgrade/uninstall Uninstall a product from an agent
ReportingApi get_report_by_name GET /reporting/report/{name} Retrieves a report by name.
ReportingApi get_report_filters GET /reporting/reportFilters/{name} Retrieves report filters
ReportingApi get_report_status GET /reporting/status/{reportId} Retrieves status information for a report generation request based on the report ID
ReportingApi run_report POST /reporting/report Run a report
RunApi activate_workload_policy POST /run/workloadpolicy/{policy}/activate activate workload policy
RunApi add_event POST /run/event/{server} Add a new event.
RunApi add_resource POST /run/resource/{server} Add a new pool resource.
RunApi confirm_job POST /run/job/{jobId}/confirm confirm a job
RunApi deactivate_workload_policy POST /run/workloadpolicy/{policy}/deactivate deactivate a workload policy
RunApi delete_event DELETE /run/event/{server}/{name}/{date} Delete a event.
RunApi delete_job POST /run/job/{jobId}/delete mark job as deleted
RunApi delete_resource DELETE /run/resource/{server}/{name} Delete a pool resource.
RunApi free_job POST /run/job/{jobId}/free free an already held the job
RunApi get_active_job GET /run/job/{jobId}/get get active job
RunApi get_active_services GET /run/services/sla Get SLA active services
RunApi get_events GET /run/events Get all events records for specific search.
RunApi get_job_log GET /run/job/{jobId}/log Get job's log
RunApi get_job_output GET /run/job/{jobId}/output Get job output
RunApi get_job_statistics GET /run/job/{jobId}/statistics Get job statistics
RunApi get_job_status GET /run/job/{jobId}/status Get status of a job
RunApi get_jobs_status GET /run/status/{runId} Get status of running jobs
RunApi get_jobs_status_by_filter GET /run/jobs/status Get jobs that match the search criteria.
RunApi get_resources GET /run/resources Get all resources records matching search.
RunApi get_waiting_info GET /run/job/{jobId}/waitingInfo get job's waiting information
RunApi get_workload_policies GET /run/workloadpolicies get workload policies
RunApi hold_job POST /run/job/{jobId}/hold hold the job so it will not start untill it is freed
RunApi kill_job POST /run/job/{jobId}/kill Cancel running job
RunApi modify_job POST /run/job/{jobId}/modify Modify active job
RunApi order_jobs_in_folder POST /run/order Execute requested jobs in certain folder
RunApi rerun_job POST /run/job/{jobId}/rerun Run job again
RunApi run_jobs POST /run Run jobs
RunApi run_now POST /run/job/{jobId}/runNow Bypass scheduling cretirias and start the job
RunApi set_to_ok POST /run/job/{jobId}/setToOk set job end status to OK
RunApi undelete_job POST /run/job/{jobId}/undelete recover a mark for deletion job
RunApi update_alert POST /run/alerts Update alert.
RunApi update_alert_status POST /run/alerts/status Update alert status.
RunApi update_resource POST /run/resource/{server}/{name} Update a pool resource.
SessionApi do_login POST /session/login login user to Control-M
SessionApi do_logout POST /session/logout logout user from Control-M
SessionApi update_my_password POST /session/user/password/update Change my password

Documentation For Models

Documentation For Authorization

Bearer

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author

customer_support@bmc.com

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors