Paperspace / paperspace-node

Paperspace API for node.js
https://www.paperspace.com/core
ISC License
75 stars 15 forks source link

Expose resource delegation create endpoint, ref. PS-9152 #36

Closed mlunoe closed 5 years ago

mlunoe commented 5 years ago

This PR exposes the resourceDelegations/create endpoint and updates the docs with this.

I tested this out by running NODE_ENV=development samples/sample-file.js, where the samples/sample-file.js looks like this:

var paperspace_node = require('../index');

// Set apkKey for use of the paperspace api
var paperspace = paperspace_node({
  apiKey: '9ddd...' // Substitue your actual apiKey here
});
var delegation = {
  "machine": {
    "ids": ["ps2n..."]
  }
};

paperspace.resourceDelegations.create(delegation, function (error, result) {
  console.log(error, result);
});