# Create Deployment Policy Creates a new deployment policy template with deployment window, pre-deployment, and post-deployment configurations. ## Endpoint `POST /dcapi/patch/deploymentPolicy` ## Request ### Request URL `https://{server-hostname}:8383/dcapi/patch/deploymentPolicy` ### Scope `PatchMgmt.CREATE` ### Header `Authorization: d92d4xxxxxxxxxxxxx15f52` ### Request Body `application/json` - JSON Object - **templateID** (`long`, Optional): Unique identifier of the deployment policy template - **templateName** (`string`, Optional): Name of the deployment policy template - **templateDesc** (`string`, Optional): Description of the deployment policy template - **templateInUse** (`boolean`, Optional): Whether this template is currently in use - **associatedModule** (`boolean`, Optional): Whether associated with a specific module - **filesize** (`long`, Optional): File size associated with the template in bytes - **deploymentDetails** (`JSON Object`, Optional): Deployment window configuration - **preDeploymentDetails** (`JSON Array`, Optional): List of pre-deployment activity configurations - **postDeploymentDetails** (`JSON Array`, Optional): List of post-deployment activity configurations ### Sample Request #### Curl ```curl curl --request POST \ --url https://appdomain/dcapi/patch/deploymentPolicy \ --header 'Authorization: d92d4xxxxxxxxxxxxx15f52' \ --header 'content-type: application/json' \ --data '{"preDeploymentDetails":[{"configName":"WOL_CONFIG","performNoDeploymentSuccess":false,"isWOLEnabled":true,"proceedOnFailure":true}],"deploymentDetails":{"enableStaging":false,"weekType":1,"deploymentOption":1,"timeZone":"Asia/Kolkata","deploymentWindowSchedule":[{"weeks":["1","2","3","4"],"months":["0","1","2"],"days":["1","2","3","4","5"],"startTime":"09:00","stopTime":"18:00","dates":["1","15"]}]},"postDeploymentDetails":[{"configName":"POST_REBOOT_SHUTDOWN_CONFIG","rebootNotificationMessage":"System will reboot after patching.","rebootPreference":1,"rebootNotificationTitle":"Reboot Required","rebootMethod":1,"rebootWindowSchedule":[{"days":["6","7"],"startTime":"02:00","stopTime":"05:00"}],"skipRebootIfNotRequired":true,"forceRebootOption":1,"rebootNotificationTimeout":300,"excludeRebootForServers":true}],"templateName":"My Deployment Policy","templateDesc":"Description of the policy","filesize":1024}' ``` ### Sample Request Body Create a deployment policy with deployment window and pre/post activities. ```json { "preDeploymentDetails": [ { "configName": "WOL_CONFIG", "performNoDeploymentSuccess": false, "isWOLEnabled": true, "proceedOnFailure": true } ], "deploymentDetails": { "enableStaging": false, "weekType": 1, "deploymentOption": 1, "timeZone": "Asia/Kolkata", "deploymentWindowSchedule": [ { "weeks": [ "1", "2", "3", "4" ], "months": [ "0", "1", "2" ], "days": [ "1", "2", "3", "4", "5" ], "startTime": "09:00", "stopTime": "18:00", "dates": [ "1", "15" ] } ] }, "postDeploymentDetails": [ { "configName": "POST_REBOOT_SHUTDOWN_CONFIG", "rebootNotificationMessage": "System will reboot after patching.", "rebootPreference": 1, "rebootNotificationTitle": "Reboot Required", "rebootMethod": 1, "rebootWindowSchedule": [ { "days": [ "6", "7" ], "startTime": "02:00", "stopTime": "05:00" } ], "skipRebootIfNotRequired": true, "forceRebootOption": 1, "rebootNotificationTimeout": 300, "excludeRebootForServers": true } ], "templateName": "My Deployment Policy", "templateDesc": "Description of the policy", "filesize": 1024 } ``` ## Response Parameters ### HTTP Code 200 Response body: `application/json` - JSON Object - **templateID** (`long`): Unique identifier of the created deployment policy template - **status** (`string`): Operation result: success ### HTTP Code 413 Response body: `application/json` - JSON Object - **error_code** (`string`): Error code: `CONFIG_DEPLOY_POLICY_INVALID` for storage limit exceeded - **error_description** (`string`): Storage limit exceeded message ### Possible Response Codes - `200` HTTP code - `413` HTTP code ### Sample Response: HTTP 200 Deployment policy created. ```json { "templateID": 12345, "status": "success" } ``` ### Sample Response: HTTP 413 Storage limit exceeded. ```json { "error_description": "Storage limit exceeded", "error_code": "CONFIG_DEPLOY_POLICY_INVALID" } ``` ## Rate Limit ![](https://www.zohowebstatic.com/sites/zweb/images/people/ico-help.png) **Duration:** 1 minute | **Threshold:** 30 | **Lock period:** 5 minutes Duration - Time window for the threshold. Threshold - Number of API calls allowed within the specified duration. Lock Period - Wait time before consecutive API requests.