4 Replies Latest reply on Jun 18, 2019 4:17 AM by Ilyas Shaikh

    Unable to create job using control-m automation api

    Ganesh Venkataramanan
      Share:|

      I am trying to use automation api to create jobs on our control-m environment. I am able to validate the job using "build" command however unable to create the job using "run" command. The error is not helpful.

       

      test@sabre-rhel7[101-create-first-job-flow] $ ctm build AutomationAPISampleFlow.json

      [

        {

          "deploymentFile": "AutomationAPISampleFlow.json",

          "successfulFoldersCount": 0,

          "successfulSmartFoldersCount": 1,

          "successfulSubFoldersCount": 0,

          "successfulJobsCount": 1,

          "successfulConnectionProfilesCount": 0,

          "successfulDriversCount": 0,

          "isDeployDescriptorValid": false

        }

      ]

       

      sabuser@sabre-rhel7[101-create-first-job-flow] $ ctm run AutomationAPISampleFlow.json

      {

        "errors": [

          {

            "message": "[Failed to create new folder SAB_API_SAMPLE]"

          }

        ]

      }

       

      MY JSON file:

       

      {

          "Defaults" : {

              "Application": "XXXX",

              "SiteStandard": "NON_WCM_APP_SITE_STANDARD",

              "SubApplication" : "SAB_API_TEST",

              "ControlmServer" : "XXXX",

              "RunAs" : "XXX",

              "Host" : "XXX"

          },

       

       

          "SAB_API_SAMPLE": {

              "Type": "Folder",

              "CommandJob": {

                  "Type": "Job:Command",

                  "Command": "echo my 1st job"

              }

          }

      }

        • 1. Re: Unable to create job using control-m automation api
          Adriano Gomes

          Hi Ganesh Venkataramanan

          I managed to run your json and the job created and was able to run.

          So, the only problem I see is the user assigned on the environment not be able to create tables.

           

          Take a look on the CCM and make sure the user is member of AdminGroup or have power to create tables.

           

           

          also, I removed the   "SiteStandard": "NON_WCM_APP_SITE_STANDARD", line.

           

          My Best

           

          A>Gomes

          1 of 1 people found this helpful
          • 2. Re: Unable to create job using control-m automation api
            Ganesh Venkataramanan

            Thanks. I will try this and come back to you. Without site standards I get the following error message hence I added the same.

             

            $ ctm build AutomationAPISampleFlow.json

            (node:25636) [DEP0106] DeprecationWarning: crypto.createDecipher is deprecated.

            (node:25636) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.

            {

            "errors": [

            {

            "message": "Could not find site standard named NON_WCM_APPLICATION",

            "file": "AutomationAPISampleFlow.json",

            "line": 33,

            "col": 46

            }

              ]

            }

            • 3. Re: Unable to create job using control-m automation api
              Adriano Gomes

              Hi Ganesh Venkataramanan

               

              I am very sorry it is not working for You.

               

              Would You be able to provide a description of you CTM-EM environment and Version. Is it ^BMC Wiorkbench^ or you own DEV/Prod site?

               

              Also, do you have multiples envs configured to CTM API ? if so, you need first set the desired ENV prior executing the API instructions set. Sometimes it does happens to us, triggering commands toward wrong ENV due to the current active envirionment set to the API.

               

              Please take a look and notice ! ^info:    current environment: CTMEM-PRD^

               

              ctm env show # will show which envirionment is ACTIVE

              ctm env set <your desired env>

               

              If you are saying there is site standards in place, WCM is certainly enabled and may cause some issues mathing the data provided for the object acceptance by CTM/EM Env.

               

              My Best

               

              A>Gomes

              2 of 2 people found this helpful
              • 4. Re: Unable to create job using control-m automation api
                Ilyas Shaikh

                Hello Ganesh,

                 

                Is the folder 'SAB_API_SAMPLE' already exists?

                 

                Regards,

                Ilyas Shaikh