URL

POST https://{api-url}/api/v2/tenants/{tenantId}/rba/categories/{categoryId}/scripts/{scriptId}

Sample URLs

https://{api-url}/api/v2/tenants/client_93/rba/categories/15/scripts/66
https://{api-url}/api/v2/tenants/msp_92/rba/categories/14/scripts/67

Parameters

FieldData TypeDescription
nameStringScript name.
descriptionStringDescription for the script.
executionTypeStringScript execution type.Supported Values: BATCHFILE, COMMAND, DOWNLOAD, EXE, MSI, POWERSHELL, PYTHON, PERL, PHP, SHELL, VBS
command/attachmentStringIf executionType is COMMAND, then command is needed else attachment file is needed.
platformsString(Optional) OS platforms.Example: WINDOWS, LINUX
installTimeoutInteger(Optional) Maximum time for installation.
registryPathString(Optional) Registry path for sanity check after execution.
registryValueString(Optional) Registry Value for sanity check after execution.
processNameString(Optional) Process name for sanity check.
serviceNameString(Optional) Service name for sanity check.
outputDirectoryString(Optional) Output directory supported required only when executionType is DOWNLOAD, EXE, MSI.
outputFileString(Optional) Output file supported required only when executionType is DOWNLOAD, EXE, MSI.
parameters(Optional) Parameter data.
  1. name
  2. description
  3. defaultValue
  4. type
  5. dataType
  1. String
  2. Integer
  3. String
  4. String
  5. String
  1. Name of parameter.
  2. Description for parameter.
  3. Default Value for the parameter.
  4. Parameter is mandatory or optional.
  5. Data Type of the parameter.
Example: STRING, INTEGER, PASSWORD

Status code

200 OK

Sample request

{
	"name": "Restart Apache Service",
	"description": "Restart Apache Service",
	"platforms": [
		"WINDOWS",
		"LINUX"
	],
	"registryPath": "HKEY_CURRENT_USER/Control Panel/Desktop",
	"registryValue": "dword:00000001",
	"processName": "cmd.exe",
	"serviceName": "OpsRampAgent",
	"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"
		},
		{
			"name": "New param - 3",
			"description": "Testing please ignore",
			"defaultValue": "50",
			"type": "OPTIONAL",
			"dataType": "STRING"
		}
	],
	"executionType": "SHELL",
	"installTimeout": 50,
	"attachment": {
		"name": "apache-restart.sh",
		"file": "UkVTVEFSVD0iL3NiaW4vc2VydmljZSBodHRwZCByZXN0YXJ0Ig0KUEdSRVA9Ii91c3IvYmluL3BncmVwIg0KSFRUUEQ9Imh0dHBkIg0KJFBHUkVQICR7SFRUUER9DQppZiBbICQ/IC1uZSAwIF0NCnRoZW4NCiAkUkVTVEFSVA0KZmk="
	}
}

Sample response

{
	"id": 73,
	"name": "Restart Apache Service",
	"description": "Restart Apache Service",
	"category": {
		"id": 28,
		"name": "CLIENT-Category"
	},
	"platforms": [
		"WINDOWS",
		"LINUX"
	],
	"parameters": [{
			"id": 94,
			"name": "Test Param - 1",
			"description": "Testing please ignore",
			"defaultValue": "10",
			"type": "REQUIRED",
			"dataType": "INTEGER"
		},
		{
			"id": 95,
			"name": "Test Param - 2",
			"description": "Testing please ignore",
			"defaultValue": "50",
			"type": "OPTIONAL",
			"dataType": "STRING"
		},
		{
			"id": 96,
			"name": "New param - 3",
			"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=6.00"
	},
	"scriptVersion": "6.00",
	"registryPath": "HKEY_CURRENT_USER/Control Panel/Desktop",
	"registryValue": "dword:00000001",
	"processName": "cmd.exe",
	"serviceName": "OpsRampAgent"
}