|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>machines/availability.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#.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#.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/availability.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 availability |
| 48 | + * @description Get machine availability for the given region and machine type. Note: availability is only provided for the dedicated GPU machine types. Also, not all machine types are available in all regions. |
| 49 | + * @param {object} params - Machine utilization parameters |
| 50 | + * @param {string} params.region - Name of the region: either 'East Coast (NY2)', 'West Coast (CA1)', or 'Europe (AMS1)' |
| 51 | + * @param {string} params.machineType - Machine type: either 'GPU+', 'P4000', 'P5000', 'P6000', or 'V100'<p> |
| 52 | + * @param {function} cb - Node-style error-first callback function |
| 53 | + * @returns {object} availability - The availability JSON object, containing a single boolean attribute, "available". A value of true for "available" means machines of that type can currently be requested in that region. A value of false means that requests for that machine type are not currently available in that region. |
| 54 | + * @example |
| 55 | + * paperspace.machines.availability({ |
| 56 | + * region: 'East Coast (NY2)', |
| 57 | + * machineType: 'GPU+', |
| 58 | + * }, function(err, resp) { |
| 59 | + * // handle error or http response |
| 60 | + * }); |
| 61 | + * @example |
| 62 | + * $ paperspace machines availability \ |
| 63 | + * --region "East Coast (NY2)" \ |
| 64 | + * --machineType "GPU+" |
| 65 | + * @example |
| 66 | + * # HTTP request: |
| 67 | + * https://api.paperspace.io |
| 68 | + * GET /machines/getAvailability?region=East%20Coast%20(NY2)&machineType=GPU%2B |
| 69 | + * x-api-key: 1ba4f98e7c0... |
| 70 | + * # Returns 200 on success |
| 71 | + * @example |
| 72 | + * //Example return value: |
| 73 | + * { |
| 74 | + * "available": true |
| 75 | + * } |
| 76 | + */ |
| 77 | + |
| 78 | +function availability(params, cb) { |
| 79 | + return method(availability, params, cb); |
| 80 | +} |
| 81 | + |
| 82 | +assign(availability, { |
| 83 | + auth: true, |
| 84 | + group: 'machines', |
| 85 | + name: 'availability', |
| 86 | + method: 'get', |
| 87 | + route: '/machines/getAvailability', |
| 88 | + requires: { |
| 89 | + machineId: 'string', |
| 90 | + region: 'string', |
| 91 | + }, |
| 92 | + returns: {}, |
| 93 | +}); |
| 94 | + |
| 95 | +module.exports = availability; |
| 96 | +</code></pre> |
| 97 | + </article> |
| 98 | + </section> |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | +</div> |
| 104 | + |
| 105 | +<br class="clear"> |
| 106 | + |
| 107 | +<footer> |
| 108 | + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Nov 13 2017 19:26:21 GMT-0500 (EST) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. |
| 109 | +</footer> |
| 110 | + |
| 111 | +<script>prettyPrint();</script> |
| 112 | +<script src="scripts/linenumber.js"></script> |
| 113 | +</body> |
| 114 | +</html> |
0 commit comments