Build service
The build service allows you to compile definitions of jobs, folders, or calendars and verify that they are valid for your Control-M environment. Control-M validation includes basic Control-M rules such as length of fields, allowed characters, and mandatory fields. Build will also check that the JSON is valid. If Control-M Change Manager is part of your solution, definitions will be evaluated against the relevant site standard. build can receive definition files in .json format or packages of multiple definition files in .zip or .tar.gz format.
CLI Syntax
Where:
Parameter | Description |
---|---|
<definitionsFile> | The file or archive that contains code for jobs, folders, or calendars. Valid formats are:
Note: Calendar definitions are supported in .json format only. |
[deployDescriptorFile] | (Optional) The file that includes the rules to apply on the original definitionsFile. The rules enable transforming Control-M JSON code properties. For detailed information, see Deploy-Descriptor. |
REST API Syntax
See REST API reference.
Example using curl:
The following example shows how to use the build command in a Python function :
# -----------------
# Built
uploaded_files = [
('definitionsFile', ('Jobs.json', open('examples/AutomationAPISampleFlow.json', 'rb'), 'application/json'))
]
r = requests.post(endPoint + '/build', files=uploaded_files, headers={'Authorization': 'Bearer ' + token}, verify=False)
print(r.content)
print(r.status_code)
exit(r.status_code == requests.codes.ok)
Response
The following example demonstrates a typical response to the build command. The response summarizes the numbers of various elements created (such as folders and jobs), indicates whether a Deploy Descriptor is applied, and provides validation messages if site standards are applied (error messages if validations are strictly enforced, or warning messages if validations are not strictly enforced).
Note: If validations are not strictly enforced, site standard warning messages are included, by default, in the build command response. If you do not want such warning messages included in the response, add the buildWarningsEnabled property to the automation-api.properties file, and set it to false.
"deploymentFile": "Folder.json",
"successfulFoldersCount": 0,
"successfulSmartFoldersCount": 1,
"successfulSubFoldersCount": 0,
"successfulJobsCount": 1,
"successfulConnectionProfilesCount": 0,
"successfulDriversCount": 0,
"isDeployDescriptorValid": false,
"warnings": [
{
"message": "Department has to be from values [HR, DEV, FINANCE] ",
"id": "Validation10006",
"file": "Folder.json",
"line": 3,
"col": 25
}
]
}