URL
POST https://{api-url}/api/v2/tenants/{tenantId}/rba/categories/{categoryId}/scripts
Sample URLs
https://{api-url}/api/v2/tenants/client_93/rba/categories/15/scripts
Parameters
Field | Data Type | Description |
---|---|---|
name | String | Script name. |
description | String | Description for the script. |
executionType | String | Script execution type.Supported Values: BATCHFILE, COMMAND, DOWNLOAD, EXE, MSI, POWERSHELL, PYTHON, PERL, PHP, SHELL, VBS |
command/attachment | String | If executionType is COMMAND, then command is needed else attachment file is needed. |
platforms | String | (Optional) OS platforms.Example: WINDOWS, LINUX |
installTimeout | Integer | (Optional) Maximum time for installation. |
registryPath | String | (Optional) Registry path for sanity check after execution. |
registryValue | String | (Optional) Registry Value for sanity check after execution. |
processName | String | (Optional) Process name for sanity check. |
serviceName | String | (Optional) Service name for sanity check. |
outputDirectory | String | (Optional) Output directory supported required only when executionType is DOWNLOAD, EXE, MSI. |
outputFile | String | (Optional) Output file supported required only when executionType is DOWNLOAD, EXE, MSI. |
parameters | (Optional) Parameter data. | |
|
|
|
Notes
- Attachment files must be converted to byte stream and base64-encoded. Always include a name and file.
- To retrieve the list of available categories, invoke the Get Categories API.
Status code
200 OK
Sample request
{
"name": "Restart Apache",
"description": "Restart Apache using Shell",
"platforms": [
"WINDOWS",
"LINUX"
],
"executionType": "SHELL",
"installTimeout": "50",
"registryPath": "HKEY_CURRENT_USER/Control Panel/Desktop",
"registryValue": "dword:00000001",
"processName": "cmd.exe",
"serviceName": "OpsRampAgent",
"attachment": {
"name": "apache-restart.sh",
"file": "UkVTVEFSVD0iL3NiaW4vc2VydmljZSBodHRwZCByZXN0YXJ0Ig0KUEdSRVA9Ii91c3IvYmluL3BncmVwIg0KSFRUUEQ9Imh0dHBkIg0KJFBHUkVQICR7SFRUUER9DQppZiBbICQ/IC1uZSAwIF0NCnRoZW4NCiAkUkVTVEFSVA0KZmk="
},
"parameters": [{
"name": "Test Param - 1",
"description": "Testing please ignore",
"defaultValue": "10",
"type": "REQUIRED",
"dataType": "INTEGER"
},
{
"name": "Test Param - 2",
"description": "Testing please ignore",
"defaultValue": "50",
"type": "OPTIONAL",
"dataType": "STRING"
}
]
}
Sample response
{
"id": 78,
"name": "Restart Service",
"description": "Restart Service",
"category": {
"id": 28,
"name": "CLIENT-Category"
},
"platforms": [
"WINDOWS",
"LINUX"
],
"parameters": [{
"id": 102,
"name": "Test Param - 1",
"description": "Testing please ignore",
"defaultValue": "10",
"type": "REQUIRED",
"dataType": "INTEGER"
},
{
"id": 103,
"name": "Test Param - 2",
"description": "Testing please ignore",
"defaultValue": "50",
"type": "OPTIONAL",
"dataType": "STRING"
}
],
"executionType": "SHELL",
"installTimeout": 50,
"attachment": {
"id": 0,
"name": "apache-restart.sh",
"contentURL": "https://localhost:8443/downloadScript.do?action=downloadAgent&fileName=apache-restart.sh&version=0.00"
},
"scriptVersion": "0.00",
"registryPath": "HKEY_CURRENT_USER/Control Panel/Desktop",
"registryValue": "dword:00000001",
"processName": "cmd.exe",
"serviceName": "OpsRampAgent"
}