PauseMachine
const url = 'https://example.com/hopbox.v1.MachineService/PauseMachine';const options = { method: 'POST', headers: { 'Connect-Protocol-Version': '1', 'Connect-Timeout-Ms': '1000', 'Content-Type': 'application/json' }, body: '{"id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/hopbox.v1.MachineService/PauseMachine \ --header 'Connect-Protocol-Version: 1' \ --header 'Connect-Timeout-Ms: 1000' \ --header 'Content-Type: application/json' \ --data '{ "id": "example" }'PauseMachine puts a running machine in standby, and waits for it. Its memory stays in the RAM of its node, and it still counts in the limits of its org and on its node.
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Define the version of the Connect protocol
Define the version of the Connect protocol
Example
1Define the timeout, in ms
Define the timeout, in ms
Example
1000Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Success
PauseMachineResponse holds the machine after the wait.
object
Machine is the machine at the end of the wait.
object
Id is the UUID of the machine.
Org_id is the UUID of the org of the machine.
Name is the name of the machine, unique in the install. It is the first label of its URL.
State is the current state.
Target_state is the state that the machine must reach.
Size is the size of the machine.
object
Name is the name of the size, for example default.
Vcpus is the count of vCPUs.
Memory_bytes is the RAM, in bytes.
Disk_bytes is the size of the sparse disk, in bytes.
Image_name is the name of the image that the machine started from, for example default.
Image_digest is the digest of that image: “sha256:” and 64 hex digits.
Creator_account_id is the UUID of the account that made the machine. It is empty for a machine that an org key made, and after the delete of the account.
Creator_key_id is the UUID of the org key that made the machine, or empty.
Shared is true for a machine that is open to the whole org.
Restart_policy says what happens when the machine stops by itself.
Start_command is the command that the guest agent runs after each boot, or empty.
Auto_delete_timeout is the time without use after which hopbox deletes the machine. Unset is off. The delete comes 1 to 2 minutes after this time from the last recorded use: a use is recorded at most once a minute, and the auto-delete job runs once a minute.
Url is https://
Url_port is the port in the machine that the URL reaches. The default is 8000.
Url_visibility says who can open the URL.
Ssh_port is the SSH port of the machine on the edge servers, 10000 to 30000. It never changes.
Reboot_pending is true while a reboot that a request asked for did not run yet.
Last_activity_time is the last use of the machine, for the auto-delete timeout.
State_change_time is the time of the last change of the current state.
Delete_request_time is the time of the delete request, or unset.
Version grows by 1 with each change of the machine: by a request, by a report of its executor, or by an env change that reaches it.
Create_time is the creation time of the machine.
Update_time is the time of the last change that a request made.
Skipped_env_vars is the count of env vars and secrets that the guest agent of the running machine left out, because their names break its rules.
Memory_saved is true while the node keeps a memory file of the machine: after a hibernate, and after a wake that failed. DiscardMemory drops it.
Auto_standby_timeout is the time without inbound traffic after which a running machine goes to standby. Unset is off. Like the auto-delete timeout, it counts from last_activity_time, 1 to 2 minutes late.
Auto_hibernate_timeout is the time without inbound traffic after which the machine hibernates, from running or from standby. Unset is off. Like the auto-delete timeout, it counts from last_activity_time, 1 to 2 minutes late.
Backup_period is the time between two scheduled backups of the machine. Unset is off, the default.
Backup_retention is how long hopbox keeps each backup of the machine. The default is 7 days.
Duration is how long the call took, the wait included.
Done is true when the machine is in standby at the end of the wait.
Example
{ "machine": { "state": "MACHINE_STATE_UNSPECIFIED", "targetState": "MACHINE_STATE_UNSPECIFIED", "restartPolicy": "RESTART_POLICY_UNSPECIFIED", "urlVisibility": "URL_VISIBILITY_UNSPECIFIED", "lastActivityTime": "2023-01-15T01:30:15.01Z", "stateChangeTime": "2023-01-15T01:30:15.01Z", "deleteRequestTime": "2023-01-15T01:30:15.01Z", "createTime": "2023-01-15T01:30:15.01Z", "updateTime": "2023-01-15T01:30:15.01Z" }}default
Section titled “default”Error
Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation
object
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
A list of messages that carry the error details. There is no limit on the number of messages.
Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details.
object
A URL that acts as a globally unique identifier for the type of the serialized message. For example: type.googleapis.com/google.rpc.ErrorInfo.
The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the type field.
Deserialized error detail payload. The ‘type’ field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.
object
Example
{ "code": "canceled"}