4 Replies Latest reply on Nov 11, 2019 7:42 AM by Adriano Gomes

    Control-M : is there any automation API to get the details in the documentation tab of a job?

    sairam puvalla
      Share This:

      Hi ,

      I have a task where I need to fetch the details in the documentation tab of the job via an API call, I searched the control-M API documentation but no luck! Do we have any API for this , if so can somebody please share.

       

       

       

      Thanks & Regards,

      Sai

        • 1. Re: Control-M : is there any automation API to get the details in the documentation tab of a job?
          Adriano Gomes

          Hi sairam puvalla

           

          Actually there is no way to get documentation from current CTM API service calls.

           

          There are two suggestions that you can follow:

           

          The Documentation usually points to a path/filename on agent file system or an URL somewhere else accessible by http call.

          So, you can : 

           

          1)  add a "[type] or [cat]  DocPath/\DocFile" as POST_CMD on each job you desire to have access to documentation instructions

          2) or as an option for Documentation TYPE URL, Add a curl call as POST_CMD to render the URL provided.

           

          Once it is done, you will have the documentation file rendered to job sysout, then you can use "ctm run job:output::get <jobId> [runNo] "

           

          Cons: Some job types do not support POST_CMDs, usually CM/Application add-ons.

           

          My Best

          A>Gomes

          2 of 2 people found this helpful
          • 2. Re: Control-M : is there any automation API to get the details in the documentation tab of a job?
            MunKeong Lee

            Hi Sairam

            From your screenshot, your documentation is defined using documentation type "File". This makes retrieval difficult because it's located on the agent. If the documentation type is "URL" instead, you can make use of "deploy jobs::get" service to get all the jobs in the folder. In the response, you then parse the data to get the value of DocumetationUrl of the job. Using this value, you can then obtain the associated documentation.

            Regards,

            MK

            2 of 2 people found this helpful
            • 3. Re: Control-M : is there any automation API to get the details in the documentation tab of a job?
              sairam puvalla

              Thanks MunKeong Lee and Adriano Gomes for your response and suggestions .

               

              ok so, is there any possibility to fetch the "File Path" details from the "General" field of the jobs via an API or any other method?

               

              "File Path" highlighted in Yellow

              Thanks & Regards,

              Sai.

              • 4. Re: Control-M : is there any automation API to get the details in the documentation tab of a job?
                Adriano Gomes

                Hi sairam puvalla

                 

                As explained by MunKeong Lee , you can have the ^path^ and ^filename^ data only with CTM A API service call (ctm deploy jobs::get json -s "ctm=<your ctm name>&folder=<your folder name>") in json format by querying Job Definitions at TABLE/Folder level, then you can parse the json output and get the ^path^ and ^filename^ data for the specific job,  not the File content, but only the names of both ^path^ and ^filename^.

                 

                The reason is:

                1. There is no way to get the documentation file content using CTM AAPI service call.
                2. The job documentation resides on local agent file system probably on a different host where your CTMAPI Code/Service call is being performed.

                 

                If you wish to read the documentation File content as it seems, then :

                 

                • As suggested, you can adjust your documentation file type to "URL" and from your code you could perform the http call to render the url file.
                • Lastly, you can make the CTM Agent read the documentation file to job sysout and get it with a "ctm run job:output::get <jobId> [runNo] " api call.

                 

                I hope it is a bit more clear.

                 

                My Best

                 

                A>Gomes

                1 of 1 people found this helpful