new Script()
OO wrapper around scripts endpoint.
Script has special method called run
which will execute attached source code.
- Source:
Properties:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
id |
Number | |||
instanceName |
String | |||
label |
String | |||
source |
String | |||
runtime_name |
String | |||
description |
String |
<optional> |
null | |
links |
String |
<optional> |
{} | |
created_at |
Date |
<optional> |
null | |
updated_at |
Date |
<optional> |
null |
Methods
-
getRuntimes()
-
Gets allowed runtimes.
- Source:
Returns:
- Type
- Promise
Example
Script.please().runtimes({instanceName: 'test-one', id: 1}).then(function(script) { script.runtimes().then(function(runtimes) {}); });
-
run( [payload])
-
Runs current Script.
Parameters:
Name Type Argument Default Description payload
Object <optional>
{} - Source:
Returns:
- Type
- Promise
Example
Script.please().get({instanceName: 'test-one', id: 1}).then(function(script) { script.run({some: 'variable'}).then(function(trace) {}); });