This repository was archived by the owner on Jun 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed
Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ module.exports = {
1212 show : require ( './show' ) ,
1313 start : require ( './start' ) ,
1414 stop : require ( './stop' ) ,
15+ utilization : require ( './utilization' ) ,
1516 waitfor : require ( './waitfor' ) ,
1617} ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ var method = require ( './../method' ) ;
4+ var assign = require ( 'lodash.assign' ) ;
5+
6+ /**
7+ * @memberof machines
8+ * @method utilization
9+ * @description Show machine utilization data for the machine with the given id.
10+ * @param {string } params.machineId - Id of the machine to show
11+ * @param {function } cb - Node-style error-first callback function
12+ * @returns {object } machine - The utilization JSON object
13+ * @example
14+ * paperspace.machines.utilization({
15+ * machineId: 'ps123abc',
16+ * }, function(err, resp) {
17+ * // handle error or http response
18+ * });
19+ * @example
20+ * $ paperspace machines utilization \
21+ * --machineId "ps123abc"
22+ * @example
23+ * # HTTP request:
24+ * https://api.paperspace.io
25+ * GET /machines/getUtilization?machineId=ps123abc
26+ * x-api-key: 1ba4f98e7c0...
27+ * # Returns 200 on success
28+ * @example
29+ * //Example return value:
30+ * {
31+ * "machineId": "ps123abc",
32+ * "secondsUsed": 1000,
33+ * }
34+ */
35+
36+ function utilization ( params , cb ) {
37+ return method ( utilization , params , cb ) ;
38+ }
39+
40+ assign ( utilization , {
41+ auth : true ,
42+ group : 'machines' ,
43+ name : 'utilization' ,
44+ method : 'get' ,
45+ route : '/machines/getUtilization' ,
46+ requires : {
47+ machineId : 'string' ,
48+ } ,
49+ returns : { } ,
50+ } ) ;
51+
52+ module . exports = utilization ;
You can’t perform that action at this time.
0 commit comments