Create script

This endpoint is used to create a script.

Leave Feedback

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

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",
	"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"
}