Wait for
Wait for the machine with the given id to enter a certain machine state. This action polls the server and returns only when we detect that the machine has transitioned into the given state. States available to check for are:
    off
    serviceready - services are running on the machine but the Paperspace agent is not yet available
    ready - services are running on machine and the Paperspace agent is ready to stream or accept logins
When the callback is called, the returned object will be information about the machine.
Examples
HTTPS
Node.js
1
# HTTP request:
2
# The waitefor method is only available using the API client.
3
# Use the show method to query the state of the machine via HTTP.
Copied!
1
paperspace.machines.waitfor({
2
machineId: 'ps123abc',
3
state: 'off',
4
}, function(err, res) {
5
// handle error or result
6
});
Copied!
Parameters
Name
Type
Description
machineId
string
Id of the machine to wait for
state
string
Name of the state to wait for, either 'off', 'serviceready', 'ready'
Returns:
machine - The machine JSON object
Type object
1
//Example return value:
2
{
3
"id": "ps123abc",
4
"name": "My Machine",
5
"os": "Microsoft Windows Server 2016 Datacenter",
6
"ram": "8589938688",
7
"cpus": 4,
8
"gpu": "GRID K160Q (2GB)",
9
"storageTotal": "53687091200",
10
"storageUsed": "110080",
11
"usageRate": "Air monthly",
12
"shutdownTimeoutInHours": 168,
13
"shutdownTimeoutForces": false,
14
"performAutoSnapshot": false,
15
"autoSnapshotFrequency": null,
16
"autoSnapshotSaveCount": null,
17
"agentType": "WindowsDesktop",
18
"dtCreated": "2016-11-18T05:18:29.533Z",
19
"state": "ready",
20
"updatesPending": false,
21
"networkId": "n789ghi",
22
"privateIpAddress": "10.64.21.47",
23
"publicIpAddress": null,
24
"region": "East Coast (NY2)",
25
"userId": "u123abc",
26
"teamId": "te456def",
27
"scriptId": "sc123abc",
28
"dtLastRun": "2017-06-30T07:22:49.763Z",
29
"dynamicPublicIp": null
30
}
Copied!
Last modified 9mo ago
Copy link