- Source:
Methods
(static) list(filteropt, cb) → {array}
- Source:
List information about all templates available 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 template objects.
Examples
paperspace.templates.list(function(err, res) {
// handle error or result
});
$ paperspace templates list
# HTTP request:
https://api.paperspace.io
GET /templates/getTemplates
x-api-key: 1ba4f98e7c0...
# Returns 200 on success
// Example return value:
[
// A public template:
{
"id": "t123abc",
"name": "paperspace/t123abc",
"label": "Windows 10",
"os": "Windows 10 (Server 2016)",
"dtCreated": "2017-01-03T23:41:06.801Z"
},
// A team-owned template:
{
"id": "t456def",
"name": "t456def",
"label": "New Template 1",
"os": "Ubuntu 14.04.5 LTS; uname: 4.2.0-27-generic; distro: ubuntu; major: 14; minor: 04",
"teamId": "te456def",
"userId": null,
"region": "East Coast (NY2)",
"dtCreated": "2017-02-06T18:46:44.882Z"
}
]
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
filter |
object |
<optional> |
An optional filter object to limit the returned template objects Properties
|
||||||||||||||||||||||||||||||||||||
cb |
function | Node-style error-first callback function |
Returns:
[ template, ... ] - JSON array of template objects
- Type
- array