Security Controls REST API

Home 

Patch Deployments

Patch deployments are used to install patches to target machines that were identified as missing from a patch scan. You can start a deployment, locate existing deployments and delete deployments.

Base URL

        https://<consoleFQDN:port>/stconsole/api/v1.0/patch/deployments

Supported Requests

Method URL Input Return

DELETE

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments/{deployment id}

 

Success or failure code

     

GET

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments

 

PatchDeployments[]

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments

URL Parameters

PatchDeployments[]

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments/{deployment id}

 

The patch deployment.

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments/{deployment id}/machines

 

The MachineDeployState

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments/{deployment id}/machines/{machine id}

 

The MachineDeployState

     

POST

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments

Request Body

Operation location

Input Models

URL Parameters

Name Type Description

count

Integer

Provide the count of items to return. The maximum value is 50.

createdByMe

Boolean

Returns only those items created by the user.

name

String

Returns the items whose name matches the specified name.

onOrAfter

DateTime

Returns the deployments started on or after the specified date.

onOrBefore

Integer

Returns the deployments started on or before the specified date.

start

Integer

Sets the starting point.

Request Body

Name Required? Type Default Value Description

runAsCredentialId

No

Guid

None

Provides a credential ID to a credential to use to start a deployment. Overwrites "RunAsDefault" behavior.

runAsDefault

No

Boolean

False

Provides an indication whether to run deployment as the user who invokes the API (integrated authentication)

scanId

Yes

Guid

None

Specifies a scan ID used to identify missing patches and target machines.

templateId

Yes

Guid

None

Specifies the ID of the deployment template used for this deployment.

Example

Find all patch deployments using a deployment template named Sample

GET Request

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments?name=Sample

Sample Response

{

"count": 1,

"value": [

{

"completedMachineCount": 1,

"creator": "SHAVLIK\\Test.User",

"expectedMachineCount": 1

"isComplete": true

"lastUpdatedOn": "2018-02-12T14:42:27.923Z"

"links": "{"

"self": "{"

"href": "https://YourConsoleName:3121/st/console/api/v1.0/patch/deployments/d7a59ec7-2bdd-4492-9e41-c23ac84c64d6"

}

}

"name": "Sample"

"startedOn": "2018-02-12T14:36:41.707Z"

"id": "d7a59ec7-2bdd-4492-9e41-c23ac84c64d6"

}

]

}

Other Request Examples

Start a patch deployment

POST Request

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments

{ "scanId":"8bce9fdd-0cf8-40b0-8ecc-b0914a9c831a", "templateId":"7b5bc7e4-7437-47ac-ae2e-569ffdb0ccf8"}

If using PowerShell to initiate the request, use Invoke-WebRequest rather than Invoke-RestMethod. This will cause the header information to be returned. For an example, see Start-to-Finish Example.

Delete a patch deployment

DELETE Request

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployment/01234567-89AB-CDEF-0123-456789ABCDEF

Find all patch deployments starting with the most recent deployments

GET Request

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployment

Find all patch deployments created by the current user

GET Request

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments?CreatedByMe=true

Find all patch deployments started on or after 2018-01-12T20:35:48.89Z

GET Request

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments/?OnOrAfter=2018-01-12T20:35:48.89Z

Find the last five patch deployments started by the current user on or before 2018-01-12T20:35:48.89Z

GET Request

https://<consoleFQDN:port>/st/console/api/v1.0/patch/deployments/?Count=5&CreatedByMe=true&OnOrBefore=2018-01-12T20:35:48.89Z

 

Output Models

PatchDeployment

Name Type Description

completedMachineCount

Integer

On how many machines has the deployment completed?

creator

String

Who initiated the deployment?

expectedMachineCount

Integer

How many total machines are in this deployment?

isComplete

Boolean

Is the deployment complete?

lastUpdatedOn

DateTime

When was the last status update received?

links

Links

Shows the related URLs for the deployment, the machines and the template.

name

String

What is the name of the deployment template?

startedOn

DateTime

When was the deployment started?

id

Guid

The unique operation identifier assigned to the patch deployment.

MachineDeployState

Name Type Description

address

IPAddress

The IP address of the machine.

completedPatches

Integer

The count of in-progress patches

dnsName

String

The DNS name of the machine.

domain

String

The domain name of the machine.

errorCode

Integer

The error code reported on failure by the machine.

id

Integer

The unique machine identifier for the machine being deployed to

lastUpdated

DateTime

Specifies when the deployment status was last updated.

links

Links

Shows the related URL for the deployment to the machine.

name

String

The hostname of the machine.

overallState

DeploymentState

The overall state of the machine deployment (in-progress, completed, failed, etc.).

statusDescription

String

A description of the status of the deployment.

PatchDeployState

Name Type Description

bulletinId

String

The bulletin ID or product being applied.

finishedOn

DateTime

Date and time that the deployment finished installing patches.

hasExecuted

Boolean

Has the patch deployment been executed?

kb

String

The KB number of the patch or service pack level.

lastUpdated

DateTime

Date and time that the patch deployment status was last updated.

nativeCode

Integer

The native error code if the patch deployment failed.

overallState

DeploymentState

The overall state of the patch deployment (in progress, complete or failed).

overallStateDescription

String

A localized description of the overall deployment state.

patchId

Guid

The patch ID.

scheduledOn

DateTime

The date and time the patch was scheduled for deployment.

startedOn

DateTime

The date and time that the patch deployment started.

status

DeploymentResult

The deployment result status.

statusDescription

String

A localized description of the status.


Was this article useful?    

The topic was:

Inaccurate

Incomplete

Not what I expected

Other