Description of image

resourceDelegations

Note
A new Paperspace API is now available. The Gradient and Core API endpoints will become unavailable on 15 July, 2024. For more information, see the release notes.

Create resourceDelegations with limited access, for example for users who needs to stream a machine you created. The create method takes a delegation object as the only argument with resource name as key and an object with ids to list resource ids to give access to.

Note
Resource delegations expire after 4 hours.

create

Examples

paperspace resourceDelegations create \
  --machine '{ "ids": ["psec02yp2"] }' \
  --apiKey "edc20a51d9b2145..."
curl -X POST 'https://api.paperspace.io/resourceDelegations/create' \
-H 'X-Api-Key: edc20a51d9b2145...' \
-H 'Content-Type: application/json' \
--data-raw '{
  "machine": {
    "ids": ["psec02yp2"]
  }
}'
var delegation = {
  machine: {
    ids: ["psec02yp2"],
  },
};
paperspace.resourceDelegations.create(delegation, function (err, res) {
  // handle error or result
});

Parameters

Name Type Attributes Description
machine object optional Optional resource ‘machine’ to grant access to.
ids array optional Optional list of machine ids to grant access to.

Response

Type object

{
  "delegation": {
    "machine": {
      "ids": ["psec02yp2"]
    }
  },
  "isEnabled": true,
  "accessTokenId": "resource-delegation-token-34d7e42302bf7c69013eb0e778991d21587fb73ba1d127608d0625a46d5b",
  "dtCreated": "2022-03-14T18:57:12.986Z",
  "id": 500908
}