Create a Deployment Job

Use this API to create a deployment job by providing inputs in the request body.

GET/pm/v1/deploymentjob

Request Body ParametersRequest Body Parameters

Parameter

 Mandatory/Optional

Data Type 

Description

approvedPatches

Optional

string

Specify a list of patches that you want to add to the job

filterType 

Optional

string

Specify the relationship between selected tags.

Available values: Any, All

Default value: Any

exclusionFilterType

 Optional

string

Specify the relationship between excluded tags.

Available values: Any, All

Default value: Any

scheduleType

 Mandatory

string

Specify the schedule to run the job.

Available values: On-demand, Once, Daily, Weekly, and Monthly.

startDateTime

Optional: On-demand job.

Mandatory: Other job types.

string

Specify the time to start the job.

Format example: 2022-2-20 01:18:30 PM

recurring

 Optional

 

Specify if the job is recurring.

Available values: True, False

dayOfMonth

 Optional

string

Specify a day between 1 to 31 to run the job.

recurringLastDayOfMonth

 Optional

 

Specify if you want to job to run on the last day of the month.

Available values: True, False

monthlyRecurringType

 Optional

string

Specify if you want to run the job on the Patch Tuesday schedule

Available values: 0 (not - Patch Tuesday), and 1 (Patch Tuesday).

Default value: 0

patchTuesdayPlusXDays

 Optional

string

Specify a value between 1 to 27 based on when you want to run the Patch Tuesday schedule job.

recurringDayOfMonth

 Optional

string

Specify a value between 1 to 5 to run the job on a specific day of a week in the month.

For example, the second Monday of the month.

recurringWeekDayOfMonth

 Optional

string

Specify a value between 0-6 to run a job on a specific day of the week.

For example, 0=Sunday, 1=Monday, and so on.

recurringWeekDays

 Optional

string

Replace 0 with 1 in the "0,0,0,0,0,0,0" sequence to run the job on a specific day of the week.

For example, "0,0,1,0,0,0,0" to run the job on Tuesday.

dynamicQQLType

 Optional

string

Specify if the job is QQL type.

Available values: 0 (no QQL), 1 (Patch QQL), 2 (Vulnerability QQL)

Default value: 0

isDynamicPatchesQQL

 Optional

Boolean

Specify if the QQL-job uses Patches tokens.

Available values: True, False

continueOnPatchFailure 

 Optional

Boolean (Linux job only)

Specify if the Linux installation job should run after a patch in the package fails to install.

Available values: True, False

preDeployment

 Optional

 string

Specify a message you want to show before the deployment starts. If you don't want to show a message, keep the value as null.

duringDeployment 

 Optional

 string

Specify a message you want to show before the deployment starts. If you don't want to show a message, keep the value null.

postDeployment

 Optional

 string

Specify a message you want to show after the job is deployed. If you don't want to show a message, keep the value null.

onComplete

 Optional

string

Specify a message you want to show after the job is complete. If you don't want to show a message, keep the value null.

rebootCountdown

 Optional

string

Specify a message you want to show before reboot countdown starts. If you don't want to show a message, keep the value null.

rebootOption

 Optional

string

Specify a message you want to show when the reboot is complete. If you don't want to show a message, keep the value null.

suppressReboots

 Optional

string

Specify if you want to allow users to suppress a reboot after the job.

Available values: True, False

Default value: False

platform

 Optional

string

Specify the platform type.

- Available values: Linux, Windows

- Default value: Windows

minimizeWindow

 Optional

Boolean (Windows job only)

Specify if you want to allow users to minimize the job window.

Available values: True, False

Default value: False

type

 Mandatory

string

Specify the job type.

Available values: Install (Windows and Linux), Rollback (Windows only)

Default value: Install

status

 Optional

string

Specify the job status.

Available values: Disabled, Enabled

Default value: Disabled

timeout/timeoutUnit

 Optional

string

Specify if the job should time out in hours (1 to 9) or minutes (1 to 1440)

timezoneType

 Optional

string

Specify if you want to run the job in the agent time zone of a specific time zone.

Available values: AGENT_TZ, SPECIFIC_TZ

timezone

 Optional

string

