|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>jobs/machineTypes.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#.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#.machineTypes">machineTypes</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="login.html">login</a><ul class='methods'><li data-type='method'><a href="login.html#.user">user</a></li></ul></li><li><a href="logout.html">logout</a><ul class='methods'><li data-type='method'><a href="logout.html#.user">user</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="project.html">project</a><ul class='methods'><li data-type='method'><a href="project.html#.clear">clear</a></li><li data-type='method'><a href="project.html#.init">init</a></li><li data-type='method'><a href="project.html#.show">show</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">jobs/machineTypes.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 jobs |
| 47 | + * @method machineTypes |
| 48 | + * @description Return a list of available cluster machine types. If the isBusy property is true then all machines of the specified type and cluster are currently running jobs. |
| 49 | + * The machineTypes method takes an optional first argument to limit the returned cluster machine type objects. |
| 50 | + * @param {object} [filter] - An optional filter object to limit the returned job objects |
| 51 | + * @param {string} [filter.clusterName] - Optional cluster name to match on |
| 52 | + * @param {string} [filter.machineType] - Optional machine type to macth on |
| 53 | + * @param {boolean} [filter.isBusy] - Optional busy status value to match on |
| 54 | + * @param {function} cb - Node-style error-first callback function |
| 55 | + * @returns {array} [ clusterMachineType, ... ] - JSON array of available cluster machine type objects |
| 56 | + * @example |
| 57 | + * paperspace.jobs.machineTypes({ |
| 58 | + * // clusterName: 'PS Jobs', // optional filter on cluster name |
| 59 | + * // machineType: 'P5000', // optional filter on machine type |
| 60 | + * // isBusy: false, // optional filter on busy status |
| 61 | + * } function(err, res) { |
| 62 | + * // handle error or result |
| 63 | + * }); |
| 64 | + * @example |
| 65 | + * $ paperspace jobs machineTypes |
| 66 | + * @example |
| 67 | + * # HTTP request: |
| 68 | + * https://api.paperspace.io |
| 69 | + * GET /jobs/getClusterAvailableMachineTypes |
| 70 | + * x-api-key: 1ba4f98e7c0... |
| 71 | + * # Returns 200 on success |
| 72 | + * @example |
| 73 | + * //Example return value: |
| 74 | + * [ |
| 75 | + * { |
| 76 | + * "clusterType": "Jobs Cluster", |
| 77 | + * "clusterName": "PS Jobs", |
| 78 | + * "machineType": "P5000", |
| 79 | + * "isBusy": false, |
| 80 | + * }, |
| 81 | + * { |
| 82 | + * "clusterType": "Jobs Cluster", |
| 83 | + * "clusterName": "PS Jobs", |
| 84 | + * "machineType": "V100", |
| 85 | + * "isBusy": false, |
| 86 | + * }, |
| 87 | + * { |
| 88 | + * "clusterType": "Jobs Cluster", |
| 89 | + * "clusterName": "PS Jobs on GCP", |
| 90 | + * "machineType": "K80", |
| 91 | + * "isBusy": false, |
| 92 | + * }, |
| 93 | + * { |
| 94 | + * "clusterType": "Jobs Cluster", |
| 95 | + * "clusterName": "PS Jobs on GCP", |
| 96 | + * "machineType": "P100", |
| 97 | + * "isBusy": false, |
| 98 | + * } |
| 99 | + * ] |
| 100 | + */ |
| 101 | + |
| 102 | +function machineTypes(params, cb) { |
| 103 | + return method(machineTypes, params, cb); |
| 104 | +} |
| 105 | + |
| 106 | +assign(machineTypes, { |
| 107 | + auth: true, |
| 108 | + group: 'jobs', |
| 109 | + name: 'machineTypes', |
| 110 | + method: 'get', |
| 111 | + route: '/jobs/getClusterAvailableMachineTypes', |
| 112 | + requires: {}, |
| 113 | + returns: {}, |
| 114 | +}); |
| 115 | + |
| 116 | +module.exports = machineTypes; |
| 117 | +</code></pre> |
| 118 | + </article> |
| 119 | + </section> |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | +</div> |
| 125 | + |
| 126 | +<br class="clear"> |
| 127 | + |
| 128 | +<footer> |
| 129 | + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Mar 12 2018 14:11:38 GMT-0400 (EDT) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. |
| 130 | +</footer> |
| 131 | + |
| 132 | +<script>prettyPrint();</script> |
| 133 | +<script src="scripts/linenumber.js"></script> |
| 134 | +</body> |
| 135 | +</html> |
0 commit comments