Resource Delegations
Create resourceDelegation with limited access, e.g. 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 will expire after 4 hours.
Examples
HTTP
Node.js
1
# HTTP request:
2
https://api.paperspace.io
3
POST /resourceDelegations/create
4
x-api-key: 1ba4f98e7c0...
5
{
6
"machine": {
7
"ids": ["m123abc", "m456def"]
8
}
9
}
10
# Returns 200 on success
Copied!
1
var delegation = {
2
machine: {
3
ids: ['m123abc', 'm456def']
4
}
5
};
6
paperspace.resourceDelegations.create(delegation, function(err, res) {
7
// handle error or result
8
});
Copied!
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.
Returns
{ delegation: { machine: ['m123abc', 'm456def', ... ] }, accessToken: 'resource-delegation-token-123abc...', ... } - JSON object with provided delegation and newly generated resourceDelegation access
Token Type object
1
// Example return value:
2
[
3
{
4
"delegation": {
5
"machine": {
6
"ids": [
7
"m123abc",
8
"m456def"
9
]
10
}
11
},
12
"isEnabled": true,
13
"accessTokenId": "resource-delegation-token-123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc",
14
"dtCreated": "2019-04-03T12:31:40.061Z",
15
"id": 123
16
}
17
]
Copied!
Last modified 6mo ago
Copy link