Specify the time zone in which you want to run the job. To refer to the available time zones, see List of Time Zones.

opportunisticDownloads

 Optional

Boolean (Windows job only)

Specify if you want the agent to attempt to download the patches before the job starts.

Available values: True, False

Default value: False

action 

 Optional

string (Windows job only)

Specify if you want to execute an action before or after a job runs. 

Available values: Run Script, Install Software

script/detectionScript

 Optional

string (Windows job only)

Specify the Base 64 encoded script that you want to run as an action

scriptType

 Optional

string (Windows job only)

Specify the Powershell script that you want to run as a part of the job.

detectionScriptType

 Optional

string (Windows job only)

Specify the Powershell script that you want to run as a part of the job

linkedJobId

Optional

string

Specify a job ID you want to link. If you do not want to link a job, keep the value "null".

notification

 -

Optional

-

Notify the user at the start and end of the job.

notificationTypes

Boolean

Enter "true" for email.

notificationConfigs

  • recipientEmails

  • completedPercentage

 

  • string

  • integer

Enter the email IDs of recipients and the completion percentage between 1 to 100.

If you do not want to notify,  keep the value null.

notificationEvents

Boolean

Enter "true" for at least one of the following parameters: "onJobStart" or "onJobComplete".

Available values: true, false

Sample - Create a Windows on-demand deployment job with preactions and post actionsSample - Create a Windows on-demand deployment job with preactions and post actions

API request

    
        curl -X POST 
"https://<QualysBaseURL>/pm/v1/deploymentjob" -H "accept: application/json" -H "Authorization: Bearer <<jwt token>>"
    

Request Body - Specify the inputs to create a deployment job

    {
    "name": "Public API on demand Window job with specific patches",
    "description": "Created via public API 3",
    "approvedPatches": [
        "ca0d50b1-df21-31ef-aa9b-eec805b3a517",
        "9285e676-6340-3ba7-b124-31d84542c7bf"
    ],
    "assetIds": [
        "ac66e55a-efc6-4a8d-9f61-00d871572b96"
    ],
    "assetTagIds": [
        "f81f37b3-a32b-4aa0-a428-12cad6e37db1"
    ],
    "filterType": "Any",
    "exclusionAssetIds": [
        "94c0bc01-3b1b-4b4b-84a0-b9fe3c9aebb0"
    ],
    "exclusionFilterType": "Any",
    "exclusionTagIds": [
        "1de6c626-de40-4dee-81f8-ae022cd9726a"
    ],
    "coAuthorUserIds": [
        "568be9b8-cbbb-47bf-8132-e4f3c2c46e6c"
    ],
    "preDeployment": null,
    "duringDeployment": {
        "description": "During deployment Description",
        "userMessage": "During deployment userMessage"
    },
    "postDeployment": {
        "onComplete": {
            "description": "On complete Description",
            "userMessage": "On complete userMessage"
        },
        "rebootCountdown": {
            "interval": 15,
            "intervalUnit": "MINUTES",
            "userMessage": "Reboot Countdown usermessage",
            "description": "Reboot Countdown description"
        },
        "rebootOption": {
            "deferment": {
                "count": 3,
                "interval": 1,
                "intervalUnit": "HOURS"
            },
            "description": "rebootOption description",
            "userMessage": "rebootOption user message"
        },
        "suppressReboots": false
    },
    "platform": "Windows",
    "minimizeWindow": "true",
    "type": "Install",
    "status": "Disabled",
    "timeout": 6,
    "timeoutUnit": "HOURS",
    "recurring": false,
    "scheduleType": "On-demand",
    "opportunisticDownloads": false,
    "notification": {
        "notificationTypes": {
            "email": true
        },
        "notificationConfigs": {
            "recipientEmails": "abc@gmail.com",
            "completedPercentage": 80
        },
        "notificationEvents": {
            "onJobStart": true,
            "onJobComplete": false
        }
    },
    "preDeployActions": [
        {
            "action": "Run Script",
            "params": {
                "actionItem": "S1"
            },
            "script": "bHM=",
            "scriptType": "ps"
        }
    ],
    "postDeployActions": [
        {
            "action": "Install Software",
            "params": {
                "actionItem": "Install1",
                "downloadURL": "https://abc.com",
                "fileChecksum": "1234556"
            },
            "detectionScript": "bHM=",
            "detectionScriptType": "ps",
            "script": "bHM=",
            "scriptType": "ps"
        }
    ]
}

