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.
@@ -78,13 +78,13 @@ <h3>Installation</h3><p>Install the package from npm:</p>
78
78
<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>
79
79
<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>
<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>
82
-
<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>
81
+
<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 library and the CLI are backed by the same underlying API client.</p>
82
+
<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 Asynchronous Module Definition, consider using a bundler such as Browserify.</p>
83
83
<p>First install the <code>paperspace-node</code> package in your project directory using:</p>
84
84
<preclass="prettyprint source"><code>$ npm install paperspace-node</code></pre><p>Within your node.js app you can import the package with:</p>
85
85
<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
87
+
apiKey: '1ba4f98e7c0...' // <- paste your api key here
88
88
});</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>
102
-
<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>
96
+
<preclass="prettyprint source"><code>$ paperspace --help</code></pre><p>For authenticated requests, the Paperspace CLI will look in two places for an api key:</p>
97
+
<p>1) A command argument: <code>--apiKey</code>. Example:</p>
98
+
<preclass="prettyprint source"><code>$ paperspace machines show --apiKey "1ba4f98e7c0..." --machineId "ps123abc"</code></pre><p>2) An environment variable: <code>PAPERSPACE_API_KEY</code>. Example:</p>
$ paperspace machines show --machineId "ps123abc"</code></pre><h4>Calling the API with the CLI</h4><p>The CLI provides all methods as subcommands, using this scheme: <code>paperspace <namespace> <subcommand></code>. For example:</p>
101
+
<preclass="prettyprint source"><code>$ paperspace machines create --apiKey "1ba4f98e7c0..." --machineName "My Machine" --size 50 ...</code></pre><p>For information on all the methods available, see the <ahref="https://paperspace.github.io/paperspace-node">API documentation</a>.</p>
103
102
<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>
104
103
<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>
105
104
<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>
@@ -125,7 +124,7 @@ <h2>Copyright</h2><p>Copyright :copyright: 2017 Paperspace - All Rights Reserved
125
124
<brclass="clear">
126
125
127
126
<footer>
128
-
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sat Jul 15 2017 01:51:37 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
127
+
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Mon Aug 07 2017 17:19:51 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Thu Jul 13 2017 22:32:57 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
186
+
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Mon Aug 07 2017 17:19:51 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Thu Jul 13 2017 22:32:57 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
102
+
Documentation generated by <ahref="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Mon Aug 07 2017 17:19:51 GMT-0400 (EDT) using the <ahref="https://github.com/clenemt/docdash">docdash</a> theme.
0 commit comments