Creates a new startup script. Optionally specify a machine to use this startup script. For Linux machines, the script should be a bash script. For Windows machines, the script should be a PowerShell script. See the samples directory for sample startup scripts for Windows. Note: script data is limited to 16KB per script. See the Script Guide for more info on using scripts.
Create
Examples
paperspace.scripts.create({
scriptName: 'My Script',
scriptFile: './my_script_file.sh', // must specify either scriptFile or scriptText
scriptDescription: 'A startup script', // optional
isEnabled: true, // optional
runOnce: false, // optional
machineId: 'ps123abc', // optional
}, function(err, res) {
// handle error or result
});
# HTTP request:
https://api.paperspace.io
POST /scripts/createScript {"scriptName": "My Script", "scriptDescription": "A startup script", "isEnabled": true, "runOnce": false, "machineId": "ps123abc"}
x-api-key: 1ba4f98e7c0...
(file contents as multipart form data)
# Returns 200 on success
Parameters
Name
Type
Description
params
object
Script create parameters
Properties
cb
function
Node-style error-first callback function
Returns
script - The created script JSON object
Type object
Destroy
Destroys the startup script with the given id. When this action is performed, the script is immediately disassociated from any machines it is assigned to as well.
Examples
Parameters
Name
Type
Description
params
object
Script destroy parameters
Properties
cb
function
Node-style error-first callback function
List
List information about all scripts assigned to either the current authenticated user or the team, if the user belongs to a team. The list method takes an optional first argument to limit the returned script objects.
Examples
Parameters
Name
Type
Attributes
Description
filter
object
An optional filter object to limit the returned script objects
Properties
cb
function
Node-style error-first callback function
Returns
[ script, ... ] - JSON array of script objects
Type array
Show
Show information for the script with the given id, except for the script text. Use the scripts text method retrieve the script text.