Update Deployment Jobs

Use this API to update an existing deployment job.

PATCH /pm/v1/deploymentjob/update/{deploymentJobId}

Input ParametersInput Parameters

Parameter

Mandatory/Optional

Data Type

Description

deploymentJobId

Mandatory

string

Enter the job ID of a deployment job that you want to update.

Request body

Mandatory

-

Enter the request body of the deployment job that you want to update. Use the request body parameters as available in the "Create Deployment Jobs" API. For more information, see Create Deployment Job.

Recommendation: Get the request body from the "Get Deployment by Job ID" API. For more information, see Get Deployment by Job ID.

customPatchURLId

Optional

Integer

Specify the customPatchURLId value. This is nothing but the "id" value received from the Fetch Custom Patch Download URLs API.

Sample - Update an existing deployment jobSample - Update an existing deployment job

API request

      curl -X PATCH 
"https://<QualysBaseURL>/pm/v1/deploymentjob/update/c08769ba-aa65-4b77-b224-f2c789ce7970" -H "accept: application/json" -H "Authorization: <<Jwt Token>>" -H "Content-Type: application/json"

Request body


 {
    "customerId": "bc023fd7-4290-f28f-8181-95a46f519f52",
    "id": "c08769ba-aa65-4b77-b224-f2c789ce7970",
    "schemaVersion": "1.0",
    "name": "Public API on demand Window job with specific patches updated",
    "type": "Install",
    "status": "Disabled",
    "assetIds": [
        "ac66e55a-efc6-4a8d-9f61-00d871572b96"
    ],
    "assetTagIds": [
        "f81f37b3-a32b-4aa0-a428-12cad6e37db1"
    ],
    "matchAllTagIds": null,
    "exclusionTagIds": [
        "1de6c626-de40-4dee-81f8-ae022cd9726a"
    ],
    "exclusionAssetIds": [
        "94c0bc01-3b1b-4b4b-84a0-b9fe3c9aebb0"
    ],
    "coAuthorUserIds": [
        "568be9b8-cbbb-47bf-8132-e4f3c2c46e6c"
    ],
    "approvedPatches": [
        "9285e676-6340-3ba7-b124-31d84542c7bf",
        "ca0d50b1-df21-31ef-aa9b-eec805b3a517"
    ],
    "disabledPatches": null,
    "patchCount": null,
    "scheduleType": "On-demand",
    "startDateTime": "2022-11-01 04:51:31 AM",
    "recurring": false,
    "recurringWeekDays": null,
    "dayOfMonth": null,
    "recurringDayOfMonth": null,
    "recurringWeekDayOfMonth": null,
    "timezoneType": "SPECIFIC_TZ",
    "timezone": "UTC",
    "timeout": 6,
    "timeoutUnit": "HOURS",
    "preDeployment": {
        "userMessage": "",
        "description": "",
        "deferment": {
            "count": 3,
            "interval": 1,
            "intervalUnit": "HOURS"
        }
    },
    "duringDeployment": {
        "userMessage": "During deployment userMessage",
        "description": "During deployment Description"
    },
    "postDeployment": {
        "suppressReboots": false,
        "rebootOption": {
            "userMessage": "rebootOption user message",
            "description": "rebootOption description",
            "deferment": {
                "count": 3,
                "interval": 1,
                "intervalUnit": "HOURS"
            }
        },
        "rebootCountdown": {
            "interval": 15,
            "intervalUnit": "MINUTES",
            "userMessage": "Reboot Countdown usermessage",
            "description": "Reboot Countdown description"
        },
        "onComplete": {
            "userMessage": "On complete userMessage",
            "description": "On complete Description"
        }
    },
    "description": "Created via public API 3",
    "createdBy": {
        "user": {
            "id": "c4c71f94-4ef6-7e6f-8260-11704fa58172",
            "name": "qxxxs_rxx7"
        },
        "date": 1667278291205
    },
    "updatedBy": {
        "user": {
            "id": "c4c71f94-4ef6-7e6f-8260-11704fa58172",
            "name": "qxxxs_rxx7"
        },
        "date": 1667278337740
    },
    "deletedBy": null,
    "assetCount": null,
    "opportunisticDownloads": false,
    "filterType": "Any",
    "exclusionFilterType": "Any",
    "taggedAssetCount": 0,
    "minimizeWindow": true,
    "dynamicPatchesQQL": null,
    "isDynamicPatchesQQL": null,
    "dynamicQQLType": null,
    "platform": "Windows",
    "continueOnPatchFailure": false,
    "preDeployActions": [
        {
            "action": "Run Script",
            "actionId": "24fcade7-85c1-41c1-8168-0c34509f722e",
            "actionType": "predeploy",
            "params": {
                "actionItem": "S1",
                "timeout": 180
            },
            "script": "bc023fd7-4290-f28f-8181-95a46f519f52/24fcade7-85c1-41c1-8168-0c34509f722e/Script",
            "scriptType": "ps"
        }
    ],
    "postDeployActions": [
        {
            "action": "Install Software",
            "actionId": "fbef9851-2703-4ae7-b179-910f203796ac",
            "actionType": "postdeploy",
            "params": {
                "actionItem": "Install1",
                "downloadProtocol": 0,
                "downloadURL": "https://abc.com",
                "fileChecksum": "1234556",
                "installMethod": 0,
                "timeout": 180
            },
            "detectionScript": "bc023fd7-4290-f28f-8181-95a46f519f52/fbef9851-2703-4ae7-b179-910f203796ac/DetectionScript",
            "detectionScriptType": "ps",
            "script": "bc023fd7-4290-f28f-8181-95a46f519f52/fbef9851-2703-4ae7-b179-910f203796ac/Script",
            "scriptType": "ps"
        }
    ],
    "applicableAssetCount": 0,
    "monthlyRecurringType": null,
    
    "recurringLastDayOfMonth": null,
    "jobCategory": 3,
    "jobTriggerStatus": null,
    "completionPercent": null,
    "totalAssetCount": null,
    "assetResultReceivedCount": null,
    "jobSource": 3,
    "readOnly": false,
    "notification": {
        "notificationTypes": {
            "email": true
        },
        "notificationConfigs": {
            "recipientEmails": "abc@gmail.com",
            "completedPercentage": "80"
        },
        "notificationEvents": {
            "onJobStart": true,
            "onJobComplete": false
        }
    },
    "linkedJobId": null,
    "linkedToJob": null,
    "linkedJobs": null,
    "additionalDynamicPatchesQQL": null,
    "additionalDynamicQQLType": null,
    "downloadRandomizeTime": 1,
    "downloadRandomizeTimeUnit": "HOURS",
    "patchTuesdayPlusXDays": "-12",
    "customPatchURLId": "1008",
    
} 