Response

    {
    "customerId": "bc023fd7-4290-f28f-8181-95a46f519f52",
    "id": "cb190c4a-a31a-44f0-b2ce-34f30a09a8d7",
    "schemaVersion": "1.0",
    "name": "Public API on demand Window job with specific patches",
    "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": [
        "ca0d50b1-df21-31ef-aa9b-eec805b3a517",
        "9285e676-6340-3ba7-b124-31d84542c7bf"
    ],
    "disabledPatches": null,
    "patchCount": 2,
    "scheduleType": "On-demand",
    "startDateTime": "2022-10-19 08:47:34 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": "quays_rw17"
        },
        "date": 1666169253730
    },
    "updatedBy": {
        "user": null,
        "date": null
    },
    "deletedBy": {
        "user": null,
        "date": 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": "6fb557f6-b7f0-4521-9b1a-19416bbcc7d5",
            "actionType": "predeploy",
            "params": {
                "actionItem": "S1",
                "timeout": 180
            },
            "script": "bc023fd7-4290-f28f-8181-95a46f519f52/6fb557f6-b7f0-4521-9b1a-19416bbcc7d5/Script",
            "scriptType": "ps"
        }
    ],
    "postDeployActions": [
        {
            "action": "Install Software",
            "actionId": "f1413f1d-e267-4682-9c7f-c4c8d67ed850",
            "actionType": "postdeploy",
            "params": {
                "actionItem": "Install1",
                "downloadURL": "https://abc.com",
                "fileChecksum": "1234556",
                "timeout": 180
            },
            "detectionScript": "bc023fd7-4290-f28f-8181-95a46f519f52/f1413f1d-e267-4682-9c7f-c4c8d67ed850/DetectionScript",
            "detectionScriptType": "ps",
            "script": "bc023fd7-4290-f28f-8181-95a46f519f52/f1413f1d-e267-4682-9c7f-c4c8d67ed850/Script",
            "scriptType": "ps"
        }
    ],
    "applicableAssetCount": 0,
    "monthlyRecurringType": null,
    "patchTuesdayPlusXDays": 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
}

Sample - Create Windows QQL-based installation job for Patch Tuesday without actionsSample - Create Windows QQL-based installation job for Patch Tuesday without actions

API request

    
        curl -X POST 
        "https://<QualysBaseURL>/pm/v1/deploymentjob" -H "accept: application/json" -H "Authorization: Bearer <<jwt token>>"
    

Request Body - Specify the inputs to create a deployment job

    
        -d '{
    "name": "Winodws Public API job 3",
    "description": "Winodws job created via public API",
    "approvedPatches": [],
    "assetIds": [
        "bdf79678-e0f3-4c96-9d5c-59b14661ec3f"
    ],
    "assetTagIds": [
        "976d805d-855f-4aa7-8713-b44463f7d081"
    ],
    "matchAllTagIds": [],
    "filterType": "Any",
    "exclusionAssetIds": [
        "e52de00f-8631-4dd5-9ff7-622f3e8d698d"
    ],
    "exclusionFilterType": "Any",
    "exclusionTagIds": [
        "22dcb264-9c2a-4d78-bc55-376396b68a08"
    ],
    "coAuthorUserIds": [
        "568be9b8-cbbb-47bf-8132-e4f3c2c46e6c"
    ],
    "scheduleType": "Monthly",
    "startDateTime": "2022-2-20 01:18:30 PM",
    "recurring": true,
    "dayOfMonth": null,
    "recurringLastDayOfMonth": false,
    "monthlyRecurringType": 1,
    "patchTuesdayPlusXDays": 6,
    "recurringDayOfMonth": null,
    "recurringWeekDayOfMonth": null,
    "recurringWeekDays": "",
    "dynamicPatchesQQL": "isSecurity: true",
    "dynamicQQLType": "1",
    "isDynamicPatchesQQL": true,
    "continueOnPatchFailure": false,
    "preDeployment": {
        "deferment": {
            "count": 3,
            "interval": 1,
            "intervalUnit": "HOURS"
        },
        "description": "preDeployment description",
        "userMessage": "preDeployment user message"
    },
    "duringDeployment": {
        "description": "During deployment Description",
        "userMessage": "During deployment userMessage"
    },
    "postDeployment": {
        "onComplete": {
            "description": "On complete Description",
            "userMessage": "On complete userMessage"
        },
        "rebootCountdown": {
            "interval": 15,
            "intervalUnit": "MINUTES",
            "userMessage": "Reboot Countdown usermessage",
            "description": "Reboot Countdown description"
        },
        "rebootOption": {
            "deferment": {
                "count": 3,
                "interval": 1,
                "intervalUnit": "HOURS"
            },
            "description": "rebootOption description",
            "userMessage": "rebootOption user message"
        },
        "suppressReboots": false
    },
    "platform": "Windows",
    "minimizeWindow": "true",
    "type": "Install",
    "status": "Disabled",
    "timeout": 6,
    "timeoutUnit": "HOURS",
    "timezone": null,
    "timezoneType": "AGENT_TZ",
    "opportunisticDownloads": true
}'
    

