Spaces method and path for this operation:
Refer to Spaces for more information.
Create a new script entry by uploading a script file
Body
Required
-
Description of the script and its purpose/functionality
-
Example usage of the script
-
The script file upload
-
The type of the uploaded file, which determines the expected value of
pathToExecutable. IffileTypeis "script", thenpathToExecutableshould not be included. IffileTypeis "archive", thenpathToExecutableis required and should specify the path to the executable file within the archive.Values are
scriptorarchive. -
Instructions for using the script, including details around its supported input arguments
-
Name of the script
-
Used only for when the uploaded script is an archive (.zip file for example). This property defines the relative path to the file included in the archive that should be executed once its contents are extracted. The path should be relative to the root of the archive.
-
Platforms supported by the the script
Values are
linux,macos, orwindows. -
Whether the script requires input arguments
curl \
--request POST 'https://localhost:5601/api/endpoint/scripts_library' \
--header "Authorization: $API_KEY" \
--header "Content-Type: multipart/form-data" \
--form "description=Collects host data for investigation" \
--form "example=./collect_host_data.sh --help" \
--form "file=./collect_host_data.zip" \
--form "fileType=archive" \
--form "instructions=Collects host data for investigation" \
--form "name=Collect host data" \
--form "pathToExecutable=./bin/collect_host_data.sh" \
--form "platform[]=linux" \
--form "platform[]=macos" \
--form "requiresInput=false"
{"description" => "Collects host data for investigation", "example" => "./collect_host_data.sh --help", "file" => "./collect_host_data.zip", "fileType" => "archive", "instructions" => "Collects host data for investigation", "name" => "Collect host data", "pathToExecutable" => "./bin/collect_host_data.sh", "platform" => ["linux", "macos"], "requiresInput" => false}
{"description" => "Collects host data for investigation", "example" => "./collect_host_data.sh --help", "file" => "./collect_host_data.sh", "fileType" => "script", "instructions" => "Collects host data for investigation", "name" => "Collect host data", "platform" => ["linux", "macos"], "requiresInput" => false}
{
"data": {
"description": "Collects host data for investigation",
"file": "./collect_host_data.sh",
"fileType": "script",
"id": 1234567890,
"instructions": "No arguments required",
"name": "Collect host data",
"platform": [
"linux",
"macos"
]
}
}