Response

    
 {
    "customerId": "bc023fd7-4290-f28f-8181-95a46f519f52",
    "id": "c08769ba-aa65-4b77-b224-f2c789ce7970",
    "schemaVersion": "1.0",
    "name": "Public API on demand Window job with specific patches updated",
    "type": "Install",
    "status": "Disabled",
    "assetIds": [
        "ac66e55a-efc6-4a8d-9f61-00d871572b96"
    ],
    "assetTagIds": [
        "f81f37b3-a32b-4aa0-a428-12cad6e37db1"
    ],
    "matchAllTagIds": null,
    "exclusionTagIds": [
        "1de6c626-de40-4dee-81f8-ae022cd9726a"
    ],
    "exclusionAssetIds": [
        "94c0bc01-3b1b-4b4b-84a0-b9fe3c9aebb0"
    ],
    "coAuthorUserIds": [
        "568be9b8-cbbb-47bf-8132-e4f3c2c46e6c"
    ],
    "approvedPatches": [
        "9285e676-6340-3ba7-b124-31d84542c7bf",
        "ca0d50b1-df21-31ef-aa9b-eec805b3a517"
    ],
    "disabledPatches": null,
    "patchCount": null,
    "scheduleType": "On-demand",
    "startDateTime": "2022-11-01 04:51:31 AM",
    "recurring": false,
    "recurringWeekDays": null,
    "dayOfMonth": null,
    "recurringDayOfMonth": null,
    "recurringWeekDayOfMonth": null,
    "timezoneType": "SPECIFIC_TZ",
    "timezone": "UTC",
    "timeout": 6,
    "timeoutUnit": "HOURS",
    "preDeployment": {
        "userMessage": "",
        "description": "",
        "deferment": {
            "count": 3,
            "interval": 1,
            "intervalUnit": "HOURS"
        }
    },
    "duringDeployment": {
        "userMessage": "During deployment userMessage",
        "description": "During deployment Description"
    },
    "postDeployment": {
        "suppressReboots": false,
        "rebootOption": {
            "userMessage": "rebootOption user message",
            "description": "rebootOption description",
            "deferment": {
                "count": 3,
                "interval": 1,
                "intervalUnit": "HOURS"
            }
        },
        "rebootCountdown": {
            "interval": 15,
            "intervalUnit": "MINUTES",
            "userMessage": "Reboot Countdown usermessage",
            "description": "Reboot Countdown description"
        },
        "onComplete": {
            "userMessage": "On complete userMessage",
            "description": "On complete Description"
        }
    },
    "description": "Created via public API 3",
    "createdBy": {
        "user": {
            "id": "c4c71f94-4ef6-7e6f-8260-11704fa58172",
            "name": "qxxxs_rxx7"
        },
        "date": 1667278291205
    },
    "updatedBy": {
        "user": {
            "id": "c4c71f94-4ef6-7e6f-8260-11704fa58172",
            "name": "qxxxs_rxx7"
        },
        "date": 1667278337740
    },
    "deletedBy": null,
    "assetCount": null,
    "opportunisticDownloads": false,
    "filterType": "Any",
    "exclusionFilterType": "Any",
    "taggedAssetCount": 0,
    "minimizeWindow": true,
    "dynamicPatchesQQL": null,
    "isDynamicPatchesQQL": null,
    "dynamicQQLType": null,
    "platform": "Windows",
    "continueOnPatchFailure": false,
    "preDeployActions": [
        {
            "action": "Run Script",
            "actionId": "24fcade7-85c1-41c1-8168-0c34509f722e",
            "actionType": "predeploy",
            "params": {
                "actionItem": "S1",
                "timeout": 180
            },
            "script": "bc023fd7-4290-f28f-8181-95a46f519f52/24fcade7-85c1-41c1-8168-0c34509f722e/Script",
            "scriptType": "ps"
        }
    ],
    "postDeployActions": [
        {
            "action": "Install Software",
            "actionId": "fbef9851-2703-4ae7-b179-910f203796ac",
            "actionType": "postdeploy",
            "params": {
                "actionItem": "Install1",
                "downloadProtocol": 0,
                "downloadURL": "https://abc.com",
                "fileChecksum": "1234556",
                "installMethod": 0,
                "timeout": 180
            },
            "detectionScript": "bc023fd7-4290-f28f-8181-95a46f519f52/fbef9851-2703-4ae7-b179-910f203796ac/DetectionScript",
            "detectionScriptType": "ps",
            "script": "bc023fd7-4290-f28f-8181-95a46f519f52/fbef9851-2703-4ae7-b179-910f203796ac/Script",
            "scriptType": "ps"
        }
    ],
    "applicableAssetCount": 0,
    "monthlyRecurringType": null,
    "patchTuesdayPlusXDays": -12,
    "recurringLastDayOfMonth": null,
    "jobCategory": 3,
    "jobTriggerStatus": null,
    "completionPercent": null,
    "totalAssetCount": null,
    "assetResultReceivedCount": null,
    "jobSource": 3,
    "readOnly": false,
    "notification": {
        "notificationTypes": {
            "email": true
        },
        "notificationConfigs": {
            "recipientEmails": "abc@gmail.com",
            "completedPercentage": "80"
        },
        "notificationEvents": {
            "onJobStart": true,
            "onJobComplete": false
        }
    },
    "linkedJobId": null,
    "linkedToJob": null,
    "linkedJobs": null,
    "additionalDynamicPatchesQQL": null,
    "additionalDynamicQQLType": null,
    "downloadRandomizeTime": 1,
    "downloadRandomizeTimeUnit": "HOURS",
    "customPatchURLId": "1008"
}