Response

    
        {
    "customerId": "6f66747e-2800-7fc7-82d4-1ee7cd30c9fc",
    "id": "7dc64a73-f347-4ed4-b50c-9c645b334907",
    "schemaVersion": "1.0",
    "name": "Winodws Public API job 3",
    "type": "Install",
    "status": "Disabled",
    "assetIds": [
        "bdf79678-e0f3-4c96-9d5c-59b14661ec3f"
    ],
    "assetTagIds": [
        "976d805d-855f-4aa7-8713-b44463f7d081"
    ],
    "matchAllTagIds": [],
    "exclusionTagIds": [
        "22dcb264-9c2a-4d78-bc55-376396b68a08"
    ],
    "exclusionAssetIds": [
        "e52de00f-8631-4dd5-9ff7-622f3e8d698d"
    ],
    "coAuthorUserIds": [
        "568be9b8-cbbb-47bf-8132-e4f3c2c46e6c"
    ],
    "approvedPatches": [],
    "disabledPatches": null,
    "patchCount": 0,
    "scheduleType": "Monthly",
    "startDateTime": "2022-2-20 01:18:30 PM",
    "recurring": true,
    "recurringWeekDays": "",
    "dayOfMonth": null,
    "recurringDayOfMonth": null,
    "recurringWeekDayOfMonth": null,
    "timezoneType": "AGENT_TZ",
    "timezone": null,
    "timeout": 6,
    "timeoutUnit": "HOURS",
    "preDeployment": {
        "userMessage": "preDeployment user message",
        "description": "preDeployment 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": "Winodws job created via public API",
    "createdBy": {
        "user": {
            "id": "ea9067e4-1c28-e208-80b4-312b7a0449cf",
            "name": "gtham_bw"
        },
        "date": 1645970995557
    },
    "updatedBy": {
        "user": null,
        "date": null
    },
    "deletedBy": {
        "user": null,
        "date": null
    },
    "assetCount": null,
    "opportunisticDownloads": true,
    "filterType": "Any",
    "exclusionFilterType": "Any",
    "taggedAssetCount": 0,
    "minimizeWindow": true,
    "dynamicPatchesQQL": "isSecurity: true",
    "isDynamicPatchesQQL": true,
    "dynamicQQLType": 1,
    "platform": "Windows",
    "continueOnPatchFailure": false,
    "preDeployActions": null,
    "postDeployActions": null,
    "applicableAssetCount": 0,
    "monthlyRecurringType": 1,
    "patchTuesdayPlusXDays": 6,
    "recurringLastDayOfMonth": false,
    "jobCategory": 1,
    "jobTriggerStatus": null,
    "completionPercent": null,
    "totalAssetCount": null,
    "assetResultReceivedCount": null,
    "jobSource": 3,
    "readOnly": false
}
    

Sample - Create a Windows rollback jobSample - Create a Windows rollback job

API request

    
        curl -X POST 
        "https://<QualysBaseURL>/pm/v1/deploymentjob" -H "accept: application/json" -H "Authorization: Bearer <<jwt token>>"
    

Request Body - Specify the inputs to create a uninstall job

    
        -d '{
    "name": "Winodws Public API job 5",
    "description": "Winodws job created via public API",
    "approvedPatches": [
        "ca0d50b1-df21-31ef-aa9b-eec805b3a517",
        "9285e676-6340-3ba7-b124-31d84542c7bf"
    ],
    "assetIds": [
        "bdf79678-e0f3-4c96-9d5c-59b14661ec3f"
    ],
    "assetTagIds": [
        "976d805d-855f-4aa7-8713-b44463f7d081"
    ],
    "matchAllTagIds": [],
    "filterType": "Any",
    "exclusionAssetIds": [
        "e52de00f-8631-4dd5-9ff7-622f3e8d698d"
    ],
    "exclusionFilterType": "Any",
    "exclusionTagIds": [
        "22dcb264-9c2a-4d78-bc55-376396b68a08"
    ],
    "coAuthorUserIds": [
        "568be9b8-cbbb-47bf-8132-e4f3c2c46e6c"
    ],
    "dayOfMonth": null,
    "recurringLastDayOfMonth": false,
    "monthlyRecurringType": 0,
    "patchTuesdayPlusXDays": null,
    "recurringDayOfMonth": null,
    "recurringWeekDayOfMonth": null,
    "recurringWeekDays": "",
    "dynamicPatchesQQL": null,
    "dynamicQQLType": "1",
    "isDynamicPatchesQQL": false,
    "continueOnPatchFailure": false,
    "preDeployment": {
        "deferment": {
            "count": 3,
            "interval": 1,
            "intervalUnit": "HOURS"
        },
        "description": "preDeployment description",
        "userMessage": "preDeployment user message"
    },
    "duringDeployment": {
        "description": "During deployment Description",
        "userMessage": "During deployment userMessage"
    },
    "postDeployment": {
        "onComplete": {
            "description": "On complete Description",
            "userMessage": "On complete userMessage"
        },
        "rebootCountdown": {
            "interval": 15,
            "intervalUnit": "MINUTES",
            "userMessage": "Reboot Countdown usermessage",
            "description": "Reboot Countdown description"
        },
        "rebootOption": {
            "deferment": {
                "count": 3,
                "interval": 1,
                "intervalUnit": "HOURS"
            },
            "description": "rebootOption description",
            "userMessage": "rebootOption user message"
        },
        "suppressReboots": false
    },
    "platform": "Windows",
    "minimizeWindow": "true",
    "type": "Rollback",
    "status": "Disabled",
    "timeout": 6,
    "timeoutUnit": "HOURS",
    "recurring": false,
    "scheduleType": "On-demand",
    "timezone": null,
    "timezoneType": null,
    "startDateTime": null,
    "opportunisticDownloads": false
}'
    

