control-m

Get a list of folder names with the Control-M Automation API


I use the Control-M Automation API version 9.0.21.100 to discover folders, jobs, calendars, resources and other Control-M configuration and then push them into an Azure DevOps repo so I can track changes. Today I use the GET /deploy/jobs endpoint to search Control-M for folders matching wildcard patterns. But that takes a lot of time and requests.

If I had a list of folder names or application and sub application names, I could use GET /deploy/jobs more efficiently.

Is there a way to use the API to get folder names or application and sub application names?

I tried GET /deploy/folders, but that fails with HTTP 404.

I can get folder names and application and subapplication names from the Control-M database if they aren't available in the API.

I considered using the reporting endpoints to generate a report of folders, applications, and sub applications. But I haven't used Control-M reports and it looks like the report endpoints only work when the report creator and consumer are the same user, so I'd have to create one report for each of our Control-M environments.


Solution

  • This functionality (GET /deploy/folders) is available starting with AAPI version 9.0.21.205. If you upgrade, you will have the ability to get a list of all folders per Control-M/Server.

    You need to pass values for server and folder, but you can set folder=* to retrieve a list of all folders.

    An example using the CLI API is:

    ctm deploy folders::get -s "server=my_ctm_server&folder=*"
    

    This was a feature I was also excited to have for the exact same reason.