You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 6, 2023. It is now read-only.
The **Paperspace SDK** is the official devkit for automating your [Paperspace](https://paperspace.com) account. It's currently available in JavaScript, and we plan to offer other languages and integrations in the future. For v0, we are offering basic actions such as creating machines and managing team members. This repo includes:
11
+
The **Paperspace API** is the official devkit for automating your [Paperspace](https://paperspace.com) account. It's currently available in JavaScript, and we plan to offer other languages and integrations in the future. For v0, we are offering basic actions such as creating machines and managing team members. This repo includes:
12
12
13
13
*[JavaScript API client](#programmatic) (for Node.js and the browser)
Your system will need [Node.js](https://nodejs.org) v4+ installed. Check that you have a recent enough version by running `node -v` in your terminal. Node.js comes bundled with `npm`, the Node.js package management tool, which you'll use to install this SDK.
19
+
Your system will need [Node.js](https://nodejs.org) v4+ installed. Check that you have a recent enough version by running `node -v` in your terminal. Node.js comes bundled with `npm`, the Node.js package management tool, which you'll use to install this package.
The reason we recommend installing it globally is so the `paperspace` command will be available on your command line everywhere on your system. If you only want to make it available within an individual Node.js project, you can install it locally by omitting the `-g` flag.
28
28
@@ -42,13 +42,13 @@ You can interact with Paperspace's API in three ways: programatically (from with
42
42
43
43
We'll be illustrating all examples using [ES5](http://speakingjs.com/es5/ch01.html) syntax and the CommonJS module format. For other systems like AMD, consider using a bundler such as Browserify.
44
44
45
-
Assuming you've installed the `paperspace-sdk` package, you can import the SDK with:
45
+
Assuming you've installed the `paperspace-node` package, you can import the package with:
46
46
47
-
var paperspace_sdk = require('paperspace-sdk');
47
+
var paperspace_node = require('paperspace-node');
48
48
49
49
Then create an instance of the client, passing in your authentication credentials:
50
50
51
-
var paperspace = paperspace_sdk({
51
+
var paperspace = paperspace_node({
52
52
apiKey: '0b3c5f...' // <~ Copy+paste your key here
53
53
});
54
54
@@ -64,11 +64,11 @@ All of the methods are namespaced by category ("machines.create" or "invoices.sh
64
64
65
65
That is, the first argument is parameters object, and the second is a error-first callback function.
66
66
67
-
For information on all the methods available, see the [API documentation](https://paperspace.github.io/paperspace-sdk).
67
+
For information on all the methods available, see the [API documentation](https://paperspace.github.io/paperspace-node).
68
68
69
69
### CLI
70
70
71
-
Assuming you've installed the `paperspace-sdk` package, you can invoke the Paperspace CLI with:
71
+
Assuming you've installed the `paperspace-node` package, you can invoke the Paperspace CLI with:
72
72
73
73
$ paperspace --help
74
74
@@ -83,13 +83,13 @@ The CLI provides all methods as subcommands. For example:
83
83
84
84
$ paperspace machines create --name "My Machine" --size 50 # etc.
85
85
86
-
For information on all the methods available, see the [API documentation](https://paperspace.github.io/paperspace-sdk).
86
+
For information on all the methods available, see the [API documentation](https://paperspace.github.io/paperspace-node).
If you'd prefer to interact with our HTTP API directly, and roll your own client instead of using ours, our HTTP endpoints are also described in our [API documentation](https://paperspace.github.io/paperspace-sdk).
92
+
If you'd prefer to interact with our HTTP API directly, and roll your own client instead of using ours, our HTTP endpoints are also described in our [API documentation](https://paperspace.github.io/paperspace-node).
93
93
94
94
NOTE: the HTTP endpoints are subject to change in the future. We recommend using one of the programmatic APIs whenever possible to maintain forward compatibility.
Copy file name to clipboardExpand all lines: developers.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ A brief guide for developers who want to contribute to this repo.
6
6
7
7
This repo is responsible for two overall things:
8
8
9
-
***Docs** covering SDK usage
9
+
***Docs** covering API usage
10
10
***Code** that implements the JavaScript client and CLI
11
11
12
12
#### Docs
@@ -38,11 +38,11 @@ The CLI handler code is in `cli/index.js`. This is just a very small wrapper ove
38
38
39
39
##### JavaScript
40
40
41
-
The entry module for the JavaScript client is `lib/index.js`.
41
+
The entry module for the JavaScript client is `lib/index.js`.
42
42
43
43
Implementation of the individual methods provided by the API are located in the subfolders: `lib/*/*.js`, e.g. `lib/machines/create.js`.
44
44
45
-
Although the JavaScript entry module loads these individual implementations into a single root interface that can be accessed with `require('paperspace-sdk')`, it is also set up so they can be required a la carte: `require('paperspace-sdk/lib/machines/create')`. Start following the code in `lib/paperspace.js` to understand how this happens.
45
+
Although the JavaScript entry module loads these individual implementations into a single root interface that can be accessed with `require('paperspace-node')`, it is also set up so they can be required a la carte: `require('paperspace-node/lib/machines/create')`. Start following the code in `lib/paperspace.js` to understand how this happens.
<article><h1>Paperspace API (v0.0.0)</h1><p><imgsrc="https://cloud.githubusercontent.com/assets/585865/26324445/cdeb6658-3f00-11e7-9a18-3e2070d9a400.png" alt="image"></p>
50
50
<hr>
51
51
<p><strong>Heads up! This project is under construction!</strong> We're offering this early, unstable, pre-alpha release to get early feedback and to see how it might get used in the wild. Use caution: Until we ship a release >= v1.0, expect to encounter bugs, and expect our documentation to be missing or inaccurate in places. We welcome your bug reports and suggestions via GitHub Issues!</p>
52
52
<hr>
53
-
<p>The <strong>Paperspace SDK</strong> is the official devkit for automating your <ahref="https://paperspace.com">Paperspace</a> account. It's currently available in JavaScript, and we plan to offer other languages and integrations in the future. For v0, we are offering basic actions such as creating machines and managing team members. This repo includes:</p>
53
+
<p>The <strong>Paperspace API</strong> is the official devkit for automating your <ahref="https://paperspace.com">Paperspace</a> account. It's currently available in JavaScript, and we plan to offer other languages and integrations in the future. For v0, we are offering basic actions such as creating machines and managing team members. This repo includes:</p>
54
54
<ul>
55
55
<li><ahref="#programmatic">JavaScript API client</a> (for Node.js and the browser)</li>
<h2>Getting started</h2><p>Your system will need <ahref="https://nodejs.org">Node.js</a> v4+ installed. Check that you have a recent enough version by running <code>node -v</code> in your terminal. Node.js comes bundled with <code>npm</code>, the Node.js package management tool, which you'll use to install this SDK.</p>
59
+
<h2>Getting started</h2><p>Your system will need <ahref="https://nodejs.org">Node.js</a> v4+ installed. Check that you have a recent enough version by running <code>node -v</code> in your terminal. Node.js comes bundled with <code>npm</code>, the Node.js package management tool, which you'll use to install this package.</p>
60
60
<h3>Installation</h3><p>Install the package from npm:</p>
61
-
<preclass="prettyprint source"><code>$ npm install -g Paperspace/paperspace-sdk#master</code></pre><p>The reason we recommend installing it globally is so the <code>paperspace</code> command will be available on your command line everywhere on your system. If you only want to make it available within an individual Node.js project, you can install it locally by omitting the <code>-g</code> flag.</p>
61
+
<preclass="prettyprint source"><code>$ npm install -g Paperspace/paperspace-node#master</code></pre><p>The reason we recommend installing it globally is so the <code>paperspace</code> command will be available on your command line everywhere on your system. If you only want to make it available within an individual Node.js project, you can install it locally by omitting the <code>-g</code> flag.</p>
62
62
<h3>Setup</h3><p>Before you can use this tool, you'll need a <ahref="https://paperspace.com">Paperspace account</a>. You'll use this account to obtain Paperspace API keys.</p>
63
63
<h3>Obtaining an API key</h3><p>First, sign in to your <ahref="https://paperspace.com">Paperspace account</a>. Click 'Launch Console' at top right. From your admin console, you should find an 'Account Info' section. There, you'll find a form where you can create API keys. You'll use the API keys you generate here to authenticate your requests.</p>
64
64
<h2>Usage</h2><p>You can interact with Paperspace's API in three ways: programatically (from within JavaScript), from the command line (using the Paperspace CLI), or using an HTTP client of your choice and the Paperspace API HTTP enpoints documented here. The JavaScript libabry and the CLI are backed by the same underlying API client.</p>
65
65
<h3>Programmatic</h3><p>We'll be illustrating all examples using <ahref="http://speakingjs.com/es5/ch01.html">ES5</a> syntax and the CommonJS module format. For other systems like AMD, consider using a bundler such as Browserify.</p>
66
-
<p>Assuming you've installed the <code>paperspace-sdk</code> package, you can import the SDK with:</p>
67
-
<preclass="prettyprint source"><code>var paperspace_sdk = require('paperspace-sdk');</code></pre><p>Then create an instance of the client, passing in your authentication credentials:</p>
<p>Assuming you've installed the <code>paperspace-node</code> package, you can import the package with:</p>
67
+
<preclass="prettyprint source"><code>var paperspace_node = require('paperspace-node');</code></pre><p>Then create an instance of the client, passing in your authentication credentials:</p>
apiKey: '0b3c5f...' // <~ Copy+paste your key here
70
70
});</code></pre><h4>Calling the API programmatically</h4><p>All of the methods are namespaced by category ("machines.create" or "invoices.show") and have the same function signature. For example:</p>
<h4>Calling the API with the CLI</h4><p>The CLI provides all methods as subcommands. For example:</p>
84
-
<preclass="prettyprint source"><code>$ paperspace machines create --name "My Machine" --size 50 # etc.</code></pre><p>For information on all the methods available, see the <ahref="https://paperspace.github.io/paperspace-sdk">API documentation</a>.</p>
85
-
<h2><ahref="https://paperspace.github.io/paperspace-sdk">API Documentation</a></h2><h2>HTTP endpoints</h2><p>If you'd prefer to interact with our HTTP API directly, and roll your own client instead of using ours, our HTTP endpoints are also described in our <ahref="https://paperspace.github.io/paperspace-sdk">API documentation</a>.</p>
84
+
<preclass="prettyprint source"><code>$ paperspace machines create --name "My Machine" --size 50 # etc.</code></pre><p>For information on all the methods available, see the <ahref="https://paperspace.github.io/paperspace-node">API documentation</a>.</p>
85
+
<h2><ahref="https://paperspace.github.io/paperspace-node">API Documentation</a></h2><h2>HTTP endpoints</h2><p>If you'd prefer to interact with our HTTP API directly, and roll your own client instead of using ours, our HTTP endpoints are also described in our <ahref="https://paperspace.github.io/paperspace-node">API documentation</a>.</p>
86
86
<p>NOTE: the HTTP endpoints are subject to change in the future. We recommend using one of the programmatic APIs whenever possible to maintain forward compatibility.</p>
87
87
<h3>Address for HTTP endpoints</h3><p>If making HTTP requests directly to the Paperspace HTTP endpoints use the following address for each request: <code>https://api.paperspace.io</code></p>
88
88
<h3>Authenticating to HTTP endpoints</h3><p>In order to use the HTTP API directly you must specify the <code>x-api-key</code> header with the value of the API key obtained using the procedure above.</p>
@@ -113,4 +113,4 @@ <h2>Copyright</h2><p>Copyright :copyright: 2017 Paperspace - All Rights Reserved
0 commit comments