Response

    
        {
    "customerId": "6f66747e-2800-7fc7-82d4-1ee7cd30c9fc",
    "id": "ec3fb8b4-2df5-467e-8ab4-0cd84aec3382",
    "schemaVersion": "1.0",
    "name": "Winodws Public API job 5",
    "type": "Rollback",
    "status": "Disabled",
    "assetIds": [
        "bdf79678-e0f3-4c96-9d5c-59b14661ec3f"
    ],
    "assetTagIds": [
        "976d805d-855f-4aa7-8713-b44463f7d081"
    ],
    "matchAllTagIds": [],
    "exclusionTagIds": [
        "22dcb264-9c2a-4d78-bc55-376396b68a08"
    ],
    "exclusionAssetIds": [
        "e52de00f-8631-4dd5-9ff7-622f3e8d698d"
    ],
    "coAuthorUserIds": [
        "568be9b8-cbbb-47bf-8132-e4f3c2c46e6c"
    ],
    "approvedPatches": [],
    "disabledPatches": null,
    "patchCount": 0,
    "scheduleType": "On-demand",
    "startDateTime": "2022-2-27 03:04:46 PM",
    "recurring": false,
    "recurringWeekDays": "",
    "dayOfMonth": null,
    "recurringDayOfMonth": null,
    "recurringWeekDayOfMonth": null,
    "timezoneType": "SPECIFIC_TZ",
    "timezone": "UTC",
    "timeout": 6,
    "timeoutUnit": "HOURS",
    "preDeployment": {
        "userMessage": "preDeployment user message",
        "description": "preDeployment 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": "Winodws job created via public API",
    "createdBy": {
        "user": {
            "id": "ea9067e4-1c28-e208-80b4-312b7a0449cf",
            "name": "gtham_bw"
        },
        "date": 1645974285950
    },
    "updatedBy": {
        "user": null,
        "date": null
    },
    "deletedBy": {
        "user": null,
        "date": null
    },
    "assetCount": null,
    "opportunisticDownloads": false,
    "filterType": "Any",
    "exclusionFilterType": "Any",
    "taggedAssetCount": 0,
    "minimizeWindow": true,
    "dynamicPatchesQQL": null,
    "isDynamicPatchesQQL": false,
    "dynamicQQLType": 1,
    "platform": "Windows",
    "continueOnPatchFailure": false,
    "preDeployActions": null,
    "postDeployActions": null,
    "applicableAssetCount": 0,
    "monthlyRecurringType": null,
    "patchTuesdayPlusXDays": null,
    "recurringLastDayOfMonth": false,
    "jobCategory": 3,
    "jobTriggerStatus": null,
    "completionPercent": null,
    "totalAssetCount": null,
    "assetResultReceivedCount": null,
    "jobSource": 3,
    "readOnly": false
}
    

Sample - Create a Linux installation jobSample - Create a Linux installation job

API request

    
        curl -X POST 
        "https://<QualysBaseURL</pm/v1/deploymentjob" -H "accept: application/json" -H "Authorization: Bearer <<jwt token>>"
    

Request Body - Specify the inputs to create a deployment job>

    {
    "name": "Public API on demand Linux job with patches 1",
    "description": "Created via public API",
    "approvedPatches": [],
    "assetIds": [
        "0f0266bf-4884-4bf5-9727-c50c9d8fbf78"
    ],
    "assetTagIds": [
        "f81f37b3-a32b-4aa0-a428-12cad6e37db1"
    ],
    "filterType": "Any",
    "exclusionAssetIds": [
        "5f8fd088-0051-0002-1663-005056aa10f0"
    ],
    "exclusionFilterType": "Any",
    "exclusionTagIds": [
        "1de6c626-de40-4dee-81f8-ae022cd9726a"
    ],
    "coAuthorUserIds": [
        "568be9b8-cbbb-47bf-8132-e4f3c2c46e6c"
    ],
    "preDeployment": null,
    "duringDeployment": null,
    "postDeployment": {
        "onComplete": null,
        "rebootCountdown": {
            "interval": 15,
            "intervalUnit": "MINUTES",
            "userMessage": "Reboot Countdown usermessage",
            "description": "Reboot Countdown description"
        },
        "rebootOption": null,
        "suppressReboots": false
    },
    "platform": "Linux",
    "type": "Install",
    "status": "Disabled",
    "timeout": 6,
    "timeoutUnit": "HOURS",
    "recurring": false,
    "scheduleType": "On-demand",
    "opportunisticDownloads": false,
    "notification": {
        "notificationTypes": {
            "email": true
        },
        "notificationConfigs": {
            "recipientEmails": "abc@gmail.com",
            "completedPercentage": "80"
        },
        "notificationEvents": {
            "onJobStart": true,
            "onJobComplete": false
        }
    },
    "linkedJobId": "99ac4e4e-8325-477b-bf98-953fe44820bf",
    "preDeployActions": [
        {
            "action": "Run Script",
            "actionType": "predeploy",
            "params": {
                "actionItem": "S1",
                "timeout": 180
            },
            "script": "bHM=",
            "scriptType": "ps"
        }
    ],
    "postDeployActions": [
        {
            "action": "Run Script",
            "actionType": "postdeploy",
            "params": {
                "actionItem": "S1",
                "timeout": 180
            },
            "script": "bHM=",
            "scriptType": "ps"
        }
    ]
}

Response

    {
    "customerId": "bc023fd7-4290-f28f-8181-95a46f519f52",
    "id": "a8b728ad-66a2-4d1e-80a7-ce5c470ac0df",
    "schemaVersion": "1.0",
    "name": "Public API on demand Linux job with patches 1",
    "type": "Install",
    "status": "Disabled",
    "assetIds": [
        "0f0266bf-4884-4bf5-9727-c50c9d8fbf78"
    ],
    "assetTagIds": [
        "f81f37b3-a32b-4aa0-a428-12cad6e37db1"
    ],
    "matchAllTagIds": null,
    "exclusionTagIds": [
        "1de6c626-de40-4dee-81f8-ae022cd9726a"
    ],
    "exclusionAssetIds": [
        "5f8fd088-0051-0002-1663-005056aa10f0"
    ],
    "coAuthorUserIds": [
        "568be9b8-cbbb-47bf-8132-e4f3c2c46e6c"
    ],
    "approvedPatches": [],
    "disabledPatches": null,
    "patchCount": 0,
    "scheduleType": "On-demand",
    "startDateTime": "2022-10-19 09:33:29 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": "",
        "description": ""
    },
    "postDeployment": {
        "suppressReboots": false,
        "rebootOption": {
            "userMessage": "",
            "description": "",
            "deferment": {
                "count": 3,
                "interval": 1,
                "intervalUnit": "HOURS"
            }
        },
        "rebootCountdown": {
            "interval": 15,
            "intervalUnit": "MINUTES",
            "userMessage": "Reboot Countdown usermessage",
            "description": "Reboot Countdown description"
        },
        "onComplete": {
            "userMessage": "",
            "description": ""
        }
    },
    "description": "Created via public API",
    "createdBy": {
        "user": {
            "id": "c4c71f94-4ef6-7e6f-8260-11704fa58172",
            "name": "quays_rw17"
        },
        "date": 1666172001492
    },
    "updatedBy": {
        "user": null,
        "date": null
    },
    "deletedBy": {
        "user": null,
        "date": null
    },
    "assetCount": null,
    "opportunisticDownloads": false,
    "filterType": "Any",
    "exclusionFilterType": "Any",
    "taggedAssetCount": 0,
    "minimizeWindow": null,
    "dynamicPatchesQQL": null,
    "isDynamicPatchesQQL": null,
    "dynamicQQLType": null,
    "platform": "Linux",
    "continueOnPatchFailure": false,
    "preDeployActions": [
        {
            "action": "Run Script",
            "actionId": "2cf190a9-086d-47f9-898f-aed4b98dea5a",
            "actionType": "predeploy",
            "params": {
                "actionItem": "S1",
                "timeout": 180
            },
            "script": "bc023fd7-4290-f28f-8181-95a46f519f52/2cf190a9-086d-47f9-898f-aed4b98dea5a/Script",
            "scriptType": "ps"
        }
    ],
    "postDeployActions": [
        {
            "action": "Run Script",
            "actionId": "b52fc1b1-f598-4e6b-90d8-23bfa94b41fe",
            "actionType": "postdeploy",
            "params": {
                "actionItem": "S1",
                "timeout": 180
            },
            "script": "bc023fd7-4290-f28f-8181-95a46f519f52/b52fc1b1-f598-4e6b-90d8-23bfa94b41fe/Script",
            "scriptType": "ps"
        }
    ],
    "applicableAssetCount": 0,
    "monthlyRecurringType": null,
    "patchTuesdayPlusXDays": 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": "99ac4e4e-8325-477b-bf98-953fe44820bf",
    "linkedToJob": [
        {
            "customerId": "bc023fd7-4290-f28f-8181-95a46f519f52",
            "id": "99ac4e4e-8325-477b-bf98-953fe44820bf",
            "name": "Linux testing job",
            "type": "Install",
            "status": "Disabled",
            "createdBy": {
                "user": {
                    "id": "c4c71f94-4ef6-7e6f-8260-11704fa58172",
                    "name": "quays_rw17"
                },
                "date": 1665656673543
            },
            "linkedJobReferenceCount": 2,
            "schedule": "On-Demand",
            "previousRun": null,
            "nextRun": null
        }
    ],
    "linkedJobs": null
}