URL
POST https://{api-url}/api/v2/tenants/{tenantId}/jobs
Sample URLs
https://{api-url}/api/v2/tenants/client_93/jobs
Status code
200 OK
Schedule patterns
Schedule the job with a specific pattern of Daily, Weekly, Monthly, Run once and Never.
Daily pattern
Schedule a job to run every day or on every weekday:
"pattern": {
"type": "daily",
"frequency": "everyday"
}
Weekly pattern
Schedule a job to run on every weekday:
"pattern": {
"type": "weekly",
"weekDays": "Sunday, Tuesday, Thursday, Saturday"
}
Monthly pattern
Schedule job to run on a specific day of every month:
"pattern": {
"type": "monthly",
"dayOfMonth": "1, 2, 3, 4, 5"
}
Schedule job to run on a specific weekday:
"pattern": {
"type": "monthly",
"weekIndex": "Second",
"dayOfWeek": "Sunday"
}
Run o
Schedule a job to run for a single time after completion of the initial occurrence:
"pattern": {
"type": "run once"
}
Never pattern
Schedule the job to run to only for a single time and not to reoccur again:
"pattern": {
"type": "never"
}
Create job with job type - AD checklist
Parameters
Field | Sub-Fields | Data Type | Values | Description |
---|---|---|---|---|
script | jobType | String | NA | Job type. To view job types that OpsRamp supports, see Get Job Types API. |
entities | NA | String | NA | (Optional) Resource id and resource type on which the job is assigned. |
name | NA | String | NA | The job name. |
jobQueued | NA | Boolean | true, false | (Optional) To run a job constantly after execution of other jobs. |
schedule | 1. startDate | String | yyyy-MM-ddTHH:mm:ssZ | Start date for execution of job. |
2. pattern | ||||
1. type | String | daily, weekly, monthly, never, run once | Recurrence pattern type. | |
2. frequency | String | everyday, every weekday, recurrence | Days 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. repeatType | String | days | Run the job constantly on specific days. | |
4. weekDays | String | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | Days on which the job is run. | |
5. dayOfMonth | Integer | 1, 2, 3, 4, ..., 31 | Day 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 the 4th day of every month. | |
6. weekIndex | String | First, Second, Third, Fourth, Last | Week on which the job is run. Example: First Monday. | |
7. dayOfIndex | String | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | Day on which the job is scheduled to run. Example: Provide weekIndex as First and dayOfMonth as Sunday, this indicates that job is run on every month First Sunday. |
NA indicates that the value is not applicable.
Note
A job is scheduled on each resource based on the location of the resource’s time zone. For example, a job is defined for two resources. They are located in New York and California with both scheduled to start at 11:00 AM. The job will start at 11:00 AM EST and at 11:00 PM PST.Sample URLs
This is a sample request and response for an AD checklist job type.
https://{api-url}/api/v2/tenants/client_13/jobs
Sample request
{
"name": "Ad Check List",
"jobQueued": "true",
"entities": [{
"resource": {
"id": "709824de-8315-4cf9-ad1c-b15aaf7bf2a5",
"type": "DEVICE"
}
},
{
"resource": {
"id": "4e96d5bc-763c-4c00-beab-928d653a0422",
"type": "DEVICE"
}
}
],
"script": {
"jobType": "adCheckList"
},
"schedule": {
"startDate": "2016-04-14T10:10:10+0000",
"pattern": {
"type": "daily",
"frequency": "recurrence",
"repeatType": "Days",
"repeatFrequency": "2"
}
}
}
Sample response
{
"name": "Ad Check List",
"entities": [{
"resource": {
"id": "709824de-8315-4cf9-ad1c-b15aaf7bf2a5",
"generalInfo": {
"ipAddresses": "10.233.19.130",
"hostName": "10.233.19.130"
},
"clientUniqueId": "client_13",
"type": "DEVICE"
}
},
{
"resource": {
"id": "4e96d5bc-763c-4c00-beab-928d653a0422",
"generalInfo": {
"ipAddresses": "172.30.1.60",
"hostName": "172.30.1.60"
},
"clientUniqueId": "client_13",
"type": "DEVICE"
}
}
],
"schedule": {
"startDate": "2016-04-14T10:10:00+0000",
"pattern": {
"type": "daily",
"frequency": "recurrence",
"repeatFrequency": 2,
"repeatType": "days"
}
},
"jobQueued": true,
"script": {
"jobType": "adCheckList"
},
"id": "4902d87c-b5df-4797-9f45-e807cd871ac9"
}
Create job with job type - network configuration backup
Parameters
Field | Sub-Fields | Data Type | Values | Description |
---|---|---|---|---|
script | 1. jobType | String | Job type to assign to resource. | |
2. configParams | Parameters to configure for the job type Network Backup Configuration | |||
1. versionsSaved | String | ALL_VERSIONS, VERSION_WITH_CHANGES | Take Backup of versions saved. | |
2. backUpTrigger | Boolean | true, false | Perform a backup on the receipt of a configuration change SNMP Trap. | |
3. startupConfigAlert | Boolean | true, false | Generate alerts on changes to startup configuration. | |
4. runConfigAlert | Boolean | true, false | Generate alerts on changes to runtime configuration. | |
5. startUpConfigFilesBackUp | Boolean | true, false | Startup configuration file to be backed up. | |
6. runTimeConfigFilesBackUp | Boolean | true, false | Runtime configuration file to be backed up. | |
3. entities | String | NA | Resources on which the job is run. | |
4. name | String | NA | The job name. | |
jobQueued | NA | Boolean | true, false | (Optional) Job queued indicates execution of job in an orderly manner called the queue. |
schedule | 1. startDate | String | yyyy-MM-ddTHH:mm:ssZ | Start date for execution of job. |
2. pattern | ||||
1. type | String | daily, weekly, monthly, never, run once | Recurrence pattern type. | |
2. frequency | String | everyday, every weekday, recurrence | Days 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. repeatType | String | days | Run the job constantly on specific days. | |
4. weekDays | String | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | Days on which the job is run. | |
5. dayOfMonth | Integer | 1, 2, 3, 4, ..., 31 | Day 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 the 4th day of every month. | |
6. weekIndex | String | First, Second, Third, Fourth, Last | Week on which the job is run. Example: First Monday. | |
7. dayOfIndex | String | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | Day on which the job is scheduled to run. Example: Provide weekIndex as First and dayOfMonth as Sunday, this indicates that job is run on every month First Sunday. |
NA indicates that the value is not applicable.
Sample URLs
This is a sample request and response for a network configuration backup job type.
https://{api-url}/api/v2/tenants/client_93/jobs
Sample request
{
"name": "Network Config Backup",
"jobQueued": "true",
"entities": [{
"resource": {
"id": "709824de-8315-4cf9-ad1c-b15aaf7bf2a5",
"type": "DEVICE"
}
},
{
"resource": {
"id": "4e96d5bc-763c-4c00-beab-928d653a0422",
"type": "DEVICE"
}
}
],
"script": {
"jobType": "networkconfigbackup",
"configParams": {
"versionsSaved": "ALL_VERSIONS",
"backUpTrigger": "true",
"startupConfigAlert": "true",
"runtimeConfigAlert": "true",
"startUpConfigFilesBackUp": "true",
"runTimeConfigFilesBackUp": "true"
}
},
"schedule": {
"startDate": "2016-04-14T10:10:10+0000",
"pattern": {
"type": "daily",
"frequency": "recurrence",
"repeatType": "Days",
"repeatFrequency": "2"
}
}
}
Sample response
{
"name": "Network Config Backup",
"entities": [{
"resource": {
"id": "709824de-8315-4cf9-ad1c-b15aaf7bf2a5",
"generalInfo": {
"ipAddresses": "10.233.19.130",
"hostName": "10.233.19.130"
},
"clientUniqueId": "client_13",
"type": "DEVICE"
}
},
{
"resource": {
"id": "4e96d5bc-763c-4c00-beab-928d653a0422",
"generalInfo": {
"ipAddresses": "172.30.1.60",
"hostName": "172.30.1.60"
},
"clientUniqueId": "client_13",
"type": "DEVICE"
}
}
],
"schedule": {
"startDate": "2016-04-14T10:10:00+0000",
"pattern": {
"type": "daily",
"frequency": "recurrence",
"repeatFrequency": 2,
"repeatType": "days"
}
},
"jobQueued": true,
"script": {
"jobType": "networkconfigbackup",
"configParams": {
"versionsSaved": "ALL_VERSIONS",
"backUpTrigger": true,
"startupConfigAlert": true,
"runtimeConfigAlert": true,
"startUpConfigFilesBackUp": true,
"runTimeConfigFilesBackUp": true
}
},
"id": "cc242a8d-b0b4-430e-a89f-7081bc5e79b0"
}
Create job with job type - app install
Parameters
Field | Sub-Fields | Data Type | Values | Description |
---|---|---|---|---|
1. script | 1. jobType | String | NA | The job type. |
2. approvalType | ||||
1. approvalType | Integer | 0 for Manual approval, 1 for Auto approval | Approval type required to install the app. Example: Provide 0 as approvalType which indicates app is manually installed. | |
2. approvalReason | String | NA | Reason for approval of installing app. | |
3. alertRequired | Boolean | true, false | Alert should be generated while installing app. | |
2. entities | NA | String | NA | (Optional) Resources on which the job is run. |
3. name | NA | String | NA | (Optional) The job name. |
4. jobQueued | NA | Boolean | true, false | (Optional) Job queued indicates the execution order of a job. Example: A job is placed in a queue, the job then run in a specific order provided in the queue. |
5. schedule | 1. startDate | String | yyyy-MM-ddTHH:mm:ssZ | (Optional) Start date for execution of job. |
2. pattern | ||||
1. type | String | daily, weekly, monthly, never, run once | Recurrence pattern type. | |
2. frequency | String | everyday, every weekday, recurrence | Days 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. repeatType | String | days | Run the job constantly on specific days. | |
4. weekDays | String | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | Days on which the job is run. | |
5. dayOfMonth | Integer | 1, 2, 3, 4, ..., 31 | Day 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 the 4th day of every month. | |
6. weekIndex | String | First, Second, Third, Fourth, Last | Week on which the job is run. Example: First Monday. | |
7. dayOfIndex | String | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | Day on which the job is scheduled to run. Example: Provide weekIndex as First and dayOfMonth as Sunday, this indicates that job is run on every month First Sunday. |
NA indicates that the value is not applicable.
Sample URLs
This is a sample request and response for an app install job type.
https://{api-url}/api/v2/tenants/client_93/jobs
Sample request
{
"name": "test",
"jobQueued": "true",
"entities": [{
"resource": {
"id": "709824de-8315-4cf9-ad1c-b15aaf7bf2a5",
"type": "DEVICE"
}
},
{
"resource": {
"id": "4e96d5bc-763c-4c00-beab-928d653a0422",
"type": "DEVICE"
}
}
],
"script": {
"jobType": "appinstall",
"approvalType": {
"approvalType": "1",
"approvalReason": "for testing",
"alertRequired": "true"
}
},
"schedule": {
"startDate": "2016-04-14T10:10:10+0000",
"pattern": {
"type": "daily",
"frequency": "recurrence",
"repeatType": "Days",
"repeatFrequency": "2"
}
}
}
Sample response
{
"name": "test",
"entities": [{
"resource": {
"id": "709824de-8315-4cf9-ad1c-b15aaf7bf2a5",
"generalInfo": {
"ipAddresses": "10.233.19.130",
"hostName": "10.233.19.130"
},
"clientUniqueId": "client_13",
"type": "DEVICE"
}
},
{
"resource": {
"id": "4e96d5bc-763c-4c00-beab-928d653a0422",
"generalInfo": {
"ipAddresses": "172.30.1.60",
"hostName": "172.30.1.60"
},
"clientUniqueId": "client_13",
"type": "DEVICE"
}
}
],
"schedule": {
"startDate": "2016-04-14T10:10:00+0000",
"pattern": {
"type": "daily",
"frequency": "recurrence",
"repeatFrequency": 2,
"repeatType": "days"
}
},
"jobQueued": true,
"script": {
"jobType": "appinstall",
"approvalType": {
"approvalType": 1,
"approvalReason": "for testing",
"alertRequired": true
}
},
"id": "8a87f644-0bdc-4d5a-9e41-0ca333b71acd"
}
Create job with job type - custom script
Parameters
Field | Sub-Fields | Data Type | Values | Description |
---|---|---|---|---|
1. script | 1. jobType | String | NA | The job type. |
2. customScript | Integer | NA | Custom script ID. | |
1. id | ||||
2. entities | NA | String | NA | (Optional) Date on which the job execution is initiated. |
3. name | NA | String | NA | (Optional)The job name. |
4. jobQueued | NA | Boolean | true, false | (Optional) Job queued indicates the execution order of a job. |
5. schedule | 1. startDate | String | yyyy-MM-ddTHH:mm:ssZ | (Optional) Start date for execution of job. |
2. pattern | ||||
1. type | String | daily, weekly, monthly, never, run once | Recurrence pattern type. | |
2. frequency | String | everyday, every weekday, recurrence | Days 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. repeatType | String | days | Run the job constantly on specific days. | |
4. weekDays | String | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | Days on which the job is run. | |
5. dayOfMonth | Integer | 1, 2, 3, 4, ..., 31 | Day 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 the 4th day of every month. | |
6. weekIndex | String | First, Second, Third, Fourth, Last | Week on which the job is run. Example: First Monday. | |
7. dayOfIndex | String | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday | Day on which the job is scheduled to run. Example: Provide weekIndex as First and dayOfMonth as Sunday, this indicates that job is run on every month First Sunday. | |
6. userType | NA | Integer | 1- system user, 2- Other user | (Optional) The user type. |
7. credentialSet | uniqueId | String | NA | (Optional) Device or client credential set ID.
|
8. parameters | 1. paramId | Integer | NA | (Optional) The parameter Id. |
2. value or itopMacro | Integer | NA | Value. | |
1. id |
NA indicates that the value is not applicable.
Sample URLs
This is a sample request and response for a custom script job type.
https://{api-url}/api/v2/tenants/client_93/jobs
https://{api-url}/api/v2/tenants/msp_12/jobs
Sample request
{
"jobQueued": "true",
"script": {
"jobType": "custom",
"userType": "2",
"customScript": {
"id": "7"
},
"parameters": [{
"paramId": "2",
"value": "150"
}]
},
"entities": [{
"resource": {
"id": "709824de-8315-4cf9-ad1c-b15aaf7bf2a5",
"type": "DEVICE"
}
},
{
"resource": {
"id": "4e96d5bc-763c-4c00-beab-928d653a0422",
"type": "DEVICE"
}
}
],
"schedule": {
"startDate": "2016-04-14T10:10:10+0000",
"pattern": {
"type": "daily",
"frequency": "recurrence",
"repeatType": "Days",
"repeatFrequency": "2"
}
}
}
Sample response
{
"name": "Job - test script",
"entities": [{
"resource": {
"id": "709824de-8315-4cf9-ad1c-b15aaf7bf2a5",
"generalInfo": {
"ipAddresses": "10.233.19.130",
"hostName": "10.233.19.130"
},
"clientUniqueId": "client_13",
"type": "DEVICE"
}
},
{
"resource": {
"id": "4e96d5bc-763c-4c00-beab-928d653a0422",
"generalInfo": {
"ipAddresses": "172.30.1.60",
"hostName": "172.30.1.60"
},
"clientUniqueId": "client_13",
"type": "DEVICE"
}
}
],
"schedule": {
"startDate": "2016-04-14T10:10:00+0000",
"pattern": {
"type": "daily",
"frequency": "recurrence",
"repeatFrequency": 2,
"repeatType": "days"
}
},
"jobQueued": true,
"script": {
"customScript": {
"id": 7,
"name": "test script",
"description": "test script",
"platforms": [
"WINDOWS"
]
},
"parameters": [{
"paramId": 2,
"name": "String",
"value": "150"
}],
"userType": 2
},
"id": "ce1088d5-81cc-4262-b515-a75230f0d8e4"
}