|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>scripts/text.js - Documentation</title> |
| 6 | + |
| 7 | + <script src="scripts/prettify/prettify.js"></script> |
| 8 | + <script src="scripts/prettify/lang-css.js"></script> |
| 9 | + <!--[if lt IE 9]> |
| 10 | + <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> |
| 11 | + <![endif]--> |
| 12 | + <link type="text/css" rel="stylesheet" href="styles/prettify.css"> |
| 13 | + <link type="text/css" rel="stylesheet" href="styles/jsdoc.css"> |
| 14 | +</head> |
| 15 | +<body> |
| 16 | + |
| 17 | +<input type="checkbox" id="nav-trigger" class="nav-trigger" /> |
| 18 | +<label for="nav-trigger" class="navicon-button x"> |
| 19 | + <div class="navicon"></div> |
| 20 | +</label> |
| 21 | + |
| 22 | +<label for="nav-trigger" class="overlay"></label> |
| 23 | + |
| 24 | +<nav> |
| 25 | + <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="machines.html">machines</a><ul class='methods'><li data-type='method'><a href="machines.html#.create">create</a></li><li data-type='method'><a href="machines.html#.destroy">destroy</a></li><li data-type='method'><a href="machines.html#.list">list</a></li><li data-type='method'><a href="machines.html#.restart">restart</a></li><li data-type='method'><a href="machines.html#.show">show</a></li><li data-type='method'><a href="machines.html#.start">start</a></li><li data-type='method'><a href="machines.html#.stop">stop</a></li><li data-type='method'><a href="machines.html#.waitfor">waitfor</a></li></ul></li><li><a href="networks.html">networks</a><ul class='methods'><li data-type='method'><a href="networks.html#.list">list</a></li></ul></li><li><a href="scripts.html">scripts</a><ul class='methods'><li data-type='method'><a href="scripts.html#.create">create</a></li><li data-type='method'><a href="scripts.html#.destroy">destroy</a></li><li data-type='method'><a href="scripts.html#.list">list</a></li><li data-type='method'><a href="scripts.html#.show">show</a></li><li data-type='method'><a href="scripts.html#.text">text</a></li></ul></li><li><a href="templates.html">templates</a><ul class='methods'><li data-type='method'><a href="templates.html#.list">list</a></li></ul></li><li><a href="users.html">users</a><ul class='methods'><li data-type='method'><a href="users.html#.list">list</a></li></ul></li></ul> |
| 26 | +</nav> |
| 27 | + |
| 28 | +<div id="main"> |
| 29 | + |
| 30 | + <h1 class="page-title">scripts/text.js</h1> |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + <section> |
| 39 | + <article> |
| 40 | + <pre class="prettyprint source linenums"><code>'use strict'; |
| 41 | + |
| 42 | +var method = require('./../method'); |
| 43 | +var assign = require('lodash.assign'); |
| 44 | + |
| 45 | +/** |
| 46 | + * @memberof scripts |
| 47 | + * @method text |
| 48 | + * @description Gets the text of the script with the given id. |
| 49 | + * @param {object} params - Script text parameters |
| 50 | + * @param {string} params.scriptId - Id of the script to get text for |
| 51 | + * @param {function} cb - Node-style error-first callback function |
| 52 | + * @returns {object} script - The script JSON object |
| 53 | + * @example |
| 54 | + * paperspace.scripts.text({ |
| 55 | + * scriptId: 'sc123abc', |
| 56 | + * }, function(err, resp) { |
| 57 | + * // handle error or http response |
| 58 | + * }); |
| 59 | + * @example |
| 60 | + * $ paperspace scripts text \ |
| 61 | + * --scriptId "sc123abc" |
| 62 | + * @example |
| 63 | + * # HTTP request: |
| 64 | + * https://api.paperspace.io |
| 65 | + * GET /scripts/getScriptText?scriptId=sc123abc |
| 66 | + * x-api-key: 1ba4f98e7c0... |
| 67 | + * # Returns 200 on success |
| 68 | + * @example |
| 69 | + * //Example return value: |
| 70 | + * "services start nginx" |
| 71 | + */ |
| 72 | + |
| 73 | +function text(params, cb) { |
| 74 | + return method(text, params, cb); |
| 75 | +} |
| 76 | + |
| 77 | +assign(text, { |
| 78 | + auth: true, |
| 79 | + group: 'scripts', |
| 80 | + name: 'text', |
| 81 | + method: 'get', |
| 82 | + route: '/scripts/getScriptText', |
| 83 | + requires: { |
| 84 | + scriptId: 'string', |
| 85 | + }, |
| 86 | + returns: {}, |
| 87 | +}); |
| 88 | + |
| 89 | +module.exports = text; |
| 90 | +</code></pre> |
| 91 | + </article> |
| 92 | + </section> |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | +</div> |
| 98 | + |
| 99 | +<br class="clear"> |
| 100 | + |
| 101 | +<footer> |
| 102 | + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Jul 10 2017 00:32:10 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. |
| 103 | +</footer> |
| 104 | + |
| 105 | +<script>prettyPrint();</script> |
| 106 | +<script src="scripts/linenumber.js"></script> |
| 107 | +</body> |
| 108 | +</html> |
0 commit comments