URL

POST https://{api-url}/api/v2/tenants/{tenantId}/patches/configurations/{id}

Sample URLs

https://{api-url}/api/v2/tenants/client_13/patches/configurations/PATCHCONF-9db1451f-1441-4bd9-90b9-aa371fc11e6d

Parameters

FieldSub-FieldsData TypeValuesDescription
patchConfigNameNAStringNAPatch configuration name.
descriptionNAStringNADescription for patch configuration.
scheduleJob1. entitiesStringNAResources in which the patches are executed.
2. script
  • jobType
StringNAJob type.
Example: missingPatchesDownloadUpdate
approvalType1. approvalTypeInteger0- Manual, 1- AutoApproval type for executing patches.
2. approvalReasonString(Optional) Approval reason for executing patches.
schedule(Optional sub-fields) Schedule settings.
1. startDateStringyyyy-MM-ddTHH:mm:ssZStart date for execution of job.
2. pattern
    1. typeStringdaily, weekly, monthly, never, run onceRecurrence pattern type.
Note: The Run On Demand recurrence pattern is not available as an API.
    2. frequencyStringeveryday, every weekday, recurrenceDays on which the schedule is applied. Frequency is dependent on recurrence pattern type.
Example: Provide type as weekly, then frequency is the day on which the job is run.
    3. repeatTypeStringdaysRun the job constantly on specific days.
    4. weekDaysStringSunday, Monday, Tuesday, Wednesday, Thursday, Friday, SaturdayDays on which the job is run.
    5. dayOfMonthInteger1, 2, 3, 4,..., 31Day on which the job is scheduled to run every month. Days range between 1 to 31.
Example: Provide dayOfMonth as 4, then the job is run on 4th day of every month.
    6. weekIndexStringFirst, Second, Third, Fourth, LastWeek on which the job is run.
Example: First Monday
    7. dayOfIndexStringSunday, Monday, Tuesday, Wednesday, Thursday, Friday, SaturdayDay on which the job is scheduled to run.
Example: Provide weekIndex as First and dayOfMonth as Sunday. This indicates that the job is run on First Sunday of every month.
enablePatchingNABooleantrue, false(Optional) Enable patching.
maintenancePeriodNAIntegerNA(Optional) Maintenance period for the patches.
rebootOptions1. rebootRequiredBooleantrue, falseReboot required after execution of patches.
2. forceRebootBooleantrue, falseForce reboot after execution of patches.

NA indicates that the value is not applicable.

Status code

200 OK

Sample request

{
	"id": "PATCHCONF-9db1451f-1441-4bd9-90b9-aa371fc11e6d",
	"patchConfigName": "Test_Patch_Config",
	"description": "testing",
	"approvalType": {
		"approvalType": 1,
		"approvalReason": "testing data"
	},
	"rebootOptions": {
		"rebootRequired": "true",
		"forceReboot": "true"
	},
	"scheduleJob": {
		"entities": [{
				"resource": {
					"id": "04e26c5a-2173-4857-98b5-31190bb9985d",
					"type": "DEVICE"
				}
			},
			{
				"resource": {
					"id": "338382d8-d4e3-4573-85fc-27580b68ac5c",
					"type": "DEVICE"
				}
			}
		],
		"script": {
			"jobType": "missingPatchesDownloadUpdate"
		},
		"schedule": {
			"startDate": "2016-04-14T10:10:10+0000",
			"pattern": {
				"type": "daily",
				"frequency": "recurrence",
				"repeatType": "Days",
				"repeatFrequency": "2"
			}
		}
	},
	"enablePatching": "true",
	"maintenancePeriod": "60"
}

Sample response

{
	"scheduleJob": {
		"name": "test",
		"entities": [{
				"resource": {
					"id": "04e26c5a-2173-4857-98b5-31190bb9985d",
					"generalInfo": {
						"ipAddresses": "10.21.0.212",
						"hostName": "opsramp-demo-ubuntu-2"
					},
					"clientUniqueId": "client_13",
					"type": "DEVICE"
				}
			},
			{
				"resource": {
					"id": "338382d8-d4e3-4573-85fc-27580b68ac5c",
					"generalInfo": {
						"ipAddresses": "10.21.0.213",
						"hostName": "opsramp-demo-ubuntu-3"
					},
					"clientUniqueId": "client_13",
					"type": "DEVICE"
				}
			}
		],
		"schedule": {
			"startDate": "2016-04-14T10:10:00+0000",
			"pattern": {
				"type": "daily",
				"frequency": "recurrence",
				"repeatFrequency": 2,
				"repeatType": "days"
			}
		},
		"client": {
			"id": 13,
			"uniqueId": "client_13",
			"name": "patch client",
			"activated": true
		},
		"script": {
			"jobType": "missingPatchesDownloadUpdate"
		}
	},
	"id": "PATCHCONF-9db1451f-1441-4bd9-90b9-aa371fc11e6d",
	"patchConfigName": "test",
	"description": "testing",
	"approvalType": {
		"approvalType": 1,
		"approvalReason": "testing data"
	},
	"rebootOptions": {
		"rebootRequired": true,
		"forceReboot": true
	},
	"enablePatching": true,
	"maintenancePeriod": 60
}