Create a new Instance
POST
https://api.neuroscale.io/v2.0/instances
To create a new Instance send a JSON-encoded object containing initial values for the following attributes (attributes shown in bold are required):
| Name | Type | Description |
|---|---|---|
| description | String | Description of the Instance. |
| encoding | String | Encoding of messages sent and received by the Instance (value is either "json" or "msgpack"). See Understanding Instance Metadata and the NeuroScale Message Format for more information. |
| metadata | Object / Hash | Configuration of the Instance's input nodes and output nodes. See Instance Metadata for more information. |
| mode | String | Mode of the Instance (value is one of "predict", "simulate" or "train"). |
| parameters | Object / Hash | Object of key-value pairs defining user-adjustable Pipeline parameters and their Instance-specific values. |
| pipeline | String | Unique identifier of the Pipeline used to create the Instance. |
| properties | Object / Hash | User-editable object of key-value pairs that can be used to add arbitrary tags to the Instance (for personal use). |
| replace_nans | Boolean | Designates whether or not to replace NaNs in incoming/outgoing messages. |
| replace_nans_with | Double | The value to replace NaNs with in incoming/outgoing messages. |
| time_to_live | Integer | Time to live (in seconds) from last received incoming message (Instance will be automatically terminated if this value is exceeded). |
Authentication¶
Type: Access token
Required scopes: instance or create:instance
Responses¶
Example response — 201¶
{
"created_at": 1445979369,
"description": "Description of Instance",
"encoding": "json",
"endpoints": {
"count": 2,
"data": [
{
"created_at": 1445979369,
"id": "ep_o5YahbaaALiHe7SwqnkaYd",
"instance": "in_pNSdRK7AL85ZqdD49qwQBg",
"mode": "write",
"object": "endpoint",
"updated_at": 1445979369,
"url": "mqtt://streaming.neuroscale.io:443/HQqa8gNM66RgJKnZ43SLWT/in"
},
{
"created_at": 1445979369,
"id": "ep_25jGWzHAcmzqVgvHB8RkH8",
"instance": "in_pNSdRK7AL85ZqdD49qwQBg",
"mode": "read",
"object": "endpoint",
"updated_at": 1445979369,
"url": "mqtt://streaming.neuroscale.io:443/HQqa8gNM66RgJKnZ43SLWT/out"
}
],
"object": "list",
"url": "/v1/instances/in_pNSdRK7AL85ZqdD49qwQBg/endpoints"
},
"id": "in_pNSdRK7AL85ZqdD49qwQBg",
"metadata": {
"nodes": {
"in": [],
"out": []
}
},
"mode": "predict",
"object": "instance",
"parameters": {},
"pipeline": "pl_xTg7suuqGzFCGcnmb6Xx7f",
"properties": {
"key_1": "value_1",
"key_2": "value_2"
},
"replace_nans": true,
"replace_nans_with": 0.0,
"state": "configuring",
"time_to_live": 21600,
"updated_at": 1445979457,
"user": "usr_ZTNc2sEjoq6JoEgPNFUg6g"
}