|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>machines/update.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="jobs.html">jobs</a><ul class='methods'><li data-type='method'><a href="jobs.html#.artifactsDestroy">artifactsDestroy</a></li><li data-type='method'><a href="jobs.html#.artifactsGet">artifactsGet</a></li><li data-type='method'><a href="jobs.html#.artifactsList">artifactsList</a></li><li data-type='method'><a href="jobs.html#.artifactsShare">artifactsShare</a></li><li data-type='method'><a href="jobs.html#.clone">clone</a></li><li data-type='method'><a href="jobs.html#.create">create</a></li><li data-type='method'><a href="jobs.html#.destroy">destroy</a></li><li data-type='method'><a href="jobs.html#.list">list</a></li><li data-type='method'><a href="jobs.html#.logs">logs</a></li><li data-type='method'><a href="jobs.html#.show">show</a></li><li data-type='method'><a href="jobs.html#.stop">stop</a></li><li data-type='method'><a href="jobs.html#.waitfor">waitfor</a></li></ul></li><li><a href="machines.html">machines</a><ul class='methods'><li data-type='method'><a href="machines.html#.availability">availability</a></li><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#.update">update</a></li><li data-type='method'><a href="machines.html#.utilization">utilization</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">machines/update.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 machines |
| 47 | + * @method update |
| 48 | + * @description Update attributes of a machine. |
| 49 | + * @param {object} params - Machine update parameters |
| 50 | + * @param {string} params.machineId - Id of the machine to shut down |
| 51 | + * @param {string} [params.machineName] - New name for the machine |
| 52 | + * @param {number} [params.shutdownTimeoutInHours] - Number of hours before machine is shutdown if no one is logged in via the Paperspace client |
| 53 | + * @param {boolean} [params.shutdownTimeoutForces] - Force shutdown at shutdown timeout, even if there is a Paperspace client connection |
| 54 | + * @param {number} [params.autoSnapshotFrequency] - One of 'hour', 'day', 'week', or null |
| 55 | + * @param {number} [params.autoSnapshotSaveCount] - Number of snapshots to save |
| 56 | + * @param {boolean} [params.performAutoSnapshot] - Perform auto snapshots |
| 57 | + * @param {function} cb - Node-style error-first callback function |
| 58 | + * @example |
| 59 | + * paperspace.machines.update({ |
| 60 | + * machineId: 'ps123abc', |
| 61 | + * machineName: 'New Machine Name', |
| 62 | + * shutdownTimeoutInHours: 24, |
| 63 | + * shutdownTimeoutForces: true, |
| 64 | + * performAutoSnapshot: true, |
| 65 | + * autoSnapshotFrequency: 'week', |
| 66 | + * autoSnapshotSaveCount: 4 |
| 67 | + * }, function(err, resp) { |
| 68 | + * // handle error or http response |
| 69 | + * }); |
| 70 | + * @example |
| 71 | + * $ paperspace machines update --machineId "ps123abc" |
| 72 | + * --machineName "New Machine Name" \ |
| 73 | + * --shutdownTimeoutInHours 24 \ |
| 74 | + * --shutdownTimeoutForces true \ |
| 75 | + * --performAutoSnapshot true \ |
| 76 | + * --autoSnapshotFrequency "week" \ |
| 77 | + * --autoSnapshotSaveCount 4 |
| 78 | + * @example |
| 79 | + * # HTTP request: |
| 80 | + * https://api.paperspace.io |
| 81 | + * POST /machines/ps123abc/update {"machineId": "ps123abc", "machineName": "New Machine Name", "shutdownTimeoutInHours": 24, "shutdownTimeoutForces": true, "performAutoSnapshot": true, "autoSnapshotFrequency": "week", "autoSnapshotSaveCount": 4} |
| 82 | + * x-api-key: 1ba4f98e7c0... |
| 83 | + * # Returns 204 on success |
| 84 | + */ |
| 85 | + |
| 86 | +function start(params, cb) { |
| 87 | + return method(start, params, cb); |
| 88 | +} |
| 89 | + |
| 90 | +assign(start, { |
| 91 | + auth: true, |
| 92 | + group: 'machines', |
| 93 | + name: 'start', |
| 94 | + method: 'post', |
| 95 | + route: '/machines/:machineId/updateMachinePublic', |
| 96 | + requires: { |
| 97 | + machineId: 'string', |
| 98 | + }, |
| 99 | + returns: {}, |
| 100 | +}); |
| 101 | + |
| 102 | +module.exports = start; |
| 103 | +</code></pre> |
| 104 | + </article> |
| 105 | + </section> |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +</div> |
| 111 | + |
| 112 | +<br class="clear"> |
| 113 | + |
| 114 | +<footer> |
| 115 | + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Nov 28 2017 19:04:58 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. |
| 116 | +</footer> |
| 117 | + |
| 118 | +<script>prettyPrint();</script> |
| 119 | +<script src="scripts/linenumber.js"></script> |
| 120 | +</body> |
| 121 | +</html> |
0 